[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS
From: |
KO Myung-Hun |
Subject: |
Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2 |
Date: |
Sun, 15 Oct 2023 16:43:01 +0900 |
User-agent: |
Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.6esrpre) Gecko/20120715 Firefox/10.0.6esrpre SeaMonkey/2.7.2 |
Hi/2.
Zack Weinberg wrote:
> On Sat, Oct 14, 2023, at 9:19 AM, KO Myung-Hun wrote:
>> OS/2 does not allow chmod() on an opened file.
>>
>> * bin/autom4te.in (handle_output): Ignore setting mode failure on OS/2.
>
> Not OK, for two reasons: (1) IIRC this is used to create scripts with the
> execute bit set in at least one place. Ignoring the chmod failure will
> cause confusing errors downstream of where the problem actually was. (2)
> Having a temporary file that's potentially writable by other user ids,
> even briefly, risks a variety of security problems.
>
> Also, for maintainability's sake, no checks of $^O anywhere in autoconf's
> Perl code unless there is absolutely no alternative.
>
How about this ?
1. create and close a temporary file
2. chmod() on it
3. re-open it with O_TRUNC ?
--
KO Myung-Hun
Korean OS/2 User Community : https://www.os2.kr/
[PATCH 1/2] Fix detection of GNU M4 on mksh, KO Myung-Hun, 2023/10/14