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

Re: [PATCH] tar-tree: add the "tar.applyUmask" config option

From
Willy Tarreau <w@1wt.eu>
Date
Jul 20, 2006, 09:55 UTC
Message-ID
<20060720095553.GA10920@1wt.eu>
In-Reply-To
<44BF507A.4080801@dawes.za.net>
On Thu, Jul 20, 2006 at 11:44:26AM +0200, Rogan Dawes wrote:
Show 12 quoted lines
> Willy Tarreau wrote:
> >+int git_tar_config(const char *var, const char *value)
> >+{
> >+	if (!strcmp(var, "tar.umask")) {
> >+		if (!strcmp(value, "user")) {
> >+			tar_umask = umask(0);
> >+			umask(tar_umask);
> >+		} else {
> >+			tar_umask = git_config_int(var, value);
> 
> Looks like you forgot:
>    			umask(tar_umask);

not at all : we don't want to change the process's umask, but set the mask that will be used to position file modes in the output archive.

The reason for umask(tar_umask) above is because you cannot read the process umask without changing it, so you have to do it twice with a dummy value first.

Show 9 quoted lines
> >+		}
> >+		return 0;
> >+	}
> >+	return git_default_config(var, value);
> >+}
> 
> Or else move it to just before the "return 0;" line.
> 
> Rogan

Regards, Willy

Previous: Rogan DawesNext: Johannes Schindelin
Message 6 of 9 in “tar-tree: add the "tar.applyUmask" config option”
  1. tar-tree: add the "tar.applyUmask" config optionWilly Tarreau, Jul 19, 2006
  2. Junio C HamanoJul 19, 2006
  3. Willy TarreauJul 19, 2006
  4. Willy TarreauJul 20, 2006
  5. Rogan DawesJul 20, 2006
  6. Willy TarreauJul 20, 2006
  7. Johannes SchindelinJul 19, 2006
  8. Rene ScharfeJul 20, 2006
  9. Junio C HamanoJul 24, 2006

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.