Blame SOURCES/attr-2.4.44-bz660613.patch

b53709
From bad2f36467d1f606eb418542a23949743708304e Mon Sep 17 00:00:00 2001
b53709
From: Kamil Dudka <kdudka@redhat.com>
b53709
Date: Wed, 22 Dec 2010 15:03:48 +0100
b53709
Subject: [PATCH] walk_tree: do not follow symlink to directory with -h
b53709
MIME-Version: 1.0
b53709
Content-Type: text/plain; charset=UTF-8
b53709
Content-Transfer-Encoding: 8bit
b53709
b53709
reported by Jean-Pierre André at https://bugzilla.redhat.com/660613
b53709
---
b53709
 libmisc/walk_tree.c |    3 ++-
b53709
 test/attr.test      |    8 ++++++++
b53709
 2 files changed, 10 insertions(+), 1 deletions(-)
b53709
b53709
diff --git a/libmisc/walk_tree.c b/libmisc/walk_tree.c
b53709
index b82a301..e237e85 100644
b53709
--- a/libmisc/walk_tree.c
b53709
+++ b/libmisc/walk_tree.c
b53709
@@ -60,7 +60,8 @@ static int walk_tree_rec(const char *path, int walk_flags,
b53709
 				     void *), void *arg, int depth)
b53709
 {
b53709
 	int follow_symlinks = (walk_flags & WALK_TREE_LOGICAL) ||
b53709
-			      (!(walk_flags & WALK_TREE_PHYSICAL) &&
b53709
+			      ((walk_flags & WALK_TREE_DEREFERENCE) &&
b53709
+			       !(walk_flags & WALK_TREE_PHYSICAL) &&
b53709
 			       depth == 0);
b53709
 	int have_dir_stat = 0, flags = walk_flags, err;
b53709
 	struct entry_handle dir;
b53709
diff --git a/test/attr.test b/test/attr.test
b53709
index 10f10d0..a3e472d 100644
b53709
--- a/test/attr.test
b53709
+++ b/test/attr.test
b53709
@@ -221,6 +221,14 @@ Attributes of symlinks vs. the files pointed to
b53709
 
b53709
 	$ rm f
b53709
 
b53709
+Attributes of symlinks vs. the files pointed to in a directory
b53709
+
b53709
+	$ mkdir src
b53709
+	$ touch src/target
b53709
+	$ setfattr -n user.color -v blue src/target
b53709
+	$ ln -s src symlink
b53709
+	$ getfattr -n user.color -h symlink 2>/dev/null
b53709
+
b53709
 Tests for file name that contain special characters
b53709
 
b53709
 	$ touch "f "
b53709
-- 
b53709
1.7.3.3
b53709