diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-23 11:09:45 -0600 |
|---|---|---|
| committer | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-23 11:09:45 -0600 |
| commit | 92fb4b12ac631ce5c794e5b5b29f204f34ab9e59 (patch) | |
| tree | 6531b042d64fa90390aa820c16e453b3fe6df566 /web/assets/git@git.abendless.com:/srv/git | |
| parent | d1ea4c7f4530e3d1d4689a9d20029a0c1a418df5 (diff) | |
| download | zash-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 'web/assets/git@git.abendless.com:/srv/git')
0 files changed, 0 insertions, 0 deletions
