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
f98dd543
Unverified
Commit
f98dd543
authored
Jun 13, 2022
by
Edward Thomson
Committed by
GitHub
Jun 13, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6321 from libgit2/ethomson/ownership
repo: allow administrator to own the configuration
parents
05f21154
cdff2f02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/libgit2/repository.c
+1
-1
tests/libgit2/repo/open.c
+3
-2
No files found.
src/libgit2/repository.c
View file @
f98dd543
...
...
@@ -512,7 +512,7 @@ static int validate_ownership(const char *repo_path)
bool
is_safe
;
int
error
;
if
((
error
=
git_fs_path_owner_is_current_user
(
&
is_safe
,
repo_path
))
<
0
)
{
if
((
error
=
git_fs_path_owner_is_
system_or_
current_user
(
&
is_safe
,
repo_path
))
<
0
)
{
if
(
error
==
GIT_ENOTFOUND
)
error
=
0
;
...
...
tests/libgit2/repo/open.c
View file @
f98dd543
...
...
@@ -484,9 +484,10 @@ void test_repo_open__validates_dir_ownership(void)
cl_git_pass
(
git_repository_open
(
&
repo
,
"empty_standard_repo"
));
git_repository_free
(
repo
);
/* When the system user owns the repo config,
fail
*/
/* When the system user owns the repo config,
also acceptable
*/
git_fs_path__set_owner
(
GIT_FS_PATH_MOCK_OWNER_SYSTEM
);
cl_git_fail
(
git_repository_open
(
&
repo
,
"empty_standard_repo"
));
cl_git_pass
(
git_repository_open
(
&
repo
,
"empty_standard_repo"
));
git_repository_free
(
repo
);
/* When an unknown user owns the repo config, fail */
git_fs_path__set_owner
(
GIT_FS_PATH_MOCK_OWNER_OTHER
);
...
...
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