Re: sh(1) exec redirection

2024-11-06 Thread Mouse
> Maybe you remember in the 6th end and before days [...] I don't. My experience with anything Unixy started with BSD 4.1c, and that only barely before 4.2 came out. > This change was made to the NetBSD sh in Jan 2016. It is being > complained about almost 9 years later. That speaks to large

Re: sh(1) exec redirection

2024-11-06 Thread Robert Elz
Date:Wed, 6 Nov 2024 08:03:37 -0500 (EST) From:Mouse Message-ID: <202411061303.iaa03...@stone.rodents-montreal.org> | But breaking existing use cases strikes me as a Very Bad Idea. What existing use cases? Passing random fds to unrelated (as in not part of a set o

Re: sh(1) exec redirection

2024-11-06 Thread Mouse
> Yes, that is exactly the issue, we want > exec 3>whatever > to set close-on-exec (by default) as typically fds created that way > are just for the script to use, and shouldn't be passed through to > children. We do? Perhaps if this were just being designed now. But breaking existing us

Re: sh(1) exec redirection

2024-11-06 Thread Edgar Fuß
I can understand that NetBSD's sh derives (unless set -o posix is given) from SUS in cases where SUS documents brain-dead historical behaviour. However, passing fd's opened by exec to commands called later on doesn't appear obviously brain-dead to me. Wouldn't it be more appropriate to have a c

Re: sh(1) exec redirection

2024-11-05 Thread Robert Elz
Date:Tue, 5 Nov 2024 17:55:38 +0100 From:Edgar =?iso-8859-1?B?RnXf?= Message-ID: | 1.40 tried to fix it, but probably | not for the command being exec'ed being exec. Yes, that is exactly the issue, we want exec 3>whatever to set close-on-exec (by defa

Re: sh(1) exec redirection

2024-11-05 Thread Robert Elz
Date:Tue, 5 Nov 2024 17:55:38 +0100 From:Edgar =?iso-8859-1?B?RnXf?= Message-ID: | After digging for hours why something like | FOO_PASS_FD=3 exec /usr/pkg/bin/foo 3

Re: sh(1) exec redirection

2024-11-05 Thread Mouse
> After digging for hours why something like > FOO_PASS_FD=3 exec /usr/pkg/bin/foo 3 worked on -6, but not on -8, I found out that [...] I ran into something similar some time ago on, apparently, 8.0. I found - I forget where - a workaround. To quote from the script: # Misfeature in 8.0's

sh(1) exec redirection

2024-11-05 Thread Edgar Fuß
After digging for hours why something like FOO_PASS_FD=3 exec /usr/pkg/bin/foo 3