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

Re: [PATCH] repack.c: chmod +w before rename()

From
Mike Hommey <mh@glandium.org>
Date
Jan 24, 2014, 23:50 UTC
Message-ID
<20140124235048.GA30427@glandium.org>
In-Reply-To
<20140124224911.GC58260@vauxhall.crustytoothpaste.net>
On Fri, Jan 24, 2014 at 10:49:13PM +0000, brian m. carlson wrote:
Show 12 quoted lines
> On Fri, Jan 24, 2014 at 11:24:36PM +0100, Johannes Schindelin wrote:
> > > In general, I'm wary of changing permissions on a file to suit Windows's
> > > rename because of the symlink issue and the security issues that can
> > > result.
> > 
> > I agree on the Windows issue.
> 
> I personally feel that if Windows needs help to change permissions for a
> rename, that code should only ever be used on Windows.  Doesn't
> mingw_rename automatically do this anyway, and if it doesn't, shouldn't
> we put the code there instead?  Furthermore, it makes me very nervous to
> make the file 666.  Isn't 644 enough?

Arguably, umask is supposed to take care of making things right. OTOH, since it's the destination file that's the problem not the renamed file, the equivalent to mv -f would be to unlink() that file first, not to change its permissions. That would work properly on unix too.

Mike
Previous: brian m. carlsonNext: Junio C Hamano
Message 5 of 7 in “repack.c: chmod +w before rename()”
  1. repack.c: chmod +w before rename()Torsten Bögershausen, Jan 24, 2014
  2. brian m. carlsonJan 24, 2014
  3. Johannes SchindelinJan 24, 2014
  4. brian m. carlsonJan 24, 2014
  5. Mike HommeyJan 24, 2014
  6. Junio C HamanoJan 24, 2014
  7. Junio C HamanoJan 24, 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.