summaryrefslogtreecommitdiffstats
path: root/sys-utils/mount.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* mount: fix compiler warnings [-Wunused-parameter -Wunused-variable]Karel Zak2012-01-171-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove duplicate includesKarel Zak2012-01-171-2/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: avoid canonicalizing pseudofs pathsDave Reisner2012-01-171-3/+4
| | | | | | | | | | This fixes a display bug in the new mount wherein a psuedofs existing in $PWD by name will be resolved and shown as a real mount point. $ cd /tmp; mkdir nfsd; mount | grep nfsd /tmp/nfsd on /proc/fs/nfsd type nfsd (rw,relatime) Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* libmount: add MNT_OMODE_NOTABKarel Zak2012-01-161-1/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: avoid duplicate loopdevsKarel Zak2012-01-161-2/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (new) print error messagesKarel Zak2012-01-131-6/+274
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add --enable-new-mountKarel Zak2012-01-111-0/+543
Now we have three versions of the mount(8) utility * old mount(8) --enable-mount [default] * old mount(8) linked with libmount This is this is necessary for systems without mtab file. --enable-libmount-mount - new mount(8) This is completely new pure-libmount based mount(8). --enable-new-mount Signed-off-by: Karel Zak <kzak@redhat.com>