git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Preserve the protection mode for the Git config files
Date: Mon, 27 Jul 2009 19:18:53 +0100	[thread overview]
Message-ID: <1248718733.12375.65.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <7vab2wlh4y.fsf@alter.siamese.dyndns.org>

Hi Junio,

On Wed, 2009-07-22 at 11:14 -0700, Junio C Hamano wrote:
> Catalin Marinas <catalin.marinas@arm.com> writes:
> > Every time an option is set, the config file protection mode is changed
> > to 0666 & ~umask even if it was different before. This patch is useful
> > if people store passwords (SMTP server in the StGit case) and do not
> > want others to read the .gitconfig file.
[...]
> Your log message talks about .git/config and nothing else, but I think
> this codepath affects everything that is created under the lock, such as
> the index and refs.

I haven't checked all the places where this function is called. For my
use-case, I store the SMTP password in the .git/config file (or
~/.gitconfig) and every time I update this file (with git or via stgit),
the permission gets changed.

> The patch description must defend itself a bit better, perhaps by saying
> something like this at the end.
> 
> 	This patch touches the codepath that affects not just .git/config
> 	but other files like the index and the loose refs, so they also
> 	inherit the original protection bits.  In a private repository,
> 	this is not an issue exactly because the repository is private,
> 
> 	In a shared repository, a later call made in this function to
> 	adjust_shared_perm() widens the permission bits as configured.
> 	Because adjust_shared_perm() is designed to do so from any mode
> 	limited by user's umask, even though this patch changes the
> 	behaviour in the strict sense, it should not affect the outcome in
> 	a negative way and what is explicitly marked as allowed in the
> 	configuration will still be allowed.

Thanks for the explanation. Would you like me to repost with your
description?

Thanks.

-- 
Catalin

      parent reply	other threads:[~2009-07-27 18:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 15:24 [PATCH] Preserve the protection mode for the Git config files Catalin Marinas
2009-07-22 18:14 ` Junio C Hamano
2009-07-22 22:08   ` Nanako Shiraishi
2009-07-22 22:37     ` Johannes Schindelin
2009-07-27 18:18   ` Catalin Marinas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1248718733.12375.65.camel@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).