summaryrefslogtreecommitdiffstats
path: root/mount
Commit message (Collapse)AuthorAgeFilesLines
* mount: remove 'seclabel' mount option on remountKarel Zak2011-07-251-1/+2
| | | | | Reported-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: use xalloc libDavidlohr Bueso2011-07-211-9/+4Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* mount: fix double free in mount.c with SELinux enabledKirill Elagin2011-07-111-7/+8
| | | | | | | | | append_context reallocates memory, invalidating extra_opts1. As a result my_free(extra_opts1) crashes. Signed-off-by: Kirill Elagin <kirelagin@gmail.com> Signed-off-by: Nikita Ofitserov <himikof@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix typos in mount.8Petr Uzel2011-07-111-2/+2
| | | | | | | From: Nicolas Francois <nicolas.francois@centraliens.net> Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530681#15 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* mount: make the error message clearPetr Uzel2011-07-111-1/+1
| | | | | | Reported-by: Micah Anderson <micah@debian.org> Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=558653 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* mount: fix typo in mount.8Petr Uzel2011-07-111-1/+1
| | | | | | Reported-by: Reuben Thomas <rrt@sc3d.org> Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603096 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* mount: fix typo in mount.8Petr Uzel2011-07-111-1/+1
| | | | | | Reported-by: Lars Wirzenius <liw@liw.fi> Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605007 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* mount: remove accidental extra word in ext4 documentation in mount.8Petr Uzel2011-07-111-1/+1
| | | | | | Reported-by: Francis Russell <francis+dbts@unchartedbackwaters.co.uk> Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=599550 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* mount: fix reference to sharedsubtree documentation in mount.8Mike Hommey2011-07-111-1/+1
| | | | | | | Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508572 Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572403 Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508412 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* umount: do not hang with disconnected NFS mountsPetr Uzel2011-06-291-20/+22
| | | | | | | | | | | | | | Since util-linux commit f4612577c942a3683b97632ad0b49671897c2070, umount stat(2)s its argument to check whether it can be associated with some loop device. This could hang with broken NFS mounts. Fix by first checking mtab if umount's argument is mounted and only if we fail, check if there is a loop device associated. http://marc.info/?l=util-linux-ng&m=130924963804836&w=2 Reported-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* mount: first look for mountpointKarel Zak2011-06-292-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | # mount <device|dir> The current code looks for a device and then for a mountpoint in /etc/fstab. This is not user friendly solution. People usually use # mount /dir to mount any filesystem. It makes more sense to check for mountpoint and if not found then for device. This is also important for bind mounts, for example if you have in your fstab: /dev/sda1 /mnt/foo auto defaults /mnt/foo /mnt/bar none bind then # mount /mnt/foo should be interpreted as the first entry and /dev/sda1 should be mounted. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=716483 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: tell mount/* is in maintenance modeSami Kerola2011-06-251-0/+6
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mount: add ufstype=ufs2 to mount.8Karel Zak2011-06-141-0/+6
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=691338 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount.8: remove reprecated bh/nobh options from the manual pageLukas Czerner2011-06-081-11/+6Star
| | | | | | | | | Bh and nobh mount option has been deprecated in ext4 (206f7ab4f49a2021fcb8687f25395be77711ddee) and in ext3 (4c4d3901225518ed1a4c938ba15ba09842a00770) so remove those options from documentation. Signed-off-by: Lukas Czerner <lczerner@redhat.com>
* mount: canonicalize fstab mnt_dirKarel Zak2011-06-021-1/+7
| | | | | Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=709681 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use libmount to detect already mounted bind mountsKarel Zak2011-05-311-4/+38
| | | | | | | | | It's pretty tricky to detect that a bind mount from fstab is already mounted on system without /etc/mtab. Let's use functionality from libmount. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=701176 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove note about obsolete volume_id library from man pageKarel Zak2011-05-121-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: -a segfaults when 4th field is omitted (mount options)Karel Zak2011-05-113-5/+10
| | | | | | | | | | # echo 'tmpd /tmp/x tmpfs' >> /etc/fstab # mkdir /tmp/x # mount -a segfault Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* getopt: fix gcc warningKarel Zak2011-04-191-1/+0Star
| | | | | | | getopt.c:80:13: warning: ‘set_initial_shell’ declared ‘static’ but never defined Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use lock from mnt_update_table()Karel Zak2011-04-134-29/+4Star
| | | | | | The mnt_update_table() is able to create a mtab lock now. Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: block signals when umounting and updating mtab (CVE-2011-1676, ↵Karel Zak2011-04-131-0/+5
| | | | | | | | | | CVE-2011-1677) http://thread.gmane.org/gmane.comp.security.oss.general/4374 Based on CVE-2011-1089. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use fflush() and temporary file for mtab updates (CVE-2011-1089)Karel Zak2011-04-122-28/+29
| | | | | | | | | | | | | | | | | | http://thread.gmane.org/gmane.comp.security.oss.general/4374 Changes: - force mount(8) to use /etc/mtab.tmp file every time. The original code used the tmp file for remount/move operations only. - call and check fflush() return code for the tmp file Note mount(8) blocks all signals when writing to mtab, so it's not affected by SIGXFSZ and the mtab lock file is always removed. This patch does not fix the same issue in umount(8) and libmount. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add note about blank lines to fstab.5Karel Zak2011-04-121-3/+6
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=694648 Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: support non-canonical devnames in mtabKarel Zak2011-04-112-1/+17
| | | | | Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/755193 Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: use helper= for all UIDsKarel Zak2011-04-013-14/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add phelper=Karel Zak2011-03-303-21/+42
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: use UMOUNT_NOFOLLOW for non-root usersKarel Zak2011-03-291-11/+87
| | | | | | The UMOUNT_NOFOLLOW umount2() flag is supported since kernel 2.6.34. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: don't support external (e2fsprogs) libblkidKarel Zak2011-03-161-4/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Revert "umount: call /sbin/umount.<uhelper> for root user too"Karel Zak2011-03-152-16/+21
| | | | This reverts commit c56226697342ddd663492f77768e7a7cb8e579a1.
* umount: call /sbin/umount.<uhelper> for root user tooKarel Zak2011-03-152-21/+16Star
| | | | | | | | | | | | | | | | | Originally the "uhelper=" was ignored for root, now the umount command calls /sbin/umount.<uhelper> always. This change is necessary for things like pam_mount where a device has to be uninitialized by uhelper rather than directly umounted by umount(2). Note that all uhelpers has to be linked with libmount or execute umount -fake -i /mountpoint to remove mountpoint entry from /etc/mtab or /dev/.mount/utab. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: rename "quiet" to "silent" (MS_SILENT)Karel Zak2011-03-113-3/+9
| | | | | | | | | | The quiet mount option was in collision with vfat and hfs mount options. The option was also undocumented -- so it's probably safe to rename the option than add some ugly hacks or exceptions for vfat/hfs to the mount(8) code. Reported-by: https://bugzilla.redhat.com/show_bug.cgi?id=622089 Signed-off-by: Karel Zak <kzak@redhat.com>
* man page syntax fixesVille Skyttä2011-03-071-1/+0Star
| | | | Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
* mount: update mtab on "-f" and compiled with libmountKarel Zak2011-03-071-0/+3
| | | | | Reported-by: silvan minghetti <bu1137@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: segfaults with inconsistent entry in /etc/fstabKarel Zak2011-03-042-1/+4
| | | | | | Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/726283 Reported-by: Greg Brockman <gdb@gregbrockman.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* move struct option to .rodataKarel Zak2011-03-031-1/+2
| | | | | | | It does not make sense to have writable large arrays of "struct option" on the stack. Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: allow unmounting loopdev specified by associated filePetr Uzel2011-02-213-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to unmount a filesystem on a loop device if it is specified by associated backing file. It does not attempt to unmount anything if there are more than one loop device associated with the given file. Umount looks for associated loopdevice(s) only if umount is called with the regular file as an argument. Before: mount -o loop -t ext2 img mnt umount -v img > Could not find /home/puzel/upstream/util-linux/img in mtab > umount: img: not mounted After: mount -o loop -t ext2 img mnt umount -v img > img is associated with /dev/loop0, trying to unmount it > /dev/loop0 has been unmounted [kzak@redhat.com: - fix memory leak in lomount.c] Addresses: https://bugzilla.novell.com/show_bug.cgi?id=666161 Signed-off-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: spelling fixesPetr Uzel2011-02-211-4/+4
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-141-1/+1
| | | | | | | | Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* mount: add rootcontext= for tmpfs on SELinux boxesKarel Zak2011-02-093-3/+33
| | | | | | Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=476964 Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=676100 Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: use EXIT_SUCCESS constantsDavidlohr Bueso2011-02-081-2/+2
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* mount: fix parsing offset= followed by more optionsPetr Uzel2011-01-314-25/+29
| | | | | | | | | | | | | | | | mount does not parse parse offset= option if it is followed by other options. In umount, the parsing is done with the get_value() function. This patch moves get_value to fstab.c (with new name get_option_value()) and fixes mount to use the function. [kzak@redhat.com: - rename to get_option_value() - use fstab.c rather than sundries.c] Novell bugzilla: #666150 Reported-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: make needlessly global variables staticTobias Klauser2011-01-311-9/+9
| | | | | | Also constify the option array. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* mount: fix atime description in mount.8 man pageKarel Zak2011-01-271-2/+5
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=665376 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup API, remove typedefKarel Zak2011-01-224-17/+17
| | | | | | | | - replace mnt_ with libmnt_ prefix for types (the old prefix was too generic) - remove typedef, use struct everywhere - use shorter functions names (s/userspace/user/; s/mountflags/mflags/) Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: rename mount.h to libmount.hKarel Zak2011-01-222-2/+2
| | | | | | The mount.h file name is too generic. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: update ext{3,4} options in mount.8Karel Zak2011-01-211-2/+56
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: call is_loop_autoclear() for all loopdevsKarel Zak2011-01-172-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix reference to cifs-utils in mount.8Karel Zak2011-01-111-1/+1
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=651035 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix gcc warningKarel Zak2011-01-101-4/+4
|
* mount: canonicalize paths in HAVE_LIBMOUNT_MOUNT codeKarel Zak2011-01-101-15/+23
| | | | | Reported-by: silvan minghetti <bu1137@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>