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

Re: safe directory on shared drives

From
Philip Oakley <philipoakley@iee.email>
Date
Apr 15, 2022, 11:43 UTC
Message-ID
<3a02bf6c-54c1-39c8-5f3e-9f246c9e87b8@iee.email>
In-Reply-To
<CAO=QCg5+M-=dOf=AFTDL8z9-LrK-7vau+=JV-7QJfVOhdFp1Aw@mail.gmail.com>
Hi Andrew,
On 15/04/2022 11:14, Andrew Noblet wrote:
Show 25 quoted lines
> The new git security rules creates an issue on Windows systems where
> the git repository is hosted in a shared folder.
>
> $ git status
>
> ```
> fatal: unsafe repository ('//192.168.0.120/config/' is owned by someone else)
> To add an exception for this directory, call:
>
>         git config --global --add safe.directory //192.168.0.120/config/
> ```
>
> $ git config --global --add safe.directory //192.168.0.120/config/
> $ git status
>
> ```
> warning: encountered old-style '//192.168.0.120/config/' that should
> be '%(prefix)//192.168.0.120/config/'
> fatal: unsafe repository ('//192.168.0.120/config/' is owned by someone else)
> To add an exception for this directory, call:
>
>         git config --global --add safe.directory //192.168.0.120/config/
> ```
>
> There seems to be no way to add a shared drive path to the safe directory list.

This (instruction clarification) is being discussed / sorted at [git-for-windows/git] Include trailing slash in prefix migration instructions (PR #3790) https://github.com/git-for-windows/git/pull/3790

The key point being that for a `//server` path you will need three slashes. (IIUC) One for magic prefix string, and then two as part of the server name.

There is now also the `*` option that permits all as safe directories.  Worth checking how the user and group security is being handled locally, especially for accidental failures. Philip

Previous: Andrew NobletNext: Philip Oakley
Message 2 of 3 in “safe directory on shared drives”
  1. Andrew NobletApr 15, 2022
  2. Philip OakleyApr 15, 2022
  3. Philip OakleyApr 15, 2022

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.