Date: Tue, 22 Feb 2000 22:14:58 -0800 (PST) From: spock@techfour.net To: freebsd-gnats-submit@FreeBSD.org Subject: bin/16927: [PATCH] prevent possible race condition in lorder.sh Message-ID: <200002230614.WAA63075@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 16927
>Category: bin
>Synopsis: [PATCH] prevent possible race condition in lorder.sh
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Feb 22 22:20:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Mike Heffner
>Release: 4.0-current
>Organization:
>Environment:
FreeBSD 4.0-CURRENT #0: Sat Feb 19 20:05:45 EST 2000
>Description:
lorder.sh should use harder to predict tempfiles instead of:
/tmp/_reference_{pid}
/tmp/_symbol_{pid}
>How-To-Repeat:
run lorder
>Fix:
apply patch and recompile.
Index: usr.bin/lorder/lorder.sh
===================================================================
RCS file: /home/ncvs/src/usr.bin/lorder/lorder.sh,v
retrieving revision 1.2
diff -u -r1.2 lorder.sh
--- lorder.sh 1998/08/15 07:10:21 1.2
+++ lorder.sh 2000/01/29 20:13:45
@@ -45,8 +45,8 @@
esac
# temporary files
-R=/tmp/_reference_$$
-S=/tmp/_symbol_$$
+R=`mktemp /tmp/_reference_XXXXXXXXXX`
+S=`mktemp /tmp/_symbol_XXXXXXXXXX`
# remove temporary files on HUP, INT, QUIT, PIPE, TERM
trap "rm -f $R $S; exit 1" 1 2 3 13 15
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002230614.WAA63075>
