Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

2 views
Skip to first unread message

Jaakko Heinonen

unread,
Mar 5, 2010, 1:20:03 AM3/5/10
to freeb...@freebsd.org
The following reply was made to PR conf/141258; it has been noted by GNATS.

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!"
%%%

Jon Passki

unread,
Mar 5, 2010, 8:00:13 AM3/5/10
to freeb...@freebsd.org
The following reply was made to PR conf/141258; it has been noted by GNATS.

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

j...@freebsd.org

unread,
Mar 12, 2010, 1:35:14 AM3/12/10
to j...@freebsd.org, freeb...@freebsd.org
Synopsis: /etc/rc.d/tmp may act incorrectly based on unprivleged local user actions

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.

http://www.freebsd.org/cgi/query-pr.cgi?pr=141258

0 new messages