[Pkg-sysvinit-devel] Bug#359717: mountpoint command fail to identify mount points on same device
Giuseppe Sacco
giuseppe at eppesuigoccas.homedns.org
Sun Oct 25 09:24:40 UTC 2009
severity 359717 important
thanks
Hi all,
while checking hylafax bugs #551566 and #551443, I found a problem with
mountpoint command. Browsing initscripts bugs, it seems this is already
reported as #359717.
I checked mountpoint source code and found that it does an stats() of
the supposed mount point and its parent directory. If both stats()
report the same block device, then mountpoint think this is not a mount
point, otherwise it says it is a mount point.
So, if a system has its root file system mounted from device /dev/sda1,
and a second mount point is created with "bind" option, i.e., without
having an underneath block device, then, when mountpoint is invoked, it
does not find the correct nature of second mount point.
For fixing this bug I wonder if it possible to scan /etc/mtab and
identify all possibile mount points. An alternative could be
use /proc/mounts, but I suppose this is not always available since
probably it is Linux related and won't work on *bsd or hurd kernels.
Of course, current behaviour could be left unchanged for systems where
no /etc/mtab is present.
As a side note, hurd might use /etc/mtab, as I found here:
http://www.gnu.org/software/hurd/community/gsoc/project_ideas/mtab.html
Bye,
Giuseppe
More information about the Pkg-sysvinit-devel
mailing list