mirror of
https://github.com/vgough/encfs.git
synced 2024-11-21 23:43:26 +01:00
Merge pull request #287 from dinoboy197/resolve_extattrs_for_symlinks
Resolve xattrs for symlinks (resolves #247, resolves #283)
This commit is contained in:
commit
62505fa240
@ -40,6 +40,7 @@ addons:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- attr
|
||||
- clang
|
||||
- cmake
|
||||
- fuse
|
||||
|
@ -712,9 +712,9 @@ int _do_listxattr(EncFS_Context *, const string &cyName, char *list,
|
||||
size_t size) {
|
||||
#ifdef XATTR_ADD_OPT
|
||||
int options = 0;
|
||||
int res = ::listxattr(cyName.c_str(), list, size, options);
|
||||
int res = ::llistxattr(cyName.c_str(), list, size, options);
|
||||
#else
|
||||
int res = ::listxattr(cyName.c_str(), list, size);
|
||||
int res = ::llistxattr(cyName.c_str(), list, size);
|
||||
#endif
|
||||
return (res == -1) ? -errno : res;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
# Test EncFS --reverse mode
|
||||
|
||||
use warnings;
|
||||
use Test::More tests => 26;
|
||||
use Test::More tests => 31;
|
||||
use File::Path;
|
||||
use File::Temp;
|
||||
use IO::Handle;
|
||||
@ -84,6 +84,9 @@ sub symlink_test
|
||||
$dec = readlink("$decrypted/symlink");
|
||||
ok( $dec eq $target, "symlink to '$target'") or
|
||||
print("# (original) $target' != '$dec' (decrypted)\n");
|
||||
system("attr", "-l", "$decrypted/symlink");
|
||||
my $return_code = $?;
|
||||
is($return_code, 0, "symlink to '$target' extended attributes can be read (return code was $return_code)");
|
||||
unlink("$plain/symlink");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user