diff options
author | Kamil Dudka <kdudka@redhat.com> | 2011-04-04 12:43:39 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2011-04-04 18:40:55 +0200 |
commit | 6bf5e24d48077db58b389e90558100fc121b8134 (patch) | |
tree | fc760711729113152560c1aae6b9e800d935d80f /libacl/acl_extended_file.c | |
parent | cd31bafa745bb0603a26a39ad8d7e4abd2756c10 (diff) | |
download | acl-6bf5e24d48077db58b389e90558100fc121b8134.tar.gz |
libacl: Add acl_extended_file_nofollow()
This function calls lgetxattr() instead of getxattr(), which helps ls(1)
to prevent unnecessary automatic mounts, which acl_extended_file()
triggers. See the following bug report for more details:
https://bugzilla.redhat.com/692982
Diffstat (limited to 'libacl/acl_extended_file.c')
-rw-r--r-- | libacl/acl_extended_file.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/libacl/acl_extended_file.c b/libacl/acl_extended_file.c index d1cb85d..f417784 100644 --- a/libacl/acl_extended_file.c +++ b/libacl/acl_extended_file.c @@ -1,7 +1,7 @@ /* File: acl_extended_file.c - Copyright (C) 2000 + Copyright (C) 2011 Andreas Gruenbacher, <a.gruenbacher@bestbits.at> This program is free software; you can redistribute it and/or @@ -23,26 +23,12 @@ #include <attr/xattr.h> #include "libacl.h" -#include "byteorder.h" -#include "acl_ea.h" +#include "__acl_extended_file.h" int acl_extended_file(const char *path_p) { - int base_size = sizeof(acl_ea_header) + 3 * sizeof(acl_ea_entry); - int retval; - - retval = getxattr(path_p, ACL_EA_ACCESS, NULL, 0); - if (retval < 0 && errno != ENOATTR && errno != ENODATA) - return -1; - if (retval > base_size) - return 1; - retval = getxattr(path_p, ACL_EA_DEFAULT, NULL, 0); - if (retval < 0 && errno != ENOATTR && errno != ENODATA) - return -1; - if (retval >= base_size) - return 1; - return 0; + return __acl_extended_file(path_p, getxattr); } |