From: Jaakko Heinonen <j...@FreeBSD.org>
To: bug-fo...@FreeBSD.org, j...@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!"
%%%
From: Jon Passki <j...@passki.us>
To: Jaakko Heinonen <j...@freebsd.org>
Cc: bug-fo...@freebsd.org
Subject: Re: conf/141258: /etc/rc.d/tmp may act incorrectly based on
unprivleged local user actions
Date: Fri, 5 Mar 2010 06:29:06 -0600
On Fri, Mar 5, 2010 at 12:15 AM, Jaakko Heinonen <j...@freebsd.org> wrote:
>
> 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
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- etc/rc.d/tmp =A0 =A0 =A0 =A0(revision 204194)
> +++ etc/rc.d/tmp =A0 =A0 =A0 =A0(working copy)
> @@ -51,8 +51,8 @@ case "${tmpmfs}" in
> =A0[Nn][Oo])
> =A0 =A0 =A0 =A0;;
> =A0*)
> - =A0 =A0 =A0 if /bin/mkdir -p /tmp/.diskless 2> /dev/null; then
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rmdir /tmp/.diskless
> + =A0 =A0 =A0 if _tmpdir=3D$(mktemp -d -q /tmp/.diskless.XXXXXX); then
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rmdir ${_tmpdir}
> =A0 =A0 =A0 =A0else
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if [ -h /tmp ]; then
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0echo "*** /tmp is a symlin=
k to a non-writable area!"
> %%%
>
Seems like an appropriate fix. I don't have a way to test this out at
the moment though.
Jon
Responsible-Changed-From-To: freebsd-rc->jh
Responsible-Changed-By: jh
Responsible-Changed-When: Fri Mar 12 06:35:13 UTC 2010
Responsible-Changed-Why:
Take.