summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab.c
Commit message (Collapse)AuthorAgeFilesLines
* libmount: improve mnt_tables_is_mountedKarel Zak2012-03-201-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix "already mounted" detection on systems with mtabKarel Zak2012-03-091-17/+49
| | | | | | | | For systems with regular mtab the fs->root should be ignored in "already mounted" heuristic. Reported-by: Matt Burgess <matthew@linuxfromscratch.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: avoid infinite loop in child fs iterationDave Reisner2012-03-081-0/+5
| | | | | | | | | | | | | | | | | | In early userspace, the rootfs is mounted with itself as its parent. Example /proc/self/mountinfo: 1 1 0:1 / / rw - rootfs rootfs rw 14 1 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw 15 1 0:13 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sys rw 16 1 0:5 / /dev rw,nosuid,relatime - devtmpfs dev rw,size=506956k 17 1 0:14 / /run rw,nosuid,nodev,relatime - tmpfs run rw,mode=755 This causes an infinite loop in mnt_table_next_child_fs, and is evidenced by a crash via infinite recursion in findmnt. Simply catch the condition where the ID of the parent is the ID of the current fs we're examining and skip over it to the next mount in the table. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* libmount: add mnt_fs_streq_target() and export all mnt_fs_streq_*Karel Zak2012-03-021-11/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_fs_streq_srcpath()Karel Zak2012-03-021-21/+10Star
| | | | | | | | | | We have to be careful with "none" or another dummy sources for pseudo filesystems. These strings should be canonicalized or compared as a paths. The function is not exported by library API. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't treat "none" differentlyDave Reisner2012-03-021-4/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This causes more problems than it solves. In the latest edition: # mount -t proc none foo mount: foo: mount failed: Invalid argument A check for source and target fails in mnt_context_apply_fstab() because, even though they were indeed specified on the cmdline, __mnt_fs_set_source_ptr() altered this and NULL'd out the source. If you're able to mount this device via other means, other tools start reporting oddities, such as mount's output: (null) on /foo type proc (rw,relatime) or findmnt: TARGET SOURCE FSTYPE OPTIONS /foo proc rw,relatime Simply treat "none" like any other source when passed in. [kzak@redhat.com: - don't translate NULL to "none" in mnt_fs_set_source()] Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: canonicalize targets from fstab on mount -aKarel Zak2012-02-241-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: optimize for paths with tailing slashKarel Zak2012-02-241-1/+1
| | | | | | | mnt_table_find_target() canonicalizes paths by libmnt cache, but it's overkill if the difference between paths is tailing slash only. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: canonicalize all paths from (fs)tabKarel Zak2012-02-241-1/+1
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797216 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix compiler warnings [-Wuninitialized -Wformat]Karel Zak2012-01-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fixed a small typos.p@orbitalfox.com2012-01-041-1/+1
|
* libmount: consolidate MNT_FS_* codeKarel Zak2012-01-021-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount; fix possible mem-leakKarel Zak2012-01-021-7/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: always trust the source of a pseudofsDave Reisner2012-01-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Since nodev FSs have no backing block device, it's unreasonable to try and resolve the source back to a path on the filesystem. Always trust the source of the FS given in /etc/fstab to avoid remounting the device when a directory of the same name exists in the current working directory. Example reproduction: # mkdir /foo # echo 'foo /foo tmpfs defaults 0 0' >> /etc/fstab # mount -a # cd /root; mkdir foo # mount -a # mount | grep /foo foo on /foo type tmpfs (rw,relatime) /root/foo on /foo type tmpfs (rw,relatime) [kzak@redhat.com: - use fs->flags to detect pseudo FS] Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: ignore tailing slash in netfs source pathsPetr Uzel2011-11-081-5/+12
| | | | | | Addresses: https://bugzilla.novell.com/show_bug.cgi?id=728480 Signed-off-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: previously assumed null pointer [smatch scan]Karel Zak2011-09-121-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove 'seclabel' on remount, improve for 2.6.39Karel Zak2011-07-251-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove unnecessary includes, mask API as stableKarel Zak2011-07-251-11/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup docsKarel Zak2011-07-231-3/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use top-level directory for libmount rather than shlibs/mountKarel Zak2011-06-091-0/+1095
Signed-off-by: Karel Zak <kzak@redhat.com>