conf/141258: /etc/rc.d/tmp may act incorrectly based on unprivleged local user actions

Jaakko Heinonen jh at FreeBSD.org
Fri Mar 5 06:20:04 UTC 2010


The following reply was made to PR conf/141258; it has been noted by GNATS.

From: Jaakko Heinonen <jh at FreeBSD.org>
To: bug-followup at FreeBSD.org, jon at passki.us
Cc:  
Subject: Re: conf/141258: /etc/rc.d/tmp may act incorrectly based on
 unprivleged local user actions
Date: Fri, 5 Mar 2010 08:15:40 +0200

 Here is a proposed minimal fix for the problem. mktemp(1) should be
 available because the script requires mountcritremote. (Can someone
 confirm this?)
 
 %%%
 Index: etc/rc.d/tmp
 ===================================================================
 --- etc/rc.d/tmp	(revision 204194)
 +++ etc/rc.d/tmp	(working copy)
 @@ -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!"
 %%%


More information about the freebsd-rc mailing list