diff options
author | Damien Miller <djm@mindrot.org> | 2020-05-14 12:22:09 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-05-14 12:24:24 +1000 |
commit | 3ab6fccc3935e9b778ff52f9c8d40f215d58e01d (patch) | |
tree | 826ffb5725865c2d948d77b5ac948f9951ed3673 | |
parent | f700d316c6b15a9cfbe87230d2dca81a5d916279 (diff) |
prefer ln to cp for temporary copy of sshd
I saw failures on the reexec fallback test on Darwin 19.4 where
fork()ed children of a process that had it's executable removed
would instantly fail. Using ln to preserve the inode avoids this.
-rw-r--r-- | regress/reexec.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/regress/reexec.sh b/regress/reexec.sh index 2192456cd..8966ba524 100644 --- a/regress/reexec.sh +++ b/regress/reexec.sh | |||
@@ -9,7 +9,10 @@ SSHD_COPY=$OBJ/sshd | |||
9 | # Start a sshd and then delete it | 9 | # Start a sshd and then delete it |
10 | start_sshd_copy () | 10 | start_sshd_copy () |
11 | { | 11 | { |
12 | cp $SSHD_ORIG $SSHD_COPY | 12 | # NB. prefer ln to cp here. On some OSX 19.4 configurations, |
13 | # djm has seen failure after fork() when the executable image | ||
14 | # has been removed from the filesystem. | ||
15 | ln $SSHD_ORIG $SSHD_COPY || cp $SSHD_ORIG $SSHD_COPY | ||
13 | SSHD=$SSHD_COPY | 16 | SSHD=$SSHD_COPY |
14 | start_sshd | 17 | start_sshd |
15 | SSHD=$SSHD_ORIG | 18 | SSHD=$SSHD_ORIG |