{"thread":{"id":"57737","subject":"safe directory on shared drives","startedAt":"2022-04-15T10:14:47Z","lastAt":"2022-04-15T12:02:20Z","messageCount":3,"participants":["Andrew Noblet","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"453687","messageId":"CAO=QCg5+M-=dOf=AFTDL8z9-LrK-7vau+=JV-7QJfVOhdFp1Aw@mail.gmail.com","threadId":"57737","inReplyTo":null,"subject":"safe directory on shared drives","fromName":"Andrew Noblet","fromEmail":"andrewbnoblet@gmail.com","sentAt":"2022-04-15T10:14:25Z","receivedAt":"2022-04-15T10:14:47Z","isPatch":false,"sender":{"key":"andrewbnoblet@gmail.com","avatar":null},"body":"The new git security rules creates an issue on Windows systems where\nthe git repository is hosted in a shared folder.\n\n$ git status\n\n```\nfatal: unsafe repository ('//192.168.0.120/config/' is owned by someone else)\nTo add an exception for this directory, call:\n\n        git config --global --add safe.directory //192.168.0.120/config/\n```\n\n$ git config --global --add safe.directory //192.168.0.120/config/\n$ git status\n\n```\nwarning: encountered old-style '//192.168.0.120/config/' that should\nbe '%(prefix)//192.168.0.120/config/'\nfatal: unsafe repository ('//192.168.0.120/config/' is owned by someone else)\nTo add an exception for this directory, call:\n\n        git config --global --add safe.directory //192.168.0.120/config/\n```\n\nThere seems to be no way to add a shared drive path to the safe directory list.\n"},{"id":"453692","messageId":"3a02bf6c-54c1-39c8-5f3e-9f246c9e87b8@iee.email","threadId":"57737","inReplyTo":"CAO=QCg5+M-=dOf=AFTDL8z9-LrK-7vau+=JV-7QJfVOhdFp1Aw@mail.gmail.com","subject":"Re: safe directory on shared drives","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2022-04-15T11:43:26Z","receivedAt":"2022-04-15T11:43:33Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Andrew,\n\nOn 15/04/2022 11:14, Andrew Noblet wrote:\n> The new git security rules creates an issue on Windows systems where\n> the git repository is hosted in a shared folder.\n>\n> $ git status\n>\n> ```\n> fatal: unsafe repository ('//192.168.0.120/config/' is owned by someone else)\n> To add an exception for this directory, call:\n>\n>         git config --global --add safe.directory //192.168.0.120/config/\n> ```\n>\n> $ git config --global --add safe.directory //192.168.0.120/config/\n> $ git status\n>\n> ```\n> warning: encountered old-style '//192.168.0.120/config/' that should\n> be '%(prefix)//192.168.0.120/config/'\n> fatal: unsafe repository ('//192.168.0.120/config/' is owned by someone else)\n> To add an exception for this directory, call:\n>\n>         git config --global --add safe.directory //192.168.0.120/config/\n> ```\n>\n> There seems to be no way to add a shared drive path to the safe directory list.\n\nThis (instruction clarification) is being discussed / sorted at\n[git-for-windows/git] Include trailing slash in prefix migration\ninstructions (PR #3790)\nhttps://github.com/git-for-windows/git/pull/3790\n\nThe key point being that for a `//server` path you will need three\nslashes. (IIUC) One for magic prefix string, and then two as part of the\nserver name.\n\nThere is now also the `*` option that permits all as safe directories. \nWorth checking how the user and group security is being handled locally,\nespecially for accidental failures.\nPhilip\n\n\n"},{"id":"453693","messageId":"488bf3f0-7859-7b7c-b46d-48248aacca62@iee.email","threadId":"57737","inReplyTo":"CAO=QCg6+J-dA2U9F5dseKbb=HA_pLFmZ9tbHydnLRSk5Dg2UXg@mail.gmail.com","subject":"Re: safe directory on shared drives","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2022-04-15T12:02:14Z","receivedAt":"2022-04-15T12:02:20Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Glad it worked!\ncopying in the list in case others can be helped by the confirmation.\nP.\n\nOn 15/04/2022 12:55, Andrew Noblet wrote:\n> Thank you! Adding `git config --global --add safe.directory\n> '%(prefix)///192.168.0.120/config/'` <http://192.168.0.120/config/'`>\n> worked!\n>\n> Andrew\n>\n> On Fri, Apr 15, 2022 at 7:43 AM Philip Oakley <philipoakley@iee.email>\n> wrote:\n>\n>     Hi Andrew,\n>\n>     On 15/04/2022 11:14, Andrew Noblet wrote:\n>     > The new git security rules creates an issue on Windows systems where\n>     > the git repository is hosted in a shared folder.\n>     >\n>     > $ git status\n>     >\n>     > ```\n>     > fatal: unsafe repository ('//192.168.0.120/config/\n>     <http://192.168.0.120/config/>' is owned by someone else)\n>     > To add an exception for this directory, call:\n>     >\n>     >         git config --global --add safe.directory\n>     //192.168.0.120/config/ <http://192.168.0.120/config/>\n>     > ```\n>     >\n>     > $ git config --global --add safe.directory\n>     //192.168.0.120/config/ <http://192.168.0.120/config/>\n>     > $ git status\n>     >\n>     > ```\n>     > warning: encountered old-style '//192.168.0.120/config/\n>     <http://192.168.0.120/config/>' that should\n>     > be '%(prefix)//192.168.0.120/config/ <http://192.168.0.120/config/>'\n>     > fatal: unsafe repository ('//192.168.0.120/config/\n>     <http://192.168.0.120/config/>' is owned by someone else)\n>     > To add an exception for this directory, call:\n>     >\n>     >         git config --global --add safe.directory\n>     //192.168.0.120/config/ <http://192.168.0.120/config/>\n>     > ```\n>     >\n>     > There seems to be no way to add a shared drive path to the safe\n>     directory list.\n>\n>     This (instruction clarification) is being discussed / sorted at\n>     [git-for-windows/git] Include trailing slash in prefix migration\n>     instructions (PR #3790)\n>     https://github.com/git-for-windows/git/pull/3790\n>\n>     The key point being that for a `//server` path you will need three\n>     slashes. (IIUC) One for magic prefix string, and then two as part\n>     of the\n>     server name.\n>\n>     There is now also the `*` option that permits all as safe\n>     directories. \n>     Worth checking how the user and group security is being handled\n>     locally,\n>     especially for accidental failures.\n>     Philip\n>\n>\n\n"}]}