Skip to content

strip drive letter from %HOMEPATH% #103

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

Merged
merged 1 commit into from
May 23, 2017

Conversation

mgkuhn
Copy link

@mgkuhn mgkuhn commented Mar 31, 2017

Many programs access the user's home directory as %HOMEDRIVE%%HOMEPATH%.

Without removing the drive letter from %HOMEPATH%, the result of this
concatenation is something like "C:C:\Users\mgkuhn" and results
in applications not finding the home directory.

After this change, OpenSSH will set %HOMEPATH% without a drive letter,
like Windows does, as documented at

https://support.microsoft.com/en-us/help/101507/how-windows-nt-determines-a-user-s-home-directory

I also added a safety check to test that pw_dir_w is not empty.

Many programs access the user's home directory as %HOMEDRIVE%%HOMEPATH%.

Without removing the drive letter from %HOMEPATH%, the result of this
concatenation is something like "C:C:\Users\mgkuhn" and results
in applications not finding the home directory.

After this change, OpenSSH will set %HOMEPATH% without a drive letter,
like Windows does, as documented at

  https://support.microsoft.com/en-us/help/101507/how-windows-nt-determines-a-user-s-home-directory

I also added a safety check to test that pw_dir_w is not empty.
@joeyaiello joeyaiello closed this May 12, 2017
@joeyaiello joeyaiello reopened this May 12, 2017
@msftclas
Copy link

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@manojampalam manojampalam merged commit a4250af into PowerShell:latestw_all May 23, 2017
@mgkuhn mgkuhn deleted the homepath branch December 15, 2017 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants