Date: Thu, 7 Aug 2008 17:00:04 GMT From: Alex Kozlov <spam@rm-rf.kiev.ua> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/126324: [patch] rc.d/tmp: Prevent mounting /tmp in second time Message-ID: <200808071700.m77H04tk015531@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/126324; it has been noted by GNATS. From: Alex Kozlov <spam@rm-rf.kiev.ua> To: Kris Kennaway <kris@FreeBSD.org>, bug-followup@freebsd.org, spam@rm-rf.kiev.ua Cc: Subject: Re: bin/126324: [patch] rc.d/tmp: Prevent mounting /tmp in second time Date: Thu, 7 Aug 2008 19:57:53 +0300 On Thu, Aug 07, 2008 at 12:35:43PM +0200, Kris Kennaway wrote: > Kris Kennaway wrote: > > Alex Kozlov wrote: > > > >> Index: src/etc/rc.d/tmp > >> @@ -43,6 +43,7 @@ > >> # > >> case "${tmpmfs}" in > >> [Yy][Ee][Ss]) > >> + /sbin/umount /tmp 2>/dev/null && echo /tmp was already mounted! > >> mount_md ${tmpsize} /tmp "${tmpmfs_flags}" > >> chmod 01777 /tmp > >> ;; > >> @@ -57,6 +58,7 @@ > >> echo "dropping into shell, ^D to continue anyway." > >> /bin/sh > >> else > >> + /sbin/umount /tmp 2>/dev/null && echo /tmp was already > >> mounted! > >> mount_md ${tmpsize} /tmp "${tmpmfs_flags}" > >> chmod 01777 /tmp > >> fi > > > > This will destroy any files the admin may have deliberately created on > > /tmp after dropping to single user mode. > > Er, coffee hadn't kicked in. That will only happen with tmpfs which > isn't used yet. Still, a better solution might keep that in mind to > avoid introducing a bug later. Well, as alternative We can just don't touch /tmp if it already mounted. This also prevent md device leak at least until bin/114468 will be resolved. -- Adios
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808071700.m77H04tk015531>