Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extended attributes in 0.14 / linux #178

Open
t-szczyrba opened this issue Jan 16, 2015 · 2 comments
Open

extended attributes in 0.14 / linux #178

t-szczyrba opened this issue Jan 16, 2015 · 2 comments

Comments

@t-szczyrba
Copy link

attic checks if extended attributes are enabled in func defined in attic/xattr.py

def is_enabled():
"""Determine if xattr is enabled on the filesystem
"""
with tempfile.NamedTemporaryFile() as fd:
.....

but really the func only checks if extended attributes are enabled in /tmp directory, what seems to be not quite right for every scenario (in opensuse 13.2 /tmp is mountpoint for tmpfs).

There are also other issue concerning extenden attributed - not every filesystem makes possible to set it for links, what attic seems to assume, when extended attributes work it must work the same way in every filesystem.

Tests in my opensuse 13.2 installation can't really be performed:

Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/Attic-0.14_dirty-py3.4-linux-i686.egg/attic/testsuite/archiver.py", line 152, in test_basic_functionality
self.create_test_files()
File "/usr/lib/python3.4/site-packages/Attic-0.14_dirty-py3.4-linux-i686.egg/attic/testsuite/archiver.py", line 145, in create_test_files
xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
File "/usr/lib/python3.4/site-packages/Attic-0.14_dirty-py3.4-linux-i686.egg/attic/xattr.py", line 101, in setxattr
_check(func(path, name, value, len(value) if value else 0, 0), path)
File "/usr/lib/python3.4/site-packages/Attic-0.14_dirty-py3.4-linux-i686.egg/attic/xattr.py", line 36, in _check
raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/tmp/tmpx6jsc97w/input/link1'

@ThomasWaldmann
Copy link
Contributor

I can confirm the issue with setxattr on symlinks, that line 145 in the traceback. And some other linux people on the IRC chan have the same issue.

About is_enabled checking just /tmp (or $TMP, $TMPDIR, $TEMP):
It's good enough for the tests, as they create all input data there.
I agree it should get a path=None param, so it is more generally useful and can be called upon a specific path.

@ThomasWaldmann
Copy link
Contributor

See PR #235.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants