summaryrefslogtreecommitdiffstats
path: root/libmount
Commit message (Collapse)AuthorAgeFilesLines
* libmount: don't remove user= when executed by rootKarel Zak2012-09-121-8/+4Star
| | | | | | | | | | | | | | The original mount(8) allows to store arbitrary user= option to mtab file if called by root user. For example: # mount -f foo /bar -t xxx -o rw,user=kzak the new mount removes the 'user=' and 'users' options at all for root user. This is regression. The original functionality is necessary by 'sshfs' where fuse writes to mtab file by mount(8). Reported-by: Juergen Daubert <jue@jue.li> (and 'horrorStruck' on IRC) Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: segfaults if neither /etc/filesystems nor/proc/filesystems existsKarel Zak2012-09-122-0/+7
| | | | | Reported-by: Juergen Daubert <jue@jue.li> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: losetup: remove obsolete encryption supportLudwig Nussel2012-09-111-18/+4Star
| | | | | | | | | | | | | | | kernel cryptoloop is deprecated since ages and support for cryptoloop in util-linux is incomplete/broken. - no password hashing - last 8 bit of key are always set to zero - no binary keys possible (stops reading key at \n and \0) In the past some Distros added the above features with patches. So remove cryptoloop support from util-linux completely to make sure people won't try using it. Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: improve mnt_table_get_root_fs() docsKarel Zak2012-09-101-1/+12
| | | | | | | Fix info about return value, improve description. Reported-by: Amit <amit.uttam@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use O_CLOEXEC everywhereKarel Zak2012-09-042-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remount does not add entry to mtab fileKarel Zak2012-08-271-12/+15
| | | | | | | | | | | | # mount -n -o ro /dev/sda1 / # mount -o remount,rw /dev/sda1 / For the backward compatibility the command mount(8) should to add a new entry to the file /etc/mtab on remount if the original entry not found (because previous mount has been called with -n). Reported-by: <frinnst> on IRC Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: rewrite mnt_table_is_fs_mounted() to be less aggressiveKarel Zak2012-08-242-24/+52
| | | | | | | | | The old implementation always canonicalizes target (mountpoint) path. It's better to postpone this operation until the path is really necessary (usually it's unnecessary), because readlink() on mountpoint may trigger automounts. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: expand paths at make timeKarel Zak2012-08-151-1/+2
| | | | | | | | | | | | | autoconf docs about *dir variables (e.g bindir): ... A corollary is that you should not use these variables except in makefiles... ...you should not rely on AC_CONFIG_FILES to replace bindir and friends in your shell scripts and other files; instead, let make manage their replacement. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: don't compile lib{mount,blkid} tests when --disable-static specifiedKarel Zak2012-08-021-0/+3
| | | | | | The tests often depend on private (non-API) library functions. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: deduplicate SELinux mount optionsKarel Zak2012-08-011-0/+9
| | | | | | | | | | We already have a clue about SELinux specific mount options in libmount, so it makes sense to deduplicate the options as Linux kernel does not support duplicate SELinux options. (SELinux kernel stuff somehow ignores standard Linux mount conventions...) Requested-by: Niels de Vos <ndevos@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_optstr_deduplicate_option()Karel Zak2012-08-014-9/+74
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: move tests to check_PROGRAMSKarel Zak2012-07-301-1/+1
| | | | | | Thanks to Mike Frysinger. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add minisg COPYING filesKarel Zak2012-07-271-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add noreturn function attributeSami Kerola2012-07-261-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* 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>