Blame SOURCES/attr-2.4.44-bz660613.patch

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