Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
d588de7c
Unverified
Commit
d588de7c
authored
Aug 02, 2019
by
Patrick Steinhardt
Committed by
GitHub
Aug 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5191 from eaigner/master
config: check if we are running in a sandboxed environment
parents
ac171542
952fbbfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
src/sysdir.c
+11
-1
No files found.
src/sysdir.c
View file @
d588de7c
...
...
@@ -82,15 +82,25 @@ static int git_sysdir_guess_global_dirs(git_buf *out)
#else
int
error
;
uid_t
uid
,
euid
;
const
char
*
sandbox_id
;
uid
=
getuid
();
euid
=
geteuid
();
/**
* If APP_SANDBOX_CONTAINER_ID is set, we are running in a
* sandboxed environment on macOS.
*/
sandbox_id
=
getenv
(
"APP_SANDBOX_CONTAINER_ID"
);
/*
* In case we are running setuid, use the configuration
* of the effective user.
*
* If we are running in a sandboxed environment on macOS,
* we have to get the HOME dir from the password entry file.
*/
if
(
uid
==
euid
)
if
(
!
sandbox_id
&&
uid
==
euid
)
error
=
git__getenv
(
out
,
"HOME"
);
else
error
=
get_passwd_home
(
out
,
euid
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment