mingw: special-case administrators even more#1893
mingw: special-case administrators even more#1893dscho wants to merge 2 commits intogitgitgadget:masterfrom
Conversation
The check for dubious ownership has one particular quirk on Windows: if running as an administrator, files owned by the Administrators _group_ are considered owned by the user. The rationale for that is: When running in elevated mode, Git creates files that aren't owned by the individual user but by the Administrators group. There is yet another quirk, though: The check I introduced to determine whether the current user is an administrator uses the `CheckTokenMembership()` function with the current process token. And that check only succeeds when running in elevated mode! Let's be a bit more lenient here and look harder whether the current user is an administrator. We do this by looking for a so-called "linked token". That token exists when administrators run in non-elevated mode, and can be used to create a new process in elevated mode. And feeding _that_ token to the `CheckTokenMembership()` function succeeds! Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This adds a new sub-sub-command for `test-tool`, simply passing through the command-line arguments to the `is_path_owned_by_current_user()` function. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
/submit |
|
Submitted as pull.1893.git.1742899110.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
|
This patch series was integrated into seen via git@5a79ced. |
|
This branch is now known as |
|
This patch series was integrated into seen via git@c2a7c69. |
|
This patch series was integrated into next via git@dfcb966. |
|
This patch series was integrated into seen via git@23d2b41. |
|
There was a status update in the "Cooking" section about the branch "Dubious ownership" checks on Windows has been tightened up. Will merge to 'master'. source: <pull.1893.git.1742899110.gitgitgadget@gmail.com> |
|
This patch series was integrated into seen via git@45e31f0. |
|
This patch series was integrated into master via git@45e31f0. |
|
This patch series was integrated into next via git@45e31f0. |
|
Closed via 45e31f0. |
…demailer-7.0.3 build(deps): bump nodemailer from 7.0.2 to 7.0.3
On Windows, a file created by a process running in elevated mode is owned by the Administrators group (not by the user's account who would otherwise be able to modify or delete the file in non-elevated mode). Let's adjust the "safe directory" feature accordingly.
Naturally, this patch series does not add a regression test (because it can't, you cannot automate elevating processes).
This patch series is a companion of microsoft#712.