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

Re: [PATCH v2] config: preserve config file permissions on edits

From
Jeff King <peff@peff.net>
Date
May 6, 2014, 22:02 UTC
Message-ID
<20140506220236.GB30185@sigill.intra.peff.net>
In-Reply-To
<20140506001714.GA29049@dcvr.yhbt.net>
On Tue, May 06, 2014 at 12:17:14AM +0000, Eric Wong wrote:
> Users may already store sensitive data such as imap.pass in
> .git/config; making the file world-readable when "git config"
> is called to edit means their password would be compromised
> on a shared system.
Makes sense, and the patch looks good to me.
Show 5 quoted lines
> +test_expect_success POSIXPERM,PERL 'preserves existing permissions' '
> +	chmod 0600 .git/config &&
> +	git config imap.pass Hunter2 &&
> +	perl -e \
> +	  "die q(badset) if ((stat(q(.git/config)))[2] & 07777) != 0600" &&

I don't think we usually bother with a PERL prereq for running one-liners like this from the test script, though I don't think it hurts anything to do so.

-Peff
Previous: Eric WongNext: Johannes Sixt
Message 3 of 9 in “config: preserve config file permissions on edits”
  1. config: preserve config file permissions on editsEric Wong, May 5, 2014
  2. config: preserve config file permissions on editsEric Wong, May 6, 2014
  3. Jeff KingMay 6, 2014
  4. Johannes SixtMay 19, 2014
  5. Erik Faye-LundMay 19, 2014
  6. Erik Faye-LundMay 19, 2014
  7. Thomas BraunMay 19, 2014
  8. Erik Faye-LundMay 19, 2014
  9. Marius Storm-OlsenMay 19, 2014

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.