summaryrefslogtreecommitdiffstats
path: root/usr.sbin/spkrtest
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-08-14 06:26:58 +0000
committerphk <phk@FreeBSD.org>1998-08-14 06:26:58 +0000
commitc737fc04c08a9303e2ca3ef3d0f504a08734e04e (patch)
tree319af45b21fc8ed25cea644246d50c4a493fca56 /usr.sbin/spkrtest
parente24de2520e824bf39d15058aa1f0bbd237c79892 (diff)
downloadFreeBSD-src-c737fc04c08a9303e2ca3ef3d0f504a08734e04e.zip
FreeBSD-src-c737fc04c08a9303e2ca3ef3d0f504a08734e04e.tar.gz
/usr/sbin/spkrtest and /usr/sbin/vidfont (aka kbdmap) use very
predictable /tmp files (static prefix + process number) which are overwritten blindly, and follow links. These workarounds change it from a process number to a very random (9999 with tons of decimal places) number. PR: 7565 Submitted by: Thomas Stromberg <tstrombe@rtci.com>
Diffstat (limited to 'usr.sbin/spkrtest')
-rw-r--r--usr.sbin/spkrtest/spkrtest.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/spkrtest/spkrtest.pl b/usr.sbin/spkrtest/spkrtest.pl
index fa00caa..0af081a 100644
--- a/usr.sbin/spkrtest/spkrtest.pl
+++ b/usr.sbin/spkrtest/spkrtest.pl
@@ -32,7 +32,7 @@
#
# NOTE for iso-* (latin1) fonts: use TERM=cons25-iso8859-1
#
-# $Id$
+# $Id: spkrtest.pl,v 1.5 1997/02/22 16:13:37 peter Exp $
$title = qq{
reveille -- Reveille
@@ -93,7 +93,8 @@ foreach (sort keys %title) {
push(@checklist, ($_, $title{$_}, 'OFF'));
}
-$tmp = ($ENV{'TMP'} || "/tmp") . "/_spkrtest$$";
+srand;
+$tmp = ($ENV{'TMP'} || "/tmp") . "/_spkrtest" . rand(9999);
if (!open(SPEAKER, "> $speaker")) {
warn "You have no write access to $speaker or the speaker device is not " .
OpenPOWER on IntegriCloud