Re: [PATCH v2] read-cache: write all indexes with the same permissions

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

 



On Fri, Nov 16, 2018 at 6:31 PM Christian Couder
<christian.couder@xxxxxxxxx> wrote:
> diff --git a/read-cache.c b/read-cache.c
> index 8c924506dd..ea80600bff 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -3165,7 +3165,8 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
>                 struct tempfile *temp;
>                 int saved_errno;
>
> -               temp = mks_tempfile(git_path("sharedindex_XXXXXX"));
> +               /* Same permissions as the main .git/index file */

If the permission is already correct from the beginning (of this temp
file), should df801f3f9f be reverted since we don't need to adjust
permission anymore?

Or does $GIT_DIR/index go through the same adjust_shared_perm() anyway
in the end, which means df801f3f9f must stay? If so, perhaps clarify
that in the commit message.

> +               temp = mks_tempfile_sm(git_path("sharedindex_XXXXXX"), 0, 0666);
>                 if (!temp) {
>                         oidclr(&si->base_oid);
>                         ret = do_write_locked_index(istate, lock, flags);
-- 
Duy



[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