From: deraadt Date: Mon, 16 May 2022 00:27:46 +0000 (+0000) Subject: use a safer idiom for reading pid from file before killing X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=03152f1b6a457d09ebe52a8ebbce26b612f76a49;p=openbsd use a safer idiom for reading pid from file before killing pointed out by kn, tested in snaps for a week --- diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 33c9e6d540f..dd910db361c 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1198 2022/05/09 22:43:57 deraadt Exp $ +# $OpenBSD: install.sub,v 1.1199 2022/05/16 00:27:46 deraadt Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -543,7 +543,7 @@ unlock() { # Add a trap to kill the dmesg listener co-process on exit of the installer. retrap() { - trap 'if [ -f /tmp/cppid ]; then kill -KILL -$(cat /tmp/cppid) 2>/dev/null; rm -f /tmp/cppid; fi; echo; stty echo; exit 0' \ + trap '_cppid=$(/dev/null; rm -f /tmp/cppid; fi; echo; stty echo; exit 0' \ INT EXIT TERM }