From: Glenn L McGrath Date: Mon, 8 Sep 2003 14:34:23 +0000 (-0000) Subject: Preserve suid/sgid bits X-Git-Tag: 1_00_pre3~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=55bf79f9441471b45394bf479a2d78039a7dc4cf;p=oweals%2Fbusybox.git Preserve suid/sgid bits --- diff --git a/coreutils/chown.c b/coreutils/chown.c index 7b9ea9175..02b752474 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. */