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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 20, 2006 at 11:44:26AM +0200, Rogan Dawes wrote:
> 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.

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

Regards,
Willy

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]