|
|
3617ce |
From 8c5403834dfe57edcbc762cf7faee1b2643c5c31 Mon Sep 17 00:00:00 2001
|
|
|
3617ce |
From: Andreas Gruenbacher <agruen@linbit.com>
|
|
|
3617ce |
Date: Wed, 25 May 2011 18:18:53 +0200
|
|
|
3617ce |
Subject: [PATCH] walk_tree: do not follow symlink to directory with -h
|
|
|
3617ce |
|
|
|
3617ce |
Keep libmisc/walk_tree.c in sync with the version in the attr package;
|
|
|
3617ce |
no change in functionality for getfacl or setfacl.
|
|
|
3617ce |
|
|
|
3617ce |
Remove a related dead line of code from setfacl.
|
|
|
3617ce |
|
|
|
3617ce |
Upstream-commit: 3d80b8fa04cdc7fc89c49abff738bdbedb8ba758
|
|
|
3617ce |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
3617ce |
---
|
|
|
3617ce |
libmisc/walk_tree.c | 3 ++-
|
|
|
3617ce |
setfacl/setfacl.c | 1 -
|
|
|
3617ce |
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
3617ce |
|
|
|
3617ce |
diff --git a/libmisc/walk_tree.c b/libmisc/walk_tree.c
|
|
|
3617ce |
index 30ff92a..2be9d47 100644
|
|
|
3617ce |
--- a/libmisc/walk_tree.c
|
|
|
3617ce |
+++ b/libmisc/walk_tree.c
|
|
|
3617ce |
@@ -60,7 +60,8 @@ static int walk_tree_rec(const char *path, int walk_flags,
|
|
|
3617ce |
void *), void *arg, int depth)
|
|
|
3617ce |
{
|
|
|
3617ce |
int follow_symlinks = (walk_flags & WALK_TREE_LOGICAL) ||
|
|
|
3617ce |
- (!(walk_flags & WALK_TREE_PHYSICAL) &&
|
|
|
3617ce |
+ ((walk_flags & WALK_TREE_DEREFERENCE) &&
|
|
|
3617ce |
+ !(walk_flags & WALK_TREE_PHYSICAL) &&
|
|
|
3617ce |
depth == 0);
|
|
|
3617ce |
int have_dir_stat = 0, flags = walk_flags, err;
|
|
|
3617ce |
struct entry_handle dir;
|
|
|
3617ce |
diff --git a/setfacl/setfacl.c b/setfacl/setfacl.c
|
|
|
3617ce |
index 4f4ff27..81062a6 100644
|
|
|
3617ce |
--- a/setfacl/setfacl.c
|
|
|
3617ce |
+++ b/setfacl/setfacl.c
|
|
|
3617ce |
@@ -595,7 +595,6 @@ int main(int argc, char *argv[])
|
|
|
3617ce |
break;
|
|
|
3617ce |
|
|
|
3617ce |
case 'P': /* do not follow symlinks */
|
|
|
3617ce |
- walk_flags |= WALK_TREE_PHYSICAL;
|
|
|
3617ce |
walk_flags |= WALK_TREE_PHYSICAL;
|
|
|
3617ce |
walk_flags &= ~(WALK_TREE_LOGICAL | WALK_TREE_DEREFERENCE |
|
|
|
3617ce |
WALK_TREE_DEREFERENCE_TOPLEVEL);
|
|
|
3617ce |
--
|
|
|
3617ce |
2.20.1
|
|
|
3617ce |
|