Whamcloud - gitweb
libext2fs: Skip relative pathnames in /etc/mtab in ismounted.c
authorTheodore Ts'o <tytso@mit.edu>
Thu, 23 Apr 2009 02:20:22 +0000 (22:20 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 23 Apr 2009 02:20:22 +0000 (22:20 -0400)
commitf9110f4480eade2d849c4cc08efa49bf0f7f5148
treeb3ffe26ec898f6a2575db9c681710d37ee0c1fa2
parent9266fc7a2fe49c6de871016772a2120830e183a9
libext2fs: Skip relative pathnames in /etc/mtab in ismounted.c

The functions which test to see if a device is mounted can get
confused by entries in /etc/mtab for virtual filesystems:

rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0

If the device name doesn't start with a slash, ignore the /etc/mtab
entry, so that relative pathnames passed into functions such as
ext2fs_check_mount_point() or ext2fs_check_if_mounted() don't return
false positives.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/ismounted.c