On 07/11/2025 12:22, Bruno Haible wrote:
I wrote:
$ ./configure gl_cv_func_posix_spawnp_secure_exec=no --quiet
I reproduce it. Smaller reproducer:
$ cd src
$ mkdir subdir
$ ./ginstall -s -c -m 555 dd subdir
It crashes if and only if $PATH is long enough:
I can force the crash using the attached testcase.sh, that sets
a PATH of size ca. 4 KB, on
- Linux/SPARC
- Linux/ppc64, Linux/ppc64le
- Solaris 10 and 11 / SPARC
I'm committing this fix, which fixes the problem on all these platforms.
Excellent.
The code looks good to me.
I'll add the following to our test script:
+# Ensure there are no issues with posix_spawnp() and large $PATHs
+# which we saw when initially changing from execvp() to posix_spawnp().
+PATH=$(printf '%4001s' '' | sed 's/\(.\{79\}\)./\1:/g'):$PATH \
+ ginstall $strip -c -m 555 $dd $dir || fail=1
thanks for fixing this!
Padraig