diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2009-06-23 00:29:45 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2009-06-23 00:29:45 +0200 |
commit | 63451a06b7484d220750ed8574d3ee84e156daf5 (patch) | |
tree | 378e038e89d1e1725b9df18e3034229f34b6926b | |
parent | 943f82dfa6ac250be30e4efe147831e9765cda93 (diff) | |
download | acl-63451a06b7484d220750ed8574d3ee84e156daf5.tar.gz |
Make sure that getfacl -R only calls stat(2) on symlinks when it needs to
This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790
"getfacl follows symlinks, even without -L".
-rw-r--r-- | doc/CHANGES | 3 | ||||
-rw-r--r-- | getfacl/getfacl.c | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/doc/CHANGES b/doc/CHANGES index 327a19b..c5ff1a8 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,6 @@ +* Make sure that getfacl -R only calls stat(2) on symlinks when it needs to. + This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 "getfacl follows + symlinks, even without -L". * Stop quoting nonprintable characters in the getfacl output: what is printable or not depends on the locale settings, and getfacl often gets it wrong. We still need to quote a few special characters like newlines so that setfacl diff --git a/getfacl/getfacl.c b/getfacl/getfacl.c index fc650e3..b3e6200 100644 --- a/getfacl/getfacl.c +++ b/getfacl/getfacl.c @@ -70,7 +70,7 @@ struct option long_options[] = { const char *progname; const char *cmd_line_options; -int walk_flags = WALK_TREE_DEREFERENCE; +int walk_flags = WALK_TREE_DEREFERENCE_TOPLEVEL; int opt_print_acl; int opt_print_default_acl; int opt_strip_leading_slash = 1; @@ -642,7 +642,7 @@ int main(int argc, char *argv[]) case 'L': /* follow all symlinks */ if (posixly_correct) goto synopsis; - walk_flags |= WALK_TREE_LOGICAL; + walk_flags |= WALK_TREE_LOGICAL | WALK_TREE_DEREFERENCE; walk_flags &= ~WALK_TREE_PHYSICAL; break; @@ -650,7 +650,8 @@ int main(int argc, char *argv[]) if (posixly_correct) goto synopsis; walk_flags |= WALK_TREE_PHYSICAL; - walk_flags &= ~WALK_TREE_LOGICAL; + walk_flags &= ~(WALK_TREE_LOGICAL | WALK_TREE_DEREFERENCE | + WALK_TREE_DEREFERENCE_TOPLEVEL); break; case 's': /* skip files with only base entries */ |