Date: Tue, 23 Mar 2010 16:45:29 +0000 (UTC) From: Jaakko Heinonen <jh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r205518 - stable/8/etc/rc.d Message-ID: <201003231645.o2NGjTQI028773@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jh Date: Tue Mar 23 16:45:29 2010 New Revision: 205518 URL: http://svn.freebsd.org/changeset/base/205518 Log: 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 Modified: stable/8/etc/rc.d/tmp Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/tmp ============================================================================== --- stable/8/etc/rc.d/tmp Tue Mar 23 15:14:45 2010 (r205517) +++ stable/8/etc/rc.d/tmp Tue Mar 23 16:45:29 2010 (r205518) @@ -51,8 +51,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!"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003231645.o2NGjTQI028773>