summaryrefslogtreecommitdiffstats
path: root/sys-utils/mount.c
Commit message (Collapse)AuthorAgeFilesLines
* mount: apply "nofail" to MNT_ERR_NOSOURCE libmount errorKarel Zak2014-04-071-0/+2
| | | | | | | | | | | | | fstab: UUID=nonexist /mnt/nonexist1 ext4 nofail 0 1 # mount -av mount: can't find UUID=nonexist .. this is bug of course. Reported-by: Patrick McLean <chutzpah@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix --all and nofail return codeKarel Zak2014-04-071-4/+6
| | | | | | | | | Now the "nofail" affects warnings warning messages only. That's wrong and regression (against original non-libmount version). The nofail has to control return code too. Reported-by: Patrick McLean <chutzpah@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup, mount: remove --pass-fd at allKarel Zak2014-01-061-6/+2Star
| | | | | | | | The option is unsupported since v2.23, let's cleanup man pages and code to remove it at all. Reported-by: "Dale R. Worley" <worley@alum.mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: make NAME=value tags usable for non-rootKarel Zak2013-11-191-4/+22
| | | | | | | | | | | | | | | The libmount does not care if we set source or target, it's able to swap it, but the mount.c function sanitize_paths() does not work as expected if we set NAME=value as target. It means that $ mount LABEL=foo does not work for non-root users (since 51e3530cdcb1d4f3ab91ae953ebc5adcdc5f9239, v2.24). This patch also checks if source or target is specified more than once. Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: use libmnt_table reference counterKarel Zak2013-08-211-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: use libmnt_cache reference countingKarel Zak2013-08-211-3/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: more robust options string parsingKarel Zak2013-05-301-0/+2
| | | | | | | | | # mount -o=rw /dev/sdb /mnt/test mount: libmount/src/optmap.c:212: mnt_optmap_get_entry: Assertion `namelen' failed. Aborted (core dumped) Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=968786 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add --read-write to man pageKarel Zak2013-04-051-1/+1
|
* mount: improve --move error message on shared treesKarel Zak2013-03-251-6/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: correctly propagate ambivalent blkid probing resultsKarel Zak2013-02-131-0/+5
| | | | | | | | libmount ignores "ambivalent probing result" from libblkid and tries filesystems /etc/filesystems. This is incorrect behavior. Reported-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix bind mount success messageBernhard Voelker2013-02-061-1/+1
| | | | | | * sys-utils/mount.c (success_message): s/binded/bound/. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* mount: make --verbose more verbose about propagationKarel Zak2013-01-151-2/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: write success messages to stdoutKarel Zak2013-01-151-5/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: support multiple MS_PROPAGATION flags in one mount(8) execKarel Zak2013-01-151-27/+37
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: Fix -t in listing mode when run as non-rootRichard Tollerton2013-01-091-1/+6
| | | | | | | | | | | Presently, libmount-mount completely prohibits the use of -t by non-root users. This breaks using -t in listing mode as a user, which represents a regression against mount-deprecated, macosx and presumably *BSD. This commit fixes the issue by deferring the mnt_context_is_restricted check for -t until we know we're not in listing mode. Signed-off-by: Rich Tollerton <rich.tollerton@ni.com>
* mount: sanitize paths from non-root usersKarel Zak2012-11-261-0/+35
| | | | | | | | | | | | | | | | | | | | | | $ mount /root/.ssh/../../dev/sda2 mount: only root can mount UUID=17bc65ec-4125-4e7c-8a7d-e2795064c736 on /boot this is too promiscuous. It seems better to ignore on command line specified paths which are not resolve-able for non-root users. Fixed version: $ mount /root/.ssh/../../dev/sda2 mount: /root/.ssh/../../dev/sda2: Permission denied $ mount /dev/sda2 mount: only root can mount UUID=17bc65ec-4125-4e7c-8a7d-e2795064c736 on /boot Note that this bug has no relation to mount(2) permissions evaluation in suid mode. The way how non-root user specifies paths on command line is completely irrelevant for comparison with fstab entries. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: supports paths canonicalization for alternative fstabsKarel Zak2012-10-241-0/+10
| | | | | | | | # mount --fstab /path/my.fstab has to support standard operations with paths. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add verbose messagesKarel Zak2012-10-091-1/+25
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=864227 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: losetup: remove obsolete encryption supportLudwig Nussel2012-09-111-40/+2Star
| | | | | | | | | | | | | | | 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>
* mount: replace control chars in mountpoint nameKarel Zak2012-08-061-1/+20
| | | | | | | | | | For compatibility with coreutils and to avoid complex solutions in mount output mount replaces control characters with '?'. Note that the listing mode in mount(8) is in maintenance mode -- findmnt(8) provides more robust and better solutions. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove unnecessary free()Karel Zak2012-07-261-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use err_exclusive_options()Karel Zak2012-07-261-33/+14Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) add --source and --targetKarel Zak2012-07-171-25/+73
| | | | | | | | | | | | | | | | | | | | | | | | 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 new options allows to be more explicit # mount --target /foo (mounts /dev/sda5) # mount --source /foo (binds /foo to /bar) It's possible to use the options together # mount --source /dev/sda2 --target /home Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) use exclusive_option()Sami Kerola2012-06-171-7/+28
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mount: (new) allow sloppy for non-rootKarel Zak2012-06-141-1/+1
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=825836 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) fix MS_REC usageKarel Zak2012-05-281-1/+1
| | | | | | | | # mount -R /mnt/test /mnt/test mount: propagation flags (--make-* or --bind options) are mutually exclusive Reported-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add MNT_ERR_MOUNTOPTKarel Zak2012-05-281-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) add loopdev specific error messageKarel Zak2012-05-281-3/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sys-utils: cleanup strtoxx_or_err()Karel Zak2012-05-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) use MNT_ERR_ for error messagesKarel Zak2012-04-241-14/+13Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) add support for PARTUUID= and PARTLABEL=Karel Zak2012-04-191-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) be more pedantic about --make-*Karel Zak2012-04-181-11/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) improve error messagesKarel Zak2012-04-171-8/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sys-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mount: (new) add missing xalloc.hKarel Zak2012-03-201-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* xalloc: use xasprintf in all filesSami Kerola2012-03-181-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: add mnt_fs_streq_target() and export all mnt_fs_streq_*Karel Zak2012-03-021-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_fs_streq_srcpath()Karel Zak2012-03-021-1/+1
| | | | | | | | | | 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>
* mount: (new) add 'internal-only(i)' to non-root allowed optionsRaghavendra D Prabhu2012-02-281-1/+1
| | | | | | | | | Commit ce433404 introduced the change, which causes something like mount -i <user-mount-path> to break which worked well before util-linux-2.21, now it gives message 'mount: only root can use "--internal-only" option' when that shouldn't be the case when it is already in fstab. Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
* libmount: allow empty source for mount(2) syscallKarel Zak2012-02-281-1/+5
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797438 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) cleanup mount -a return codesKarel Zak2012-02-241-6/+17
| | | | | | | | | | | | | | | | New return codes: 0 : all mounted (or all ignored) 64 : some mounted, some failed 32 : all failed Note that already mounted or ignored (filtered out by -t or -O) filesystems don't affect the final return code. The original mount(8) returns 0 instead of 64, so the situation "some mounted, some failed" cannot be detected. 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: (new) fix resource leak [coverity scan]Karel Zak2012-01-301-0/+1
| | | | | | | well, this is free-before-exit, but let's use mount(8) as test application for libmount and keep it without leaks. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: define fallback selinux_warning macro with 2 paramsDave Reisner2012-01-301-1/+1
| | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* mount: (new) add --fstab <path> optionKarel Zak2012-01-231-2/+29
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add info about libmount features to --version outputKarel Zak2012-01-231-3/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) share exit codes by include/exitcodes.hKarel Zak2012-01-231-46/+37Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) add source/target to error messagesKarel Zak2012-01-201-12/+19
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) improve mount -a exist codes and erroer messagesKarel Zak2012-01-201-15/+9Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) add selinux warningKarel Zak2012-01-201-1/+35
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>