Re: [PATCH] commit: ensure correct permissions of the commit message
- From
Jeff King <peff@peff.net>
- Date
- Dec 20, 2015, 07:45 UTC
- Message-ID
- <20151220074559.GF30662@sigill.intra.peff.net>
- In-Reply-To
- <4aa11f02f4de113bf38152b8815658da42690f43.1450549280.git.johannes.schindelin@gmx.de>
On Sat, Dec 19, 2015 at 07:21:59PM +0100, Johannes Schindelin wrote:
Show 6 quoted lines
> It was pointed out by Yaroslav Halchenko that the file containing the > commit message had the wrong permissions in a shared setting. > > Let's fix that. > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
I think this is probably a step forward, but I have to wonder how many other files are in a similar situation (e.g., git-am state files, etc). I think people generally haven't noticed because shared repositories are generally about a shared bare rendezvous repo. So refs and objects are important, but we don't expect people to commit.
So I don't have any real problem with this, but I suspect it's just the tip of the iceberg. We might want something like:
FILE *fopen_shared(const char *path, const char *mode)
{
FILE *ret = fopen(path, mode);
if (!ret)
return NULL;
if (adjust_shared_perm(path)) {
fclose(ret);
return NULL;
}
return ret;
}but of course the hard part is auditing all of the existing fopen() calls to see who needs to use it. :)
-Peff