aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-09-08 14:34:23 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-09-08 14:34:23 +0000
commit55bf79f9441471b45394bf479a2d78039a7dc4cf (patch)
tree542040a104de16b46e4111731af12838bca1ac3a /coreutils
parentb65422cf652c3f04cf6edd4c6050186df25e844c (diff)
downloadbusybox-55bf79f9441471b45394bf479a2d78039a7dc4cf.tar.gz
Preserve suid/sgid bits
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/chown.c1
1 files changed, 1 insertions, 0 deletions
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. */