git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
              permissions
but 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
Previous: H. Peter AnvinNext: H. Peter Anvin
Message 15 of 18 in “Destructive side-effect of "cg-status"”
  1. Wolfgang DenkSep 30, 2005
  2. Martin LanghoffOct 1, 2005
  3. Linus TorvaldsOct 1, 2005
  4. Junio C HamanoOct 1, 2005
  5. Honor extractor's umask in git-tar-tree.Junio C Hamano, Oct 1, 2005
  6. H. Peter AnvinOct 2, 2005
  7. Matthias UrlichsOct 2, 2005
  8. H. Peter AnvinOct 3, 2005
  9. Junio C HamanoOct 3, 2005
  10. H. Peter AnvinOct 3, 2005
  11. Junio C HamanoOct 3, 2005
  12. H. Peter AnvinOct 3, 2005
  13. Linus TorvaldsOct 3, 2005
  14. H. Peter AnvinOct 3, 2005
  15. Linus TorvaldsOct 3, 2005
  16. H. Peter AnvinOct 3, 2005
  17. Wolfgang DenkOct 1, 2005
  18. Linus TorvaldsOct 1, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.