git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Mark Hills <mark@pogo.org.uk>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Be more careful with objects directory permissions on clone
Date: Mon, 05 May 2008 12:42:00 +0200	[thread overview]
Message-ID: <481EE478.9000704@viscovery.net> (raw)
In-Reply-To: <alpine.BSO.1.10.0805051121090.32248@zrgural.vwaro.pbz>

Mark Hills schrieb:
> On Mon, 5 May 2008, Johannes Sixt wrote:
> 
>> Mark Hills schrieb:
>>> On Mon, 5 May 2008, Johannes Sixt wrote:
>>>
>>>> Mark Hills schrieb:
>>>>>          cd "$repo" &&
>>>>> -        find objects -depth -print | cpio $cpio_quiet_flag -pumd$l
>>>>> "$GIT_DIR/" || \
>>>>> +        # Create dirs using umask and permissions and destination
>>>>> +        find objects -type d -print | (cd "$GIT_DIR" && xargs mkdir
>>>>> -p) &&
>>>>> +        # Copy 0444 permissions on files
>>>>> +        find objects -type f -print | cpio $cpio_quiet_flag -pumd$l
>>>>> "$GIT_DIR/" || \
>>>>
>>>> Wouldn't that be better:
>>>>
>>>>     find objects ! -type d -print | cpio ...
>>>>
>>>> ?
>>>
>>> This was my first suggestion, unfortunately it shows up broken behaviour
>>> in all but the latest version of cpio. It creates 0700 directory
>>> permissions which is even worse.
>>
>> Sorry, I should have mentioned that I meant to keep the 'find | xargs
>> mkdir' and replace only the second 'find | cpio'.
> 
> Ah, I see.
> 
> I tend to think that an inclusive match has less scope for future bad
> behaviour than an exclusive match. Have I missed the possiblity that
> there may be content in the objects directory which is not a directory
> or file?

Theoretically, you could have symbolic links to loose objects or packs.

Generally, you shouldn't change the behavior of a program more than necessary.

-- Hannes

  reply	other threads:[~2008-05-05 10:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-04 11:37 [PATCH] Be more careful with objects directory permissions on clone Mark Hills
2008-05-05  9:01 ` Johannes Sixt
2008-05-05  9:56   ` Mark Hills
2008-05-05 10:07     ` Johannes Sixt
2008-05-05 10:25       ` Mark Hills
2008-05-05 10:42         ` Johannes Sixt [this message]
2008-05-05 16:46           ` Mark Hills
2008-05-06  6:53             ` Junio C Hamano
2008-05-06  7:25             ` Jakub Narebski
2008-05-06  8:08               ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=481EE478.9000704@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=mark@pogo.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).