summaryrefslogtreecommitdiff
path: root/libmisc
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2009-06-23 00:17:49 +0200
committerAndreas Gruenbacher <agruen@suse.de>2009-06-23 00:17:49 +0200
commit1a80c89ee88357137b598fa3357b576933c5746c (patch)
tree4cc970c0380ae3bdc8da52fa2d0c334c98146278 /libmisc
parent6fab4d7598d0be4908e54d469171a1715e57cda2 (diff)
downloadacl-1a80c89ee88357137b598fa3357b576933c5746c.tar.gz
Introduce new WALK_TREE_DEREFERENCE_TOPLEVEL flag
This flag indicates to dereference top-level symlinks. (If non top-level symlinks should be stat()ed as well, the WALK_TREE_DEREFERENCE flag must be specified.)
Diffstat (limited to 'libmisc')
-rw-r--r--libmisc/walk_tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmisc/walk_tree.c b/libmisc/walk_tree.c
index 2777145..30ff92a 100644
--- a/libmisc/walk_tree.c
+++ b/libmisc/walk_tree.c
@@ -78,7 +78,9 @@ static int walk_tree_rec(const char *path, int walk_flags,
return func(path, NULL, flags | WALK_TREE_FAILED, arg);
if (S_ISLNK(st.st_mode)) {
flags |= WALK_TREE_SYMLINK;
- if (flags & WALK_TREE_DEREFERENCE) {
+ if ((flags & WALK_TREE_DEREFERENCE) ||
+ ((flags & WALK_TREE_TOPLEVEL) &&
+ (flags & WALK_TREE_DEREFERENCE_TOPLEVEL))) {
if (stat(path, &st) != 0)
return func(path, NULL,
flags | WALK_TREE_FAILED, arg);