X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fchown.c;h=07d673f28d12668d785e0a0929a775d64cca0019;hb=637d2266e1ea711f27ab0aec200a196b5eccbbca;hp=7b9ea91753f4c2a726d83b55bc3ae2a3715bf9d3;hpb=85e5e72bc1acd9d58c11bde6e14c8270cd9f169f;p=oweals%2Fbusybox.git diff --git a/coreutils/chown.c b/coreutils/chown.c index 7b9ea9175..07d673f28 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c @@ -43,6 +43,7 @@ static int (*chown_func)(const char *, uid_t, gid_t) = chown; static int fileAction(const char *fileName, struct stat *statbuf, void* junk) { if (chown_func(fileName, uid, (gid == -1) ? statbuf->st_gid : gid) == 0) { + chmod(fileName, statbuf->st_mode); return (TRUE); } bb_perror_msg("%s", fileName); /* Avoid multibyte problems. */ @@ -52,19 +53,6 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk) #define FLAG_R 1 #define FLAG_h 2 -static unsigned long get_ug_id(const char *s, long (*my_getxxnam)(const char *)) -{ - unsigned long r; - char *p; - - r = strtoul(s, &p, 10); - if (*p || (s == p)) { - r = my_getxxnam(s); - } - - return r; -} - int chown_main(int argc, char **argv) { int flags;