Re: [RFC PATCH] git-compat-util: avoid failing dir ownership checks if running priviledged
- From
Derrick Stolee <derrickstolee@github.com>
- Date
- Apr 29, 2022, 16:16 UTC
- Message-ID
- <484187d6-5bbd-c238-a922-95411e80322e@github.com>
- In-Reply-To
- <9658dea7-d421-b238-113d-c7b83eca4569@github.com>
On 4/26/2022 3:48 PM, Derrick Stolee wrote:
> On 4/26/2022 2:31 PM, Carlo Marcelo Arenas Belón wrote:
Show 13 quoted lines
>> + const char *real_uid = getenv("SUDO_UID");
>> + if (real_uid && *real_uid)
>> + euid = atoi(real_uid);
>> + else {
>> + real_uid = getenv("DOAS_UID");
>> + if (real_uid && *real_uid)
>> + euid = atoi(real_uid);
>> + }
>
> I imagine that something else could be added here to help Windows
> users who have elevated to administrator privileges. It will use a
> completely different mechanism, though, if needed at all. We can
> delay that for now.Just chiming in to say that the way we do this check on Windows, there is no difference between a user and the same user with elevated privileges (the "Security Identifier (SID)" is the same in both cases).
Thanks, -Stolee