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

Re: [PATCH] Be more careful with objects directory permissions on clone

From
MHMark Hills <mark@pogo.org.uk>
Date
May 5, 2008, 10:25 UTC
Message-ID
<alpine.BSO.1.10.0805051121090.32248@zrgural.vwaro.pbz>
In-Reply-To
<481EDC4B.2010105@viscovery.net>
On Mon, 5 May 2008, Johannes Sixt wrote:
Show 26 quoted lines
> 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?

Mark
Previous: Johannes SixtNext: Johannes Sixt
Message 5 of 10 in “Be more careful with objects directory permissions on clone”
  1. Be more careful with objects directory permissions on cloneMark Hills, May 4, 2008
  2. Johannes SixtMay 5, 2008
  3. Mark HillsMay 5, 2008
  4. Johannes SixtMay 5, 2008
  5. Mark HillsMay 5, 2008
  6. Johannes SixtMay 5, 2008
  7. Mark HillsMay 5, 2008
  8. Junio C HamanoMay 6, 2008
  9. Jakub NarebskiMay 6, 2008
  10. Johannes SixtMay 6, 2008

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.