Skip to content

Support non-elevated admin user check on Windows - #7200

Closed
tyrielv wants to merge 1 commit into
libgit2:mainfrom
tyrielv:tyrielv/admin-non-elevated
Closed

tyrielv wants to merge 1 commit into
libgit2:mainfrom
tyrielv:tyrielv/admin-non-elevated

Conversation

@tyrielv

@tyrielv tyrielv commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Currently, if a repository is owned by the Administrators group, libgit2 only considers the current user to be the owner if the process is running with elevated privileges. This change allows non-elevated processes run by users who are members of the Administrators group to also be considered the owner of such repositories.

This is related to #6279. As noted there, libgit2 strives to be bug-for-bug compatible with git -
for the corresponding change in git see
git/git@03a4e46

I did not make test changes because the existing tests for this scenario mock the token state above the level of these changes - actually running this code with linked administrator tokens isn't feasible without major changes to the test infrastructure.

Currently, if a repository is owned by the Administrators group, libgit2
only considers the current user to be the owner if the process is
running with elevated privileges. This change allows non-elevated
processes run by users who are members of the Administrators group to
also be considered the owner of such repositories.

For the corresponding fix in git.exe see
git/git@03a4e46
tyrielv added a commit to microsoft/VFSForGit that referenced this pull request May 26, 2026
Add patch from libgit2/libgit2#7200 to vcpkg overlay. Allows
non-elevated processes run by Administrators group members to be
considered the owner of repositories owned by that group.

Assisted-by: Claude Opus 4.6
Signed-off-by: Tyrie Vella <[email protected]>
@ethomson

ethomson commented Jun 7, 2026

Copy link
Copy Markdown
Member

Thanks! Manually merged

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.

3 participants