From: Paul Eggert Date: Mon, 30 Nov 1998 22:17:11 +0000 (+0000) Subject: (set_stat): chmod after chown even when not root; if we are using X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=53a5ac41d2847fd12f9ad894898f2e77299abeee;p=chaz%2Ftar (set_stat): chmod after chown even when not root; if we are using --same-owner this is needed e.g. on Solaris 2.5.1. --- diff --git a/src/extract.c b/src/extract.c index 5ca7a26..ccaf5fe 100644 --- a/src/extract.c +++ b/src/extract.c @@ -204,9 +204,9 @@ set_stat (char *file_name, struct stat *stat_info, int symlink_flag) /* On a few systems, and in particular, those allowing to give files away, changing the owner or group destroys the suid or sgid bits. - So, when root, let's attempt setting these bits once more. */ + So let's attempt setting these bits once more. */ - if (we_are_root && (stat_info->st_mode & (S_ISUID | S_ISGID | S_ISVTX))) + if (stat_info->st_mode & (S_ISUID | S_ISGID | S_ISVTX)) set_mode (file_name, stat_info); } }