Skip to content

config: check if we are running in a sandboxed environment#5191

Merged
pks-t merged 1 commit intolibgit2:masterfrom
eaigner:master
Aug 2, 2019
Merged

config: check if we are running in a sandboxed environment#5191
pks-t merged 1 commit intolibgit2:masterfrom
eaigner:master

Conversation

@eaigner
Copy link
Copy Markdown

@eaigner eaigner commented Jul 28, 2019

On macOS the $HOME environment variable returns the path to the sandbox
container instead of the actual user $HOME for sandboxed apps.
To get the correct path, we have to get it from the password file entry.

Closes #5190

Copy link
Copy Markdown
Member

@pks-t pks-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks sensible to me, thanks a lot!

A test would be lovely, but I assume it's not really feasible except for faking a sandbox environment via manually setting the envvar. I don't think this to be important, though, the code is trivial enough.

Will merge as soon as getenv was replaced by p_getenv.

On macOS the $HOME environment variable returns the path to the sandbox container instead of the actual user $HOME for sandboxed apps. To get the correct path, we have to get it from the password file entry.
@pks-t pks-t merged commit d588de7 into libgit2:master Aug 2, 2019
@pks-t
Copy link
Copy Markdown
Member

pks-t commented Aug 2, 2019

Thank you, @eaigner!

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.

config: fetching global config does not work in a sandboxed environment

5 participants