Skip to contentSkip to conversation

/etc/mtab and namespaces

DISCUSSION Russell Coker 2 participants 3 messages May 7, 2006 – May 8, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=190962
I have filed a bugzilla entry requesting that /etc/mtab be made a sym-link to /proc/mounts to allow df(1) to work correctly when multiple name spaces are being used.

Signature · 9 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 4 lines · Russell Coker

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=190962
I have filed a bugzilla entry requesting that /etc/mtab be made a sym-link to /proc/mounts to allow df(1) to work correctly when multiple name spaces are being used.

Not that simple - first all the code that uses /etc/mtab has to be fixed to deal with the slight differences between mtab and /proc/mounts.

On my system at the moment:

/etc/mtab has:

none /proc proc rw 0 0
/dev/hda1 /boot ext3 ro,noexec,nosuid,nodev,noatime,nodiratime 0 0
none /tmp tmpfs rw,noexec,nosuid,nodev,noatime,nodiratime,size=1532M,mode=1777 0 0 /dev/mapper/rootvg-var /var ext3 rw,noexec,nodev,noatime,nodiratime,usrquota,grpquota 0 0

and /proc/mounts says:

/proc /proc proc rw 0 0
/dev/hda1 /boot ext3 ro,nosuid,nodev,noexec,noatime,nodiratime,data=ordered 0 0 none /tmp tmpfs rw,nosuid,nodev,noexec,noatime,nodiratime 0 0
/dev/rootvg/var /var ext3 rw,nodev,noexec,noatime,nodiratime,data=ordered,usrquota,grpquota 0 0

If you're *positive* that nothing in userspace cares about the differences noted, it might be doable... Big "if" though...

#2 lore raw
Quoted 8 lines · On Monday 08 May 2006 11:01, [email protected] wrote:
Quoted 4 lines · Russell Coker

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=190962
I have filed a bugzilla entry requesting that /etc/mtab be made a sym-link to /proc/mounts to allow df(1) to work correctly when multiple name spaces are being used.

Not that simple - first all the code that uses /etc/mtab has to be fixed to deal with the slight differences between mtab and /proc/mounts.

It's been done before. The Familiar distribution had /etc/mtab as a sym-link the last time I used it (which was a couple of years ago). It's not a new idea.

Quoted 11 lines

On my system at the moment:

/etc/mtab has:

none /proc proc rw 0 0
/dev/hda1 /boot ext3 ro,noexec,nosuid,nodev,noatime,nodiratime 0 0 none /tmp tmpfs rw,noexec,nosuid,nodev,noatime,nodiratime,size=1532M,mode=1777 0 0 /dev/mapper/rootvg-var /var ext3 rw,noexec,nodev,noatime,nodiratime,usrquota,grpquota 0 0

Quoted 7 lines

and /proc/mounts says:

/proc /proc proc rw 0 0
/dev/hda1 /boot ext3 ro,nosuid,nodev,noexec,noatime,nodiratime,data=ordered 0 0 none /tmp tmpfs rw,nosuid,nodev,noexec,noatime,nodiratime 0 0 /dev/rootvg/var /var ext3 rw,nodev,noexec,noatime,nodiratime,data=ordered,usrquota,grpquota 0 0

The difference seems to be some mount options related to journaling, size, and permission mode. I think that this should be regarded as a kernel bug in that the kernel does not export such data. There is no reason why the kernel code could not export such data.

Quoted 2 lines

If you're *positive* that nothing in userspace cares about the differences noted, it might be doable... Big "if" though...

What do you believe will care about those differences? df, mount, and the quota utilities don't care, and I can't think of any other program that uses /etc/mtab (apart from other programs that do df type operations).

Signature · 9 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.