mirror of
https://github.com/vgough/encfs.git
synced 2024-11-22 07:53:31 +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:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
|
- attr
|
||||||
- clang
|
- clang
|
||||||
- cmake
|
- cmake
|
||||||
- fuse
|
- fuse
|
||||||
|
@ -712,9 +712,9 @@ int _do_listxattr(EncFS_Context *, const string &cyName, char *list,
|
|||||||
size_t size) {
|
size_t size) {
|
||||||
#ifdef XATTR_ADD_OPT
|
#ifdef XATTR_ADD_OPT
|
||||||
int options = 0;
|
int options = 0;
|
||||||
int res = ::listxattr(cyName.c_str(), list, size, options);
|
int res = ::llistxattr(cyName.c_str(), list, size, options);
|
||||||
#else
|
#else
|
||||||
int res = ::listxattr(cyName.c_str(), list, size);
|
int res = ::llistxattr(cyName.c_str(), list, size);
|
||||||
#endif
|
#endif
|
||||||
return (res == -1) ? -errno : res;
|
return (res == -1) ? -errno : res;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# Test EncFS --reverse mode
|
# Test EncFS --reverse mode
|
||||||
|
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 26;
|
use Test::More tests => 31;
|
||||||
use File::Path;
|
use File::Path;
|
||||||
use File::Temp;
|
use File::Temp;
|
||||||
use IO::Handle;
|
use IO::Handle;
|
||||||
@ -84,6 +84,9 @@ sub symlink_test
|
|||||||
$dec = readlink("$decrypted/symlink");
|
$dec = readlink("$decrypted/symlink");
|
||||||
ok( $dec eq $target, "symlink to '$target'") or
|
ok( $dec eq $target, "symlink to '$target'") or
|
||||||
print("# (original) $target' != '$dec' (decrypted)\n");
|
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");
|
unlink("$plain/symlink");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user