Re: Honor extractor's umask in git-tar-tree.
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Oct 3, 2005, 18:18 UTC
- Message-ID
- <Pine.LNX.4.64.0510031113500.31407@g5.osdl.org>
- In-Reply-To
- <434172FD.7020302@zytor.com>
On Mon, 3 Oct 2005, H. Peter Anvin wrote:
Show 15 quoted lines
> > Linus Torvalds wrote: > > > > As to tar: I think the current > > > > if (S_ISDIR(mode) || S_ISREG(mode)) > > mode |= (mode & 0100) ? 0777 : 0666; > > > > is wrong. It makes things world-writable by default, and that's just > > dangerous. > > That's standard in the Unix world, though; of course, the user's umask > shouldn't be set to zero unless things are in very special circumstances. In > the case of tar, the umask is applied on extraction unless the user explicitly > specifies -p.
Is it? The only place umask is mentioned in the man-page is
--no-same-permissions
apply user?s umask when extracting files instead of recorded
permissionsbut if tar really does honor umask, then hey, that 0777/0666 is fine.
(Ahh, googling a bit more, it appears that "-p" is default for root, which explains why you'd need the "anti-flag").
Linus