summaryrefslogtreecommitdiffstats
path: root/ssh-pkcs11-client.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-05-19 03:24:05 +0200
committerDamien Miller <djm@mindrot.org>2021-05-19 03:52:14 +0200
commit7be4ac813662f68e89f23c50de058a49aa32f7e4 (patch)
tree7040d1e4601e2a0545e20614e96d8d818eccbf35 /ssh-pkcs11-client.c
parentupstream: fix breakage of -W forwaring introduced in 1.554; reported by (diff)
downloadopenssh-7be4ac813662f68e89f23c50de058a49aa32f7e4.tar.xz
openssh-7be4ac813662f68e89f23c50de058a49aa32f7e4.zip
upstream: restore blocking status on stdio fds before close
ssh(1) needs to set file descriptors to non-blocking mode to operate but it was not restoring the original state on exit. This could cause problems with fds shared with other programs via the shell, e.g. > $ cat > test.sh << _EOF > #!/bin/sh > { > ssh -Fnone -oLogLevel=verbose ::1 hostname > cat /usr/share/dict/words > } | sleep 10 > _EOF > $ ./test.sh > Authenticated to ::1 ([::1]:22). > Transferred: sent 2352, received 2928 bytes, in 0.1 seconds > Bytes per second: sent 44338.9, received 55197.4 > cat: stdout: Resource temporarily unavailable This restores the blocking status for fds 0,1,2 (stdio) before ssh(1) abandons/closes them. This was reported as bz3280 and GHPR246; ok dtucker@ OpenBSD-Commit-ID: 8cc67346f05aa85a598bddf2383fcfcc3aae61ce
Diffstat (limited to 'ssh-pkcs11-client.c')
0 files changed, 0 insertions, 0 deletions