Re: [PATCH] setup: avoid unconditional open with write flags
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 6, 2022, 00:40 UTC
- Message-ID
- <xmqq359tpdoy.fsf@gitster.g>
- In-Reply-To
- <Y46NaUjc+eqzSExR@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 7 quoted lines
> But it's still no better than the patch here in the happy case, since we > still have to perform three fcntl() checks to figure out that all three > descriptors are initialized as-expected (versus just one open() and > close()). > > So I think your version is a slight improvement on Christian's, but I > would just as soon stick with what we have.
I am OK as long as there is a workaround available to Christian's use case without changing "git" at all. If Christian can tighten the environment into somewhat unnatural "opening writable FD is a failure" way, I suspect such a jail can be augmented to further to allow opening /dev/null and other "selected" files writable, so I wouldn't worry too much if we dropped this patch entirely.
Thanks.