From a97df478a4d36e605c008f8a987c1e43820fd802 Mon Sep 17 00:00:00 2001 From: Jaakko Heinonen Date: Tue, 30 Mar 2010 15:25:16 +0000 Subject: MFC r205121: Use an unique directory name instead of hardcoded /tmp/.diskless. A malicious user could create a file named /tmp/.diskless and cause the script to misbehave. PR: conf/141258 --- etc/rc.d/tmp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/rc.d/tmp b/etc/rc.d/tmp index 9750b6e2d06b..296eb45819b2 100644 --- a/etc/rc.d/tmp +++ b/etc/rc.d/tmp @@ -49,8 +49,8 @@ case "${tmpmfs}" in [Nn][Oo]) ;; *) - if /bin/mkdir -p /tmp/.diskless 2> /dev/null; then - rmdir /tmp/.diskless + if _tmpdir=$(mktemp -d -q /tmp/.diskless.XXXXXX); then + rmdir ${_tmpdir} else if [ -h /tmp ]; then echo "*** /tmp is a symlink to a non-writable area!" -- cgit v1.3