Re: [PATCH 1/2] index-pack: Create .keep files with same permissions and .pack/.idx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 02 April 2011, Junio C Hamano wrote:
> Johan Herland <johan@xxxxxxxxxxx> writes:
> > While pushing to a remote repo, Git transiently adds a .keep file for
> > the pack being pushed, to protect it from a concurrent "git gc".
> > Sometimes, when the push fails or is aborted, the .keep file is left
> > stale in the repo. This causes problems for other users of the same
> > repo, since the permissions on the .keep file (0600) make it
> > inaccessible even though the rest of the repo is accessible (0444
> > modulo shared_repository setting).
> 
> I was also wondering why you initialized with 0444 in your patch and then
> even adjusted for shared repository settings.

I was simply emulating what is currently done for idx and pack files (see 
below).

> This is a tangent, but wouldn't it be wrong for index-pack to always
> leave the idx and pack files in 0444 with an explicit chmod() in the
> first place?  I suspect that we simply forgot to fix it when we
> introduced adjust_shared_perm().

Yeah, probablby, but AFAICS in the receive-pack case, final_pack_name and 
final_index_name are both NULL (neither are specified on the index-pack 
command line passed from receive-pack), so the explicit chmod(..., 0444) is 
never called. Instead the pack and idx files are both opened from 
odb_mkstemp() (via open_pack_file() and write_idx_file(), respectively), 
which uses mode 0444. We then call move_temp_to_file(), which calls 
adjust_shared_perm().


...Johan

-- 
Johan Herland, <johan@xxxxxxxxxxx>
www.herland.net
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]