[openssh-commits] [openssh] 01/01: prefer ln to cp for temporary copy of sshd

git+noreply at mindrot.org git+noreply at mindrot.org
Thu May 14 12:24:35 AEST 2020


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 3ab6fccc3935e9b778ff52f9c8d40f215d58e01d
Author: Damien Miller <djm at mindrot.org>
Date:   Thu May 14 12:22:09 2020 +1000

    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.
---
 regress/reexec.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/regress/reexec.sh b/regress/reexec.sh
index 2192456c..8966ba52 100644
--- a/regress/reexec.sh
+++ b/regress/reexec.sh
@@ -9,7 +9,10 @@ SSHD_COPY=$OBJ/sshd
 # Start a sshd and then delete it
 start_sshd_copy ()
 {
-	cp $SSHD_ORIG $SSHD_COPY
+	# NB. prefer ln to cp here. On some OSX 19.4 configurations,
+	# djm has seen failure after fork() when the executable image
+	# has been removed from the filesystem.
+	ln $SSHD_ORIG $SSHD_COPY || cp $SSHD_ORIG $SSHD_COPY
 	SSHD=$SSHD_COPY
 	start_sshd
 	SSHD=$SSHD_ORIG

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list