summaryrefslogtreecommitdiffhomepage
path: root/tests/tools/git@git.abendless.com:
diff options
context:
space:
mode:
authorSean Kurtz <seankurtz75@gmail.com>2026-11-23 11:09:45 -0600
committerSean Kurtz <seankurtz75@gmail.com>2026-11-23 11:09:45 -0600
commit92fb4b12ac631ce5c794e5b5b29f204f34ab9e59 (patch)
tree6531b042d64fa90390aa820c16e453b3fe6df566 /tests/tools/git@git.abendless.com:
parentd1ea4c7f4530e3d1d4689a9d20029a0c1a418df5 (diff)
downloadzash-92fb4b12ac631ce5c794e5b5b29f204f34ab9e59.tar.gz
z/OS: keep a close-on-exec pipe out of the child's fd map
sys_pipe() duplicates the shell's pipe ends above SYS_NFD and marks them FD_CLOEXEC, so that other children do not inherit them. spawn()'s fd_map hands the child the parent's descriptor as it is, without clearing the flag the way dup2() would, so a mapping onto the child's 0..2 carried FD_CLOEXEC into the child. The child could still write, but the next exec inside it lost stdout: ps printed FSUM6004 write error on standard output: EDC5113I Bad file descriptor and a #!/bin/sh shim lost the pipe it was given. Pass a plain duplicate, which fcntl F_DUPFD makes above SYS_NFD without the flag, for every map entry that names a different descriptor, and close the duplicates once spawn() has made the child. Entries that map a descriptor onto itself are untouched. tests/zos/fdmap.sh records the case: a pipe the shell made, read by a child that execs. Reported in #1.
Diffstat (limited to 'tests/tools/git@git.abendless.com:')
0 files changed, 0 insertions, 0 deletions