diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2022-07-04 16:03:10 -0400 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2022-07-07 10:38:01 -0400 |
| commit | 56aaaf532d9364cea146037023b64c2ee5e0bcb6 (patch) | |
| tree | 5e5c51830bf04567d9fc527165000a3ed12200c6 /src/libgit2 | |
| parent | 5bc01a7ddbb765616b52d4504036fbbb0e483e8e (diff) | |
| download | libgit2-56aaaf532d9364cea146037023b64c2ee5e0bcb6.tar.gz | |
repo: allow admin owned configs by admin users
Allow users in the administrator group to use git configs that are owned
by administrators.
Diffstat (limited to 'src/libgit2')
| -rw-r--r-- | src/libgit2/repository.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libgit2/repository.c b/src/libgit2/repository.c index 48a0b70f5..09e81cded 100644 --- a/src/libgit2/repository.c +++ b/src/libgit2/repository.c @@ -509,10 +509,13 @@ static int validate_ownership(const char *repo_path) { git_config *config = NULL; validate_ownership_data data = { repo_path, GIT_STR_INIT, false }; + git_fs_path_owner_t owner_level = + GIT_FS_PATH_OWNER_CURRENT_USER | + GIT_FS_PATH_USER_IS_ADMINISTRATOR; 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(&is_safe, repo_path, owner_level)) < 0) { if (error == GIT_ENOTFOUND) error = 0; |
