Magellan Linux

Annotation of /trunk/acl/patches/acl-2.2.47-introduce-new-WALK_TREE_DEREFERENCE_TOPLEVEL-flag.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 949 - (hide annotations) (download)
Tue Dec 22 22:35:23 2009 UTC (14 years, 5 months ago) by niro
File size: 1749 byte(s)
-added acl patches

1 niro 949 http://bugs.gentoo.org/265425
2    
3     From 1a80c89ee88357137b598fa3357b576933c5746c Mon Sep 17 00:00:00 2001
4     From: Andreas Gruenbacher <agruen@suse.de>
5     Date: Tue, 23 Jun 2009 00:17:49 +0200
6     Subject: [PATCH] Introduce new WALK_TREE_DEREFERENCE_TOPLEVEL flag
7    
8     This flag indicates to dereference top-level symlinks. (If non
9     top-level symlinks should be stat()ed as well, the
10     WALK_TREE_DEREFERENCE flag must be specified.)
11     ---
12     include/walk_tree.h | 9 +++++----
13     libmisc/walk_tree.c | 4 +++-
14     2 files changed, 8 insertions(+), 5 deletions(-)
15    
16     diff --git a/include/walk_tree.h b/include/walk_tree.h
17     index 53a8fc5..9f1ec34 100644
18     --- a/include/walk_tree.h
19     +++ b/include/walk_tree.h
20     @@ -20,10 +20,11 @@
21     #ifndef __WALK_TREE_H
22     #define __WALK_TREE_H
23    
24     -#define WALK_TREE_RECURSIVE 0x1
25     -#define WALK_TREE_PHYSICAL 0x2
26     -#define WALK_TREE_LOGICAL 0x4
27     -#define WALK_TREE_DEREFERENCE 0x8
28     +#define WALK_TREE_RECURSIVE 0x01
29     +#define WALK_TREE_PHYSICAL 0x02
30     +#define WALK_TREE_LOGICAL 0x04
31     +#define WALK_TREE_DEREFERENCE 0x08
32     +#define WALK_TREE_DEREFERENCE_TOPLEVEL 0x10
33    
34     #define WALK_TREE_TOPLEVEL 0x100
35     #define WALK_TREE_SYMLINK 0x200
36     diff --git a/libmisc/walk_tree.c b/libmisc/walk_tree.c
37     index 2777145..30ff92a 100644
38     --- a/libmisc/walk_tree.c
39     +++ b/libmisc/walk_tree.c
40     @@ -78,7 +78,9 @@ static int walk_tree_rec(const char *path, int walk_flags,
41     return func(path, NULL, flags | WALK_TREE_FAILED, arg);
42     if (S_ISLNK(st.st_mode)) {
43     flags |= WALK_TREE_SYMLINK;
44     - if (flags & WALK_TREE_DEREFERENCE) {
45     + if ((flags & WALK_TREE_DEREFERENCE) ||
46     + ((flags & WALK_TREE_TOPLEVEL) &&
47     + (flags & WALK_TREE_DEREFERENCE_TOPLEVEL))) {
48     if (stat(path, &st) != 0)
49     return func(path, NULL,
50     flags | WALK_TREE_FAILED, arg);
51     --
52     1.6.3.3
53