Re[2]: [PATCH] fetch: allow running as different users in shared repositories

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

 



On Thu, 26 Mar 2020 15:40:47 +0100 (CET) Johannes Schindelin <Johannes.Schindelin@xxxxxx> wrote:

JS> On Thu, 26 Mar 2020, Vadim Zeitlin wrote:
JS> 
JS> > On Wed, 25 Mar 2020 20:04:09 +0100 Johannes Schindelin wrote:
JS> >
JS> > JS> Hi Vadim,
JS> >
JS> >  Hello Johannes and thanks for your reply!
JS> >
JS> > JS> On Thu, 19 Mar 2020, Vadim Zeitlin wrote:
JS> > JS>
JS> > JS> > The function fopen_for_writing(), which was added in 79d7582e32 (commit:
JS> > JS> > allow editing the commit message even in shared repos, 2016-01-06) and
JS> > JS> > used for overwriting FETCH_HEAD since ea56518dfe (Handle more file
JS> > JS> > writes correctly in shared repos, 2016-01-11), didn't do it correctly in
JS> > JS> > shared repositories under Linux.
JS> > JS> >
JS> > JS> > This happened because in this situation the file FETCH_HEAD has mode 644
JS> > JS>
JS> > JS> I wonder why that is. In a shared repository, it should have mode 664, I
JS> > JS> thought.
JS> >
JS> >  This file is created using a simple fopen("w") and so is subject to umask.
JS> > With the usual default umask value (022) its mode would be 644, regardless
JS> > of the repository settings.
JS> 
JS> Maybe we should change that to an `open()` call with the explicit `0666`
JS> mode?

 Hello again,

 Sorry if I'm missing something, but AFAICS this wouldn't change anything,
open() mode argument is still combined with the (negated) umask, and 0666 &
!022 would still give 0644. The only ways to give this file the mode
of 664 that I know about are to either temporarily reset the "group" byte
of umask to 0 or to explicitly call [f]chmod() after creating it. I don't
know if this is really worthwhile to do...

JS> My take is that this was waiting for a review, and I provided it (*not*
JS> asking for any changes), and if there are no further reviews, the patch
JS> should make it into the `pu` branch, then `next` and eventually `master`,
JS> at which point it will be slated for the next official `.0` version.

 OK, thanks (both for the review and for the explanations)!

JS> It might make sense to ask for it to be trickled down into the `maint`
JS> branch, too, in case a `v2.26.1` is released. I would be in favor of that,
JS> but would not do the asking myself ;-)

 This is not really urgent to me, so I don't think I want to bother people
with backporting it to `maint` neither, even if I definitely wouldn't have
any objections to this. I'd just like this to work in some future version
of Git without the workaround we have to use right now (which basically
consists in running chmod manually) in the bright future when we upgrade to
it.

 Thanks again,
VZ

Attachment: pgpzkEKI71lRy.pgp
Description: PGP signature


[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]

  Powered by Linux