summaryrefslogtreecommitdiffstats
path: root/libmount
Commit message (Collapse)AuthorAgeFilesLines
* libmount: close device fd (to avoid mount(2) EBUSY)Karel Zak2012-04-271-53/+17Star
| | | | | | | | | | | | libmount uses libblkid to detect filesystem type. Unfortunately, the blkid probe struct is not freed before mount(2), it means that the device is still open and mount(2) may return EBUSY. We don't need persistent blkid stuff in libmount, so let's close all immediately after device probing. Reported-by: David Zeuthen <zeuthen@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: expose mnt_get_mountpoint as external APIDave Reisner2012-04-264-1/+11
|
* libmount: add mnt_table_find_devno()Karel Zak2012-04-254-0/+38
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix mnt_context_guess_fstype()Karel Zak2012-04-251-3/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add special MNT_ERR_ codesKarel Zak2012-04-242-10/+22
| | | | | | ... to detect some situations where standard -errno is too generic. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix mount by patternKarel Zak2012-04-241-1/+4
| | | | | | | | | | | mount /foo /bar without entry in /etc/fstab the mount command tries all filesystems from /{etc,proc}/filesystems. We should NOT call mount(2) more then once if the syscall returns for example ENOENT, acceptable is only EINVAL. Signed-off-by: Karel Zak <kzak@redhat.com>
* Fix typos found by misspellingsBernhard Voelker2012-04-233-5/+5
| | | | | | | | | | | | | | | The tool misspellings (https://github.com/lyda/misspell-check) detected several typos. Command used: $ git ls-files | grep -v ^po/ | misspellings -f - * isosize: Fix typo in usage string. * configure.ac: Fix typo in help string of --enable-most-builds option. * fdisk: Fix typo in man page. * libblkid, blkid, mount: Likewise. * Fix various typos in docs and in source code comments. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* libmount: add support for PARTUUID= and PARTLABEL=Karel Zak2012-04-191-2/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_context_get_options()Karel Zak2012-04-184-2/+24
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_context_fstab_applied()Karel Zak2012-04-174-1/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add support to parse /proc/swapsKarel Zak2012-04-037-4/+213
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: clean up MNT_FMT_* usage in parserKarel Zak2012-04-031-15/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix recursively propagation mountingDong Hao2012-03-211-2/+3
| | | | | | | | | | | Provide the recursive flag of propagation mounting. Recursive flag could be used together with propagation flag. [kzak@redhat.com: - add MS_SILENT to acceptable propagation flags, - fix new code in libmount too] Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Dong Hao <haodong@linux.vnet.ibm.com>
* libmount: improve mnt_tables_is_mountedKarel Zak2012-03-201-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add configfs to pseudofs listKarel Zak2012-03-201-0/+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: cleanup flags usageKarel Zak2012-03-076-54/+120
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_fs_streq_target() and export all mnt_fs_streq_*Karel Zak2012-03-027-33/+64
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_fs_streq_srcpath()Karel Zak2012-03-024-32/+35
| | | | | | | | | | 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: cosmetic changes around "none"Karel Zak2012-03-022-3/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't treat "none" differentlyDave Reisner2012-03-023-15/+6Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* build-sys: enhance readability of the autotools filesSami Kerola2012-02-281-26/+52
| | | | | | | | Several horizontal lists are turned to vertical, and sorted to alphabetical order. Additionally spaces are converted to tabs where ever possible. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: allow empty source for mount(2) syscallKarel Zak2012-02-281-1/+3
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797438 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use mount.<type> -s for NFS onlyKarel Zak2012-02-271-1/+6
| | | | | | | Unfortunately, it seems that for example mount.cifs don't care about the API, so we need exception like the original mount(8). 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>
* docs: corrections to FSF license files, and postal addressSami Kerola2012-02-241-3/+3
| | | | | | | | | | | | | | The COPYING and Documentation/licenses/COPYING* files are being replaced by files from GNU web site. http://www.gnu.org/licenses/gpl-2.0.txt http://www.gnu.org/licenses/lgpl-2.1.txt Postal addresses to FSF in other files are updated to match with the address in license files. Reference: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mount: distinguish between MS_COMMENT flags (netdev, nofail, ...)Karel Zak2012-02-231-0/+4
| | | | | | | | | | Since util-linux 2.12h (year 2004) there is only one flag for all dummy options like _netdev or nofail. Unfortunately it means that when mount(8) composes the final mount options string for mtab (or for mount.<type> helpers) the string is generated incorrectly. Reported-by: Dave Reisner <d@falconindy.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: clean up context docsKarel Zak2012-02-231-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update copyright yearsKarel Zak2012-02-221-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup docsKarel Zak2012-02-228-32/+55
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove teaser proto for mnt_table_get_nameDave Reisner2012-02-223-3/+0Star
| | | | | | | | | | This function was never implemented, but the proto has existed since the inception of the library. As the libmnt_table struct doesn't include a member necessary to carry the name of the table, simply discard this prototype. If ever a need to break ABI comes up, perhaps this could be revisited. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* libmount: use #ifdef fr selinux specific variablesKarel Zak2012-02-031-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't ignore chmod/own errorsKarel Zak2012-02-021-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove dead assigmentKarel Zak2012-02-022-2/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: consolidate sysconf() usageKarel Zak2012-01-311-16/+13Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: make iter reset more robust [coverity scan]Karel Zak2012-01-301-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix resource leak [coverity scan]Karel Zak2012-01-301-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix resource leak [coverity scan]Karel Zak2012-01-301-3/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix possible null dereferencing [coverity scan]Karel Zak2012-01-301-1/+3
| | | | | | ... let's keep Coverity analyzer happy. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix negative returns [coverity scan]Karel Zak2012-01-301-6/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix checked-return [coverity scan]Karel Zak2012-01-301-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix context test logicKarel Zak2012-01-261-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix leak in tabdiff testKarel Zak2012-01-261-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix leak in tab parsing error codeKarel Zak2012-01-261-3/+19
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix leak in tab_update.c testKarel Zak2012-01-261-0/+1
|
* libmount: fix buffer overflow and leaks in testsKarel Zak2012-01-261-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't pass comments=/x-* to mount.<type> helpersKarel Zak2012-01-253-15/+38
| | | | | | | This patch add a new flag MNT_NOHLPS for mount options map, options with this flag will not be passed to /sbin/mount.<type> helpers. Signed-off-by: Karel Zak <kzak@redhat.com>