fat-based fs mount bug??

Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Sun, 18 May 1997 01:07:19 +0100 (BST)


I think that the following is a bug. (More likely kernel than mount, I
think.) I'm not au-fait with what POSIX says about fs mounting and by
whom, but believe that there is a problem somewhere here...

I first noticed it a while back (prob 2.1.28 or so), but couldn't spot the
pattern (and didn't know whether I was just being inept), so I let it lie.

When I try to mount a fat-based (msdos or fat) fs from an "su" shell, it
sets the permissions (on the mount dir /mnt/dosd/) from "drwxr-xr-x" to
"drwx--x--x". This means that only root can read the stuff on my dosd
partition, which is inconvenient. If, however, I use "su -", everything
is fine. Similarly if I login as root.

I thought that the only difference between "su" and "su -" was that the
latter ran all login scripts, and changed directories, etc.

Reasons I think it's a fat bug, rather than a vfs or mount problem:
0. It doesn't affect ext2 (hardcoded), or isofs (modular).

Relevant sysinfo:
0. Linux-2.1.38. Only my RadioTrack patch applied, which doesn't touch fs
code ;-)
1. mount-2.6g
2. One (3.2Gb) IDE drive.
3. fat, msdos, vfat and isofs as modules. ext2 in kernel.

More stuff on request, but I can't think of any more useful stuff.

Sorry for the lack of patch, but I don't really know how VFS works yet.
I'll keep looking tonight, though.

BTW: Could someone tell me what the rules are for the perms on a mount
point? Are they kept? If changed while mounted, are they kept?
Are they kept after umount?

----- From script -----
pc29:~$ ls -ld /mnt/dosc
1 drwxr-xr-x 2 root root 1024 Feb 17 12:14 /mnt/dosc/
pc29:~$ su
[root@pc29 weejock]# mount -t msdos /dev/hda1 /mnt/dosc
[root@pc29 weejock]# ls -ld /mnt/dosc
drwx--x--x 14 root root 16384 Jan 1 1970 /mnt/dosc
[root@pc29 dosc]# exit
pc29:~$ cd /mnt/dosc/
pc29:/mnt/dosc$ ls
ls: .: Permission denied
pc29:/mnt/dosc$ cd progra~1
pc29:/mnt/dosc/progra~1$ ls
ls: .: Permission denied
pc29:/mnt/dosc/progra~1$ cd ..
pc29:/mnt/dosc$ cat autoexec.bat
cat: autoexec.bat: Permission denied
pc29:/mnt/dosc$ cat autoexec.ba
cat: autoexec.ba: No such file or directory
pc29:/mnt/dosc$ cd
pc29:~$ su - <<======= Difference
[root@pc29 ~]# umount /mnt/dosc
[root@pc29 ~]# mount -t msdos /dev/hda1 /mnt/dosc
[root@pc29 ~]# ls -ld /mnt/dosc
drwxr-xr-x 2 root root 1024 Feb 17 12:14 /mnt/dosc
[root@pc29 ~]# logout <<======= Difference
pc29:~$ cd /mnt/dosc
pc29:/mnt/dosc$ ls
total 2160
16 -rwxr-xr-x 1 root root 389 May 12 22:57 autoexec.bat*
----- end -----


Matthew Kirkwood  |  Mail:  weejock@ferret.lmh.ox.ac.uk
LMH JCR,          |  Web:   http://www-jcr.lmh.ox.ac.uk/~weejock/
Oxford OX2 6QA,   |  "Let your feelings slip ...
England.          |     but never your mask ..." -- Underworld