summaryrefslogtreecommitdiffstats
path: root/libmount
Commit message (Collapse)AuthorAgeFilesLines
* build-sys: convert libmount/ to moduleKarel Zak2012-06-264-111/+153
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/loopdev: use warn_unused_result forimportant functionsKarel Zak2012-06-212-3/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: improve ifdef HAVE_LIBSELINUX stuffKarel Zak2012-06-191-2/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch '2012wk23' of git://github.com/kerolasa/lelux-utiliteetitKarel Zak2012-06-152-3/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '2012wk23' of git://github.com/kerolasa/lelux-utiliteetit: lsblk: use blkdev_scsi_type_to_name() blkdev: add blkdev_scsi_type_to_name() wipefs: use symbolic value for markup mode eject: inform if CD-ROM drive is not ready docs: clean up partx.8 manual include: fix void pointer arithmetics warnings sysfs: fix printf format warnings build: fix unused parameter warnings build: fix redundant redeclaration warnings include: fix spurious list.h warnings uuidd: use output redirection which works [checkbashisms] blkid: fix realloc memory leak [cppcheck] setarch: do not use -1 as array index [cppcheck]
| * build: fix unused parameter warningsSami Kerola2012-06-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pager.c:203:14: warning: unused parameter 'argc' [-Wunused-parameter] pager.c:203:26: warning: unused parameter 'argv' [-Wunused-parameter] randutils.c:108:14: warning: unused parameter 'argc' [-Wunused-parameter] randutils.c:108:26: warning: unused parameter 'argv' [-Wunused-parameter] optstr.c:774:37: warning: unused parameter 'optstr' [-Wunused-parameter] optstr.c:774:51: warning: unused parameter 'value' [-Wunused-parameter] optstr.c:774:65: warning: unused parameter 'valsz' [-Wunused-parameter] optstr.c:774:79: warning: unused parameter 'next' [-Wunused-parameter] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * build: fix redundant redeclaration warningsSami Kerola2012-06-111-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | env.c:24:15: warning: redundant redeclaration of 'environ' [-Wredundant-decls] su.c:81:15: warning: redundant redeclaration of 'environ' [-Wredundant-decls] fstab.c:581:14: warning: redundant redeclaration of 'strsignal' [-Wredundant-decls] kill.h:1:13: note: previous declaration of 'get_pids' was here kill.c:152:13: warning: redundant redeclaration of 'get_pids' [-Wredundant-decls] kill.c:142:5: warning: redundant redeclaration of 'main' [-Wredundant-decls] getopt.c:89:5: warning: redundant redeclaration of 'main' [-Wredundant-decls] agetty.c:536:15: warning: redundant redeclaration of 'optarg' [-Wredundant-decls] agetty.c:537:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls] script.c:161:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls] wall.c:96:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls] libmount.h:362:26: note: previous declaration of 'mnt_update_get_fs' was here libmount.h:454:26: note: previous declaration of 'mnt_context_get_fs' was here mountP.h:383:26: warning: redundant redeclaration of 'mnt_context_get_fs' [-Wredundant-decls] mountP.h:398:26: warning: redundant redeclaration of 'mnt_update_get_fs' [-Wredundant-decls] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | libmount: make some string operations more robustKarel Zak2012-06-154-5/+10
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | libmount: fix trivial typosPetr Uzel2012-06-151-2/+2
| | | | | | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* | libmount: fix read before allocated bufferPetr Uzel2012-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | valgrind --leak-check=full ./sys-utils/mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux .... ==21359== Invalid read of size 1 ==21359== at 0x415AC6: mnt_optstr_remove_option_at (optstr.c:310) ==21359== by 0x416358: mnt_optstr_apply_flags (optstr.c:716) ==21359== by 0x40DFBF: mnt_context_prepare_mount (context_mount.c:86) ==21359== by 0x40EB5A: mnt_context_mount (context_mount.c:782) ==21359== by 0x4058B0: main (mount.c:918) ==21359== Address 0x51cd5bf is 1 bytes before a block of size 10 alloc'd ==21359== at 0x4C297CD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==21359== by 0x4C29957: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==21359== by 0x415780: __mnt_optstr_append_option (optstr.c:188) ==21359== by 0x412822: mnt_fs_append_options (fs.c:764) ==21359== by 0x409288: mnt_context_append_options (context.c:733) ==21359== by 0x4053F0: main (mount.c:776) Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* | libmount: plug a memory leak in exec_helper()Petr Uzel2012-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | valgrind --leak-check=full ./sys-utils/mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux .... ==21359== 28 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==21359== at 0x4C298B2: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==21359== by 0x415780: __mnt_optstr_append_option (optstr.c:188) ==21359== by 0x415CB5: mnt_optstr_set_option (optstr.c:387) ==21359== by 0x40D778: do_mount (context_mount.c:192) ==21359== by 0x40E6A9: mnt_context_do_mount (context_mount.c:685) ==21359== by 0x40EB7B: mnt_context_mount (context_mount.c:786) ==21359== by 0x4058B0: main (mount.c:918) Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* | libmount: don't use nosuid,noexec,nodev for cifs user=fooKarel Zak2012-06-142-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux is incorrectly translated to mount.cifs -o noexec,nosuid,nodev,user=root,password=linux ... The command mount(8) should be sensitive to "user" (without "=<name>") only. The correct cifs command line is: mount.cifs -o user=root,password=linux Addresses: https://bugzilla.novell.com/show_bug.cgi?id=766157 Signed-off-by: Karel Zak <kzak@redhat.com>
* | libmount: don't generate empty option stringsKarel Zak2012-06-142-1/+14
|/ | | | | | | | | | | | mount -t foo something /mnt/test -o user=root,password=linux generates "rw,noexec,nosuid,nodev,password=linux,,user=root" options string for /sbin/mount.foo, the ",," is incorrect. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: trim leading commas from each options stringDave Reisner2012-06-051-0/+5
| | | | | | | | | | | Fixes a bug in option string parsing wherein a line such as: ro,relatime,,nosuid,nodev Will be seen as only the tokens "ro" and "relatime" after the parser encounters a zero length (and erroneously declared NULL) option. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* Fix typos in comments and wall's man pageBernhard Voelker2012-06-051-1/+1
| | | | | | | | | | | Culprits identified again by (newer) misspellings: $ git ls-files | misspellings -f - | grep -v '^po/' * wall: Fix typo in man page. * Fix typos in source code comments. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* libmount: add MNT_ERR_MOUNTOPTKarel Zak2012-05-284-2/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add MNT_ERR_LOOPDEVKarel Zak2012-05-282-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use stderr for initial debug messageKarel Zak2012-05-231-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: Use binary search to compare pseudofsDave Reisner2012-05-231-25/+44
| | | | | | | | | It's the responsibility of anyone adding to this list in the future to ensure that the list remains sorted. While we're at it, expand this list of known pseudofs types. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* libmount: don't canonicalize targetKarel Zak2012-05-173-7/+11
| | | | | | | | | | | | | | Note that mountpoint (target_ paths in /proc/mounts and /proc/self/mountinfo are always canonicalized by kernel. * for umount we don't have to canonicalize target by default if the mountpoint is found in /proc/self/mountinfo * in mnt_table_find_target() is unnecessary to canonicalize target paths if the table of the filesystems is read from /proc/self/mountinfo Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=820707 Signed-off-by: Karel Zak <kzak@redhat.com>
* 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>