diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-27 23:42:25 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-27 23:42:25 +0000 |
commit | 8c35d65c43216bb840326ac7476a180e2ae36fe9 (patch) | |
tree | 13d20b31e817dcff5124498ca0bec2cdf9781014 /coreutils/chown.c | |
parent | e80e2a3660bf09cc549cb2dfd2bdeb77ccde1231 (diff) | |
download | busybox-w32-8c35d65c43216bb840326ac7476a180e2ae36fe9.tar.gz busybox-w32-8c35d65c43216bb840326ac7476a180e2ae36fe9.tar.bz2 busybox-w32-8c35d65c43216bb840326ac7476a180e2ae36fe9.zip |
recursive_action: add depth param
chmod: match coreutils versus following links
Diffstat (limited to 'coreutils/chown.c')
-rw-r--r-- | coreutils/chown.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/coreutils/chown.c b/coreutils/chown.c index bef89ce86..fddce7cf1 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c | |||
@@ -32,7 +32,7 @@ static int (*chown_func)(const char *, uid_t, gid_t) = chown; | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | static int fileAction(const char *fileName, struct stat *statbuf, | 34 | static int fileAction(const char *fileName, struct stat *statbuf, |
35 | void ATTRIBUTE_UNUSED *junk) | 35 | void ATTRIBUTE_UNUSED *junk, int depth) |
36 | { | 36 | { |
37 | // TODO: -H/-L/-P | 37 | // TODO: -H/-L/-P |
38 | // if (depth ... && S_ISLNK(statbuf->st_mode)) .... | 38 | // if (depth ... && S_ISLNK(statbuf->st_mode)) .... |
@@ -75,7 +75,8 @@ int chown_main(int argc, char **argv) | |||
75 | *groupName++ = '\0'; | 75 | *groupName++ = '\0'; |
76 | gid = get_ug_id(groupName, bb_xgetgrnam); | 76 | gid = get_ug_id(groupName, bb_xgetgrnam); |
77 | } | 77 | } |
78 | if (--groupName != *argv) uid = get_ug_id(*argv, bb_xgetpwnam); | 78 | if (--groupName != *argv) |
79 | uid = get_ug_id(*argv, bb_xgetpwnam); | ||
79 | ++argv; | 80 | ++argv; |
80 | 81 | ||
81 | /* Ok, ready to do the deed now */ | 82 | /* Ok, ready to do the deed now */ |
@@ -86,7 +87,8 @@ int chown_main(int argc, char **argv) | |||
86 | FALSE, // depth first | 87 | FALSE, // depth first |
87 | fileAction, // file action | 88 | fileAction, // file action |
88 | fileAction, // dir action | 89 | fileAction, // dir action |
89 | NULL) // user data | 90 | NULL, // user data |
91 | 0) // depth | ||
90 | ) { | 92 | ) { |
91 | retval = EXIT_FAILURE; | 93 | retval = EXIT_FAILURE; |
92 | } | 94 | } |