Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-18 Thread Zack Weinberg
On Wed, Oct 18, 2023, at 10:21 AM, KO Myung-Hun wrote: > Zack Weinberg wrote: >> I don’t want to have code in Autoconf that is only safe because of >> non-obvious details of the context it’s used in. People might >> reuse the code in a different context where it’s *not* safe, without >> realizing

Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-18 Thread Zack Weinberg
On Tue, Oct 17, 2023, at 2:58 PM, Paul Eggert wrote: > On 10/17/23 11:16, Zack Weinberg wrote: ... >> you have to be exquisitely careful, or a malicious concurrent process >> might be able to trick you into overwriting some file elsewhere on >> the filesystem. ... > ? If /tmp is sticky, a malicious

Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-18 Thread KO Myung-Hun
Hi/2. Zack Weinberg wrote: > On Sun, Oct 15, 2023, at 3:43 AM, KO Myung-Hun wrote: >> Zack Weinberg wrote: >>> On Sat, Oct 14, 2023, at 9:19 AM, KO Myung-Hun wrote: * bin/autom4te.in (handle_output): Ignore setting mode failure on OS/2. >>> >>> Not OK, for two reasons: > ... >> How about this

Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-17 Thread Paul Eggert
On 10/17/23 11:16, Zack Weinberg wrote: On Sun, Oct 15, 2023, at 3:43 AM, KO Myung-Hun wrote: How about this ? 1. create and close a temporary file 2. chmod() on it 3. re-open it with O_TRUNC ? The trouble is, on a multi-user system, any time you do any operation by name on a file whose full p

Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-17 Thread Zack Weinberg
On Sun, Oct 15, 2023, at 3:43 AM, KO Myung-Hun wrote: > Zack Weinberg wrote: >> On Sat, Oct 14, 2023, at 9:19 AM, KO Myung-Hun wrote: >>> * bin/autom4te.in (handle_output): Ignore setting mode failure on OS/2. >> >> Not OK, for two reasons: ... > How about this ? > 1. create and close a temporary f

Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-17 Thread Zack Weinberg
On Sat, Oct 14, 2023, at 1:27 PM, Russ Allbery wrote: > The standard Perl command corelist -a tells you the versions of > that module that shipped with each version of Perl. The first version of > Perl that included a version of File::Temp later than 0.2310 was Perl > 5.33.3 (which included 0.231

Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-15 Thread KO Myung-Hun
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 > execut

Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-14 Thread Russ Allbery
"Zack Weinberg" writes: > Really what we need here is for File::Temp to allow us to supply the > third argument to the open() system call. That feature was added in > version 0.2310 of the File::Temp module. Does anyone have time right > now to do the archaeology on what version of File::Temp s

Re: [PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-14 Thread Zack Weinberg
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. Ignor

[PATCH 2/2] Ignore failure of setting mode on a temporary file on OS/2

2023-10-14 Thread KO Myung-Hun
OS/2 does not allow chmod() on an opened file. * bin/autom4te.in (handle_output): Ignore setting mode failure on OS/2. --- bin/autom4te.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/autom4te.in b/bin/autom4te.in index 71d7e6a6..ac5fe18b 100644 --- a/bin/autom4te.in