Blame SOURCES/acl-2.2.51-getfacl-symlink-to-dir.patch

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