summaryrefslogtreecommitdiffstats
path: root/libmount
Commit message (Collapse)AuthorAgeFilesLines
...
* libmount: fix shadow declarationSami Kerola2012-07-261-1/+1
| | | | | | | libmount/src/tab_update.c:203:8: warning: declaration of 'rc' shadows a previous local [-Wshadow] libmount/src/tab_update.c:159:6: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: fix compiler warning [-Wsign-compare]Karel Zak2012-07-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: check VFS mount options in mnt_diff_tables()Karel Zak2012-07-181-3/+5
| | | | | | | | | | | | | after "-o remount,ro" in unshared namespace is the original VFS entry still read-write: original: 42 21 8:2 / /boot rw,relatime - ext4 /dev/sda2 ro,user_xattr,acl,barrier=1,data=ordered unshared + ro remount: 78 51 8:2 / /boot ro,relatime - ext4 /dev/sda2 ro,user_xattr,acl,barrier=1,data=ordered Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: allow to disable swap between source and targetKarel Zak2012-07-176-4/+37
| | | | | | | | | | | | | | | | | | | | | In some cases (for example if only one mount argument is given) may be mount request ambivalent: # mount /foo and fstab: /dev/sda5 /foo rw 0 0 /foo /bar bind 0 0 The libmount allows to swap between source and target (if source is not LABEL or UUID) by default. The new function mnt_context_disable_swapmatch() allows to disable this feature. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: rename mnt_context_fstab_applied to mnt_context_tab_appliedKarel Zak2012-07-124-6/+6
| | | | | | | The function is also usable in umount to detect is mtab has been applied. Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: fix typos found by misspellingsBernhard Voelker2012-07-092-2/+2
| | | | | | | | | | | | | | | | | | The tool misspellings (https://github.com/lyda/misspell-check) detected several typos. Command used: $ git ls-files | grep -v ^po/ | misspellings -f - * Documentation/releases/v2.18-ReleaseNotes: Fix typo in news entry. * NEWS: Likewise. * config/texinfo.tex: Fix typo in comments. * libmount/src/context.c: Fix typo in comment. * libmount/src/fs.c: Likewise. * login-utils/login.c: Likewise. * login-utils.su.1: Fix typo in man page. * sys-utils/chcpu.c: Fix typo in error message. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* libmount: save task ID for mountinfo tilesKarel Zak2012-06-285-3/+57
| | | | | | Add new function mnt_fs_get_tid() to get task ID for the given filesystem. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: enable libmount and libblkid docsKarel Zak2012-06-262-11/+6Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: cleanup .gitignore filesKarel Zak2012-06-261-1/+0Star
| | | | | | | - move all binaries to top-level .gitignore - remove unnecessary */.gitignore files Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: convert lib/ to libcommon.laKarel Zak2012-06-261-10/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* 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>