diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-07-02 01:30:25 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-07-02 01:30:25 +0000 |
commit | b09426559611f65f395046b68c3d036342fc9279 (patch) | |
tree | 4b8e82d9bde4650195758147261a750049c338b6 /sys-apps/acl/files | |
parent | Fixed elog message, bug #272902. (diff) | |
download | gentoo-2-b09426559611f65f395046b68c3d036342fc9279.tar.gz gentoo-2-b09426559611f65f395046b68c3d036342fc9279.tar.bz2 gentoo-2-b09426559611f65f395046b68c3d036342fc9279.zip |
Add symlink fixes from upstream #265425 by Radek Podgorny.
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/acl/files')
-rw-r--r-- | sys-apps/acl/files/0001-Introduce-new-WALK_TREE_DEREFERENCE_TOPLEVEL-flag.patch | 53 | ||||
-rw-r--r-- | sys-apps/acl/files/0001-Make-sure-that-getfacl-R-only-calls-stat-2-on-symlin.patch | 47 |
2 files changed, 100 insertions, 0 deletions
diff --git a/sys-apps/acl/files/0001-Introduce-new-WALK_TREE_DEREFERENCE_TOPLEVEL-flag.patch b/sys-apps/acl/files/0001-Introduce-new-WALK_TREE_DEREFERENCE_TOPLEVEL-flag.patch new file mode 100644 index 000000000000..7f070a899d78 --- /dev/null +++ b/sys-apps/acl/files/0001-Introduce-new-WALK_TREE_DEREFERENCE_TOPLEVEL-flag.patch @@ -0,0 +1,53 @@ +http://bugs.gentoo.org/265425 + +From 1a80c89ee88357137b598fa3357b576933c5746c Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@suse.de> +Date: Tue, 23 Jun 2009 00:17:49 +0200 +Subject: [PATCH] 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.) +--- + include/walk_tree.h | 9 +++++---- + libmisc/walk_tree.c | 4 +++- + 2 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/include/walk_tree.h b/include/walk_tree.h +index 53a8fc5..9f1ec34 100644 +--- a/include/walk_tree.h ++++ b/include/walk_tree.h +@@ -20,10 +20,11 @@ + #ifndef __WALK_TREE_H + #define __WALK_TREE_H + +-#define WALK_TREE_RECURSIVE 0x1 +-#define WALK_TREE_PHYSICAL 0x2 +-#define WALK_TREE_LOGICAL 0x4 +-#define WALK_TREE_DEREFERENCE 0x8 ++#define WALK_TREE_RECURSIVE 0x01 ++#define WALK_TREE_PHYSICAL 0x02 ++#define WALK_TREE_LOGICAL 0x04 ++#define WALK_TREE_DEREFERENCE 0x08 ++#define WALK_TREE_DEREFERENCE_TOPLEVEL 0x10 + + #define WALK_TREE_TOPLEVEL 0x100 + #define WALK_TREE_SYMLINK 0x200 +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); +-- +1.6.3.3 + diff --git a/sys-apps/acl/files/0001-Make-sure-that-getfacl-R-only-calls-stat-2-on-symlin.patch b/sys-apps/acl/files/0001-Make-sure-that-getfacl-R-only-calls-stat-2-on-symlin.patch new file mode 100644 index 000000000000..f3925c76003b --- /dev/null +++ b/sys-apps/acl/files/0001-Make-sure-that-getfacl-R-only-calls-stat-2-on-symlin.patch @@ -0,0 +1,47 @@ +http://bugs.gentoo.org/265425 + +From 63451a06b7484d220750ed8574d3ee84e156daf5 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruen@suse.de> +Date: Tue, 23 Jun 2009 00:29:45 +0200 +Subject: [PATCH] Make sure that getfacl -R only calls stat(2) on symlinks when it needs to + +This fixes http://oss.sgi.com/bugzilla/show_bug.cgi?id=790 +"getfacl follows symlinks, even without -L". +--- + getfacl/getfacl.c | 7 ++++--- + +diff --git a/getfacl/getfacl.c b/getfacl/getfacl.c +index fc650e3..b3e6200 100644 +--- a/getfacl/getfacl.c ++++ b/getfacl/getfacl.c +@@ -70,7 +70,7 @@ struct option long_options[] = { + const char *progname; + const char *cmd_line_options; + +-int walk_flags = WALK_TREE_DEREFERENCE; ++int walk_flags = WALK_TREE_DEREFERENCE_TOPLEVEL; + int opt_print_acl; + int opt_print_default_acl; + int opt_strip_leading_slash = 1; +@@ -642,7 +642,7 @@ int main(int argc, char *argv[]) + case 'L': /* follow all symlinks */ + if (posixly_correct) + goto synopsis; +- walk_flags |= WALK_TREE_LOGICAL; ++ walk_flags |= WALK_TREE_LOGICAL | WALK_TREE_DEREFERENCE; + walk_flags &= ~WALK_TREE_PHYSICAL; + break; + +@@ -650,7 +650,8 @@ int main(int argc, char *argv[]) + if (posixly_correct) + goto synopsis; + walk_flags |= WALK_TREE_PHYSICAL; +- walk_flags &= ~WALK_TREE_LOGICAL; ++ walk_flags &= ~(WALK_TREE_LOGICAL | WALK_TREE_DEREFERENCE | ++ WALK_TREE_DEREFERENCE_TOPLEVEL); + break; + + case 's': /* skip files with only base entries */ +-- +1.6.3.3 + |