Upgrading to 2.37.3 seems to have broken the way I connect to a remote computer over the internet via a vpn.

654 views
Skip to first unread message

Keith Scarfe

unread,
Sep 2, 2022, 6:22:16 AM9/2/22
to git-for-windows
Seems to be to do with 'dubious ownership'.
I get 'fatal: detected dubious ownership in repository'

I have tried this:
git config --global --add safe.directory '*'

from this link:

but this doesn't seem to do anything.

Any help please. I am a very basic user of GIT, no way a guru.

Johannes Schindelin

unread,
Sep 2, 2022, 8:49:32 AM9/2/22
to Keith Scarfe, git-for-windows
Hi Keith,

answer inline:

On Fri, 2 Sep 2022, Keith Scarfe wrote:

> Seems to be to do with 'dubious ownership'.
> I get 'fatal: detected dubious ownership in repository'
>
> I have tried this:
> git config --global --add safe.directory '*'

In which terminal? Git Bash? Or CMD? If the latter, I understand, because
CMD does not treat the single quotes as quotes, but as part of the
string that is then written verbatim to your config.

If you run `git config -e --global`, you should see something like this:

[safe]
directory = *

but I suspect that you are seeing something like this instead, which is
not what you want:

[safe]
directory = '*'

Ciao,
Johannes

>
> from this link:
> https://stackoverflow.com/questions/72978485/git-submodule-update-failed-with-fatal-detected-dubious-ownership-in-repositor
>
> but this doesn't seem to do anything.
>
> Any help please. I am a very basic user of GIT, no way a guru.
>
> --
> You received this message because you are subscribed to the Google Groups "git-for-windows" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to git-for-windo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/git-for-windows/12dbe6ed-4dd6-40ba-b641-fec0fe33f7a1n%40googlegroups.com.
>

Keith Scarfe

unread,
Sep 2, 2022, 9:15:30 AM9/2/22
to git-for-windows
Thanks Johannes.
Yes I did read this, about not using the quotes and I have tried both.
When I look at the config as you suggest I do seem to have the correct syntax i.e. :
[safe]
    directory = *

But I still have the problem with 'fatal: detected dubious ownership in repository'

Connecting to this remote machine using my colleagues laptop (which still has 2.35 installed) does not have this issue so my problem has occurred in doing this upgrade.
How can I fix it or can I downgrade back to 2.35?

Do I need to add this 
[safe]
    directory = *
to the config file under .git on the remote machine? This file that opens using the --e control is on our origin server. There is also one on my local laptop. I struggle to understand which file is for doing what.

Thank you for any help,

Johannes Schindelin

unread,
Sep 5, 2022, 3:43:45 AM9/5/22
to Keith Scarfe, git-for-windows
Hi Keith,

On Fri, 2 Sep 2022, Keith Scarfe wrote:

> When I look at the config as you suggest I do seem to have the correct
> syntax i.e. :
> [safe]
> directory = *

Good.

> But I still have the problem with 'fatal: detected dubious ownership in
> repository'

I cannot reproduce this with v2.37.3, though.

> Connecting to this remote machine using my colleagues laptop (which still
> has 2.35 installed) does not have this issue so my problem has occurred in
> doing this upgrade.
> How can I fix it or can I downgrade back to 2.35?
>
> Do I need to add this
> [safe]
> directory = *
> to the config file under .git on the remote machine?

No, as per
https://git-scm.com/docs/git-config#Documentation/git-config.txt-safedirectory
the `safe.directory` setting is not respected when configured in the
repository config.

You will need to put this into your "global" (or more correctly:
user-wide) config, e.g. via `git config -e --global`.

Ciao,
Johannes

Keith Scarfe

unread,
Sep 5, 2022, 6:52:48 AM9/5/22
to git-for-windows
Hmmm. So I have the safe folder in the global config but I still cannot connect to my remote computer.
Am I correct in thinking the reason for this must be because I connect to the remote computer (via a windows mapped network drive) using the local Administrator account on that machine but on my local computer (which is running GIT) I have a company domain user account. Is this why it doesn't work an more? The problem does seem to be about ownership.
I have downgraded back to V2.35 and it now connects correctly as it used to and I can carry on working. Not sure how long I can stay at v2.35 but hopefully for a few years.
Shame this version 2.37 has broken the way I work.
Thanks again.

Johannes Schindelin

unread,
Sep 6, 2022, 9:21:14 AM9/6/22
to Keith Scarfe, git-for-windows
Hi Keith,

It is possible that you're running Git under two accounts, in which case
you need to make sure that both have the `safe.directory=*` setting
configured. You can all `git config --show-scope --get-all safe.directory`
to find out.

It is possible that downgrading to v2.35.x hides a problem because the
original CVE fix was not complete and had to be tightened.

Ciao,
Johannes
> --
> You received this message because you are subscribed to the Google Groups "git-for-windows" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to git-for-windo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/git-for-windows/8974a494-a519-40c4-90fc-cf61fbac32e3n%40googlegroups.com.
>
Reply all
Reply to author
Forward
0 new messages