Subject: Re: No fchmod() under msygit - Was: Re: [PATCH 00/14] Add submodule test harness

From: Karsten Blees <[email-masked]>
Date: Mon, 14 Jul 2014 21:30:40 +0200

Am 09.07.2014 22:00, schrieb Eric Wong:
> Torsten Bögershausen <[email-masked]> wrote:
>> (And why is it  "& 07777" and not  "& 0777")
> 
> This is to preserve the uncommon sticky/sgid/suid bits.  Probably not
> needed, but better to keep as much intact as possible.
> 
>> Can we avoid the fchmod()  all together ?
> 
> For single-user systems, sure.
> 
> For multi-user systems with git-imap-send users and passwords in
> $GIT_CONFIG, I suggest not.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to [email-masked]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

The Windows fchmod() problem is easily solved by using chmod() instead of
fchmod(). The file name is known in both cases (and even used in the error
message).

However, IMO there are more fundamental problems with your patch (not
related to Windows):

1.) Permissions of files in .git are controlled by the core.sharedRepository
setting, and your patch seems to break that (i.e. if someone accidentally
has made .git/config world readable, git-config no longer fixes that, even
if core.sharedRepository=0600).

2.) Sensitive data such as passwords doesn't belong in config files in the
first place, that's what git-credentials is good for.