Jeremy Kister on 18 Aug 2010 15:35:33 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] more on the wonders of file systems.


On 8/18/2010 5:49 PM, Joe Kisela wrote:
If they are quick mounts for testing or whatever, don't muck in /mnt - thats
for more permanent things.  Use /tmp

Perhaps I'm reading your message incorrectly, but that's near the exact opposite of what I'd ever tell someone.


/mnt is the ideal point to mount things temporarily.

if whatever I mounted in /mnt became important enough to me to be put in [v]fstab, i'd remount it somewhere else first.


i can't think of a case where i'd recommend to mount on /tmp. supposing the reader's /tmp is mode 0777, anyone on his box (including any possible apache-virtservers with php, perl, or suexec) can create things in /tmp. suppose someone creates a link from /tmp/target to /etc and you didn't realize it (or suppose you check and in the second or so between the time you checked, someone creates it (e.g., race condition)):

s1> ls -ld /tmp
drwxrwxrwt   4 root sys      797 Aug 18 18:25 /tmp
s1> ls -ld /tmp/target
lrwxrwxrwx   1 user other      8 Aug 18 18:25 /tmp/target -> /etc
s1> ls -ld /etc
drwxr-xr-x   2 root sysadmin   2 Aug 18 18:26 /etc
s1> mount /dev/sdX /tmp/target
s1>
s1>
s1> ls -la /etc/passwd
/etc/passwd: No such file or directory

whoops!


--

Jeremy Kister
http://jeremy.kister.net./
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug