-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-bash.exe saves/loads config from wrong home-directory (When using 'run as') #2709
Comments
Could you try setting it in the User environment in your Windows' System Properties instead? |
There is no way to set it for all users via system envoirement, so that is no option for me. |
So you want all users to run Git Bash as administrator? That's... interesting.
Right, unless you use |
No, I want that each user runs its git-bash with his own home-directory. But now it is that "User_a" has the desired home, but all other users have |
Well, now I am really curious what sets your environment this way:
Because that is not correct. |
No, for this user nothing special is defined in |
Most likely. Is there anything in the environment that indicates that it was launched via |
For what it's worth, I can reproduce the environment variable discrepancy when starting
When running as a different user (a non-domain account in this case) I get:
Unfortunately I do not see any environment variables which would indicate that it was run in this manner. |
I checked the env in both constelations, here is are the differences
So I thing you could check if the But maybe the best way to avoid all this stuff ist when you yust try to set HOME="$(cygpath -u "$USERPROFILE")" And only use |
There are definitely other values than |
Runas is also an executable. It has a /profile and /noprofile argument. You
may want to check which version is executed in this case or what the
default is. My assumption is that these two options are responsible/affect
the seen behaviour.
…On Thu, Jun 25, 2020, 10:13 AM Matthias Aßhauer ***@***.***> wrote:
C:\Windows\system32>echo %SESSIONNAME%
RDP-Tcp#99
There are definitely other values than Console that should get the
default treament.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2709 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZH5SBA3SRN5QB645ZEZJTRYNLPLANCNFSM4OENODPQ>
.
|
What @rimrul was posting is a value that is defined when you logon via remote-desktop. in my eyes it would be the best to Check in git-bash code if |
As I see in mingw.c (the same code exists in mingw.c on git-for-windows too) the USERPROFILE variable is already checked in the code. if ((tmp = getenv("HOMEDRIVE"))) |
git-wrapper.c would also need to be modified if we decide to change this. |
I believe SESSIONNAME is a red herring:
SESSIONNAME: Terminal servers only - for a terminal server session,
SessionName is a combination of the connection name, followed by #S
*essionNumber*. For a console session, SessionName returns "Console"
…On Thu, Jun 25, 2020 at 1:18 PM Radon8472 ***@***.***> wrote:
Runas is also an executable. It has a /profile and /noprofile argument.
You may want to check which version is executed in this case or what the
default is. My assumption is that these two options are responsible/affect
the seen behaviour.
… <#m_-907698444408155253_>
On Thu, Jun 25, 2020, 10:13 AM Matthias Aßhauer *@*.***> wrote:
C:\Windows\system32>echo %SESSIONNAME% RDP-Tcp#99 There are definitely
other values than Console that should get the default treament. — You are
receiving this because you are subscribed to this thread. Reply to this
email directly, view it on GitHub <#2709 (comment)
<#2709 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABZH5SBA3SRN5QB645ZEZJTRYNLPLANCNFSM4OENODPQ
.
What @rimrul <https://github.com/rimrul> was posting is a value that is
defined when you logon via remote-desktop.
But in my case it was that runas (when using rightclick on explorer) doesnt
have a env variable defined for SESSIONNAME`.
in my eyes it would be the best to Check in git-bash code if USERPROFILE
is defined, before using HOMEDRIVE or HOMEPATH to build a home-path
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2709 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZH5SCZZ64FCUB77DHTDALRYOBIDANCNFSM4OENODPQ>
.
|
I aggree.
That maybe means the Code should
|
Hi,
That would be wrong too.
A roaming profile with home drive and homepath is not only used with RDP.
It's the corporates implementation/decision (e.g. via group policies)
whether that's being used or not. If it is, it may be used with local and
remote sessions.
Best regards,Mike
…On Fri, Jun 26, 2020, 2:04 AM Radon8472 ***@***.***> wrote:
I believe SESSIONNAME is a red herring: SESSIONNAME: Terminal servers only
- for a terminal server session, SessionName is a combination of the
connection name, followed by #S *essionNumber*. For a console session,
SessionName returns "Console"
I aggree.
Because the code of git-wrapper.c say in a comment:
With roaming profiles: HOMEPATH is the roaming location and
USERPROFILE is the local location
That maybe means the Code should
- Check is env ``SESSIONNAME` starts with "RDP-Tcp",
- if yes, they should use the existing code, where HOME is build
from HOMEDRIVE or HOMEPATH
- if NO, we have either a run as sitiation, or a local "console"
session, and in that case USERPROFILE should be used
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2709 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZH5SF6CHCXR2QVVKXBX73RYQ3ALANCNFSM4OENODPQ>
.
|
I found some helpfull informations about HOMEPATH and HOMEDRIVE variables in a Stackoverflow article about meaning-variables-homedrive-homepath. They are set by explorer, that is the reason why they are not changed for all kinds of seconday logins. of services. |
So the real question is: can we fix this at all? |
I did some local tests (No RDP).
Any use of runas /user:localhost\user cmd.exe resets HOMEDRIVE and HOMEPATH
to the below in the new session:
HOMEDRIVE=C:
HOMEPATH=\WINDOWS\system32
The effect is the same, if the user running runas is admin or not, elevated
or not and whether the target user is admin or not doesn't matter.
It's always set to C:\WINDOWS\system32
The use of /noprofile or /profile makes no difference.
Note, that runas.exe explicitly resets the variables, i changed the
variable as a test and the change is not taken over into the child process.
There is just one exception: Simple elevation in case the running user is
already a non-elevated admin and starts a new elevated prompt via explorer.
BTW. Win10 explorer does not offer me an option to run something as a
dedicated user. It has only "Run as Administrator".
I have to hold shift while right-clicking on an executable (not shortcut)
to see "Run as different user". And even here it resets the variables to
C:\WINDOWS\system32.
My hunch is, this behavior is intentional. I just don't know why
(security?).
…On Fri, Jun 26, 2020 at 6:02 PM Radon8472 ***@***.***> wrote:
I found some helpfull information on about HOMEPATH and HOMEDRIVE
variables in a Stackoverflow article about
meaning-variables-homedrive-homepath
<https://stackoverflow.com/a/36392591/2377961>.
It explains why you can not realy trust on this variables.
They are set by explorer, that is the reason why they are not changed for
all kinds of seconday logins. of services.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2709 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZH5SAKZXO46HFA44K36V3RYULIBANCNFSM4OENODPQ>
.
|
https://github.com/git/git/blob/e870325ee8575d5c3d7afe0ba2c9be072c692b65/compat/mingw.c#L2572-L2594 needs to be fixed -- to either use This looks like new behavior since at least Win7. In WinXP, |
@mfriedrich74 good analysis! @native-api I already ruled out the unconditional ignoring of |
Could you elaborate/link to why? I seriously think that Besides, that code doesn't work with those envvars right anyway: it should also check |
I think the post of @mfriedrich74 is the answer... I think we only have to check it like this if( $HOMEPATH =="\\WINDOWS\\system32" && $USERNAME != "System32") {
// We have a run-as situation -> Build $HOME from $USERPRFILE
} else {
// keep existing code and fill $HOME from $HOMEPATH and $HOMEDRIVE
} |
The use of HOMEDRIVE/HOMEPATH is not a niche. It is pretty common in larger
companies to define these in active directory to map to a network location
(the users home drive).
I find it very convenient that this way I have a working git setup on all
computers that I logon to. No setup if I have to move to a new main
computer (i admid, not happening that often).
The config files are backed up too on the network location.
…On Sat, Jun 27, 2020, 3:48 PM Radon8472 ***@***.***> wrote:
I think the post of @mfriedrich74 <https://github.com/mfriedrich74> is
the answer...
We where looking for a indicator to find out if we are in such a run as
sitiation.
I think we only have to check it like this
if( $HOMEPATH =="\\WINDOWS\\system32" && $USERNAME != "System32") {
// We have a run-as situation -> Build $HOME from $USERPRFILE
} else {
// keep existing code and fill $HOME from $HOMEPATH and $HOMEDRIVE
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2709 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZH5SGZGDDT4YAE2S2FKN3RYZEKTANCNFSM4OENODPQ>
.
|
My tests were a local non-domain environment. Next week I could run the
same at work in our domain and with RDP. Unless someonelse has those
covered already.
On Sat, Jun 27, 2020, 7:44 PM Mike Friedrich <[email protected]>
wrote:
… The use of HOMEDRIVE/HOMEPATH is not a niche. It is pretty common in
larger companies to define these in active directory to map to a network
location (the users home drive).
I find it very convenient that this way I have a working git setup on all
computers that I logon to. No setup if I have to move to a new main
computer (i admid, not happening that often).
The config files are backed up too on the network location.
On Sat, Jun 27, 2020, 3:48 PM Radon8472 ***@***.***> wrote:
> I think the post of @mfriedrich74 <https://github.com/mfriedrich74> is
> the answer...
> We where looking for a indicator to find out if we are in such a run as
> sitiation.
>
> I think we only have to check it like this
>
> if( $HOMEPATH =="\\WINDOWS\\system32" && $USERNAME != "System32") {
> // We have a run-as situation -> Build $HOME from $USERPRFILE
> } else {
> // keep existing code and fill $HOME from $HOMEPATH and $HOMEDRIVE
> }
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2709 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABZH5SGZGDDT4YAE2S2FKN3RYZEKTANCNFSM4OENODPQ>
> .
>
|
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
…ctory Internally, Git expects the environment variable `HOME` to be set, and to point to the current user's home directory. This environment variable is not set by default on Windows, and therefore Git tries its best to construct one if it finds `HOME` unset. There are actually two different approaches Git tries: first, it looks at `HOMEDRIVE`/`HOMEPATH` because this is widely used in corporate environments with roaming profiles, and a user generally wants their global Git settings to be in a roaming profile. Only when `HOMEDRIVE`/`HOMEPATH` is either unset or does not point to a valid location, Git will fall back to using `USERPROFILE` instead. However, starting with Windows Vista, for secondary logons and services, the environment variables `HOMEDRIVE`/`HOMEPATH` point to Windows' system directory (usually `C:\Windows\system32`). That is undesirable, and that location is usually write-protected anyway. So let's verify that the `HOMEDRIVE`/`HOMEPATH` combo does not point to Windows' system directory before using it, falling back to `USERPROFILE` if it does. This fixes git-for-windows#2709 Initial-Path-by: Ivan Pozdeev <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
Setup
defaults?
to the issue you're seeing?
In the administrative users, everything is fine, in the "non-admin" causes problems.
Details
git-bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
What did you expect to occur after running these commands?
HOME=/c/Users/MY_USER
.gitconfig
should be loaded from "c:\Users\MY_USER"What actually happened instead?
c:\windows\system32
what is not writeable as non-admin./c/Windows/system32
.gitconfig
was loaded (is assume because it was looking inc:\windows\system32
for a.gitconfig
which doesn`t existIf the problem was occurring with a specific repository, can you provide the
URL to that repository to help us with testing?
More Details:
my relevant env variables in the console BEFORE Starting git bash are
In the git-bash
env
shows:So all variables are correct, only HOME and HOMEPATH are wrong
GIT_INSTALL_DIR\etc\profile
toHOME="$(cygpath -u "$USERPROFILE")"
Like suggested in https://stackoverflow.com/a/32233667/2377961HOME
- Variable, but git-bash still loads and saves config from the wrong directory.gitconfig
was loaded from "c:\Users\MY_USER" like expectedc:\windows\system32
The text was updated successfully, but these errors were encountered: