Re: [PATCH v3 2/3] git-compat-util: avoid failing dir ownership checks if running privileged
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 5, 2022, 16:09 UTC
- Message-ID
- <xmqqilqkezav.fsf@gitster.g>
- In-Reply-To
- <nycvar.QRO.7.76.6.2205051545370.355@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
> We could side-step all of this, of course, if we simply did this:
>
> euid = getuid();
> if (euid == ROOT_UID)
> euid = git_env_ulong("SUDO_UID", euid);Yes, that is not "side-stepping" at all. It is "we already have a function that knows how to use strto*l() correctly" ;-)
Very good suggestion. Thanks.