| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
| |
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=803799
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
This brings search path support to umount to match existing behavior
in fsck and mount.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
| |
It's better to inform users about reason why their request does not
makes sense :-)
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
|
|
|
|
|
|
|
| |
Get rid of the local xmalloc.[c/h] files by using the global xalloc and
strutils libraries.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
The mnt_update_table() is able to create a mtab lock now.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/755193
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
The UMOUNT_NOFOLLOW umount2() flag is supported since kernel 2.6.34.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
This reverts commit c56226697342ddd663492f77768e7a7cb8e579a1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch replaces a few functions used throughout the source:
* Renames getnum (from schedutils) to strtol_or_err
* Moves strtosize (from lib/strtosize.c)
* Moves xstrncpy (from include/xstrncpy.h)
* Adds strnlen, strnchr and strndup if not available (remove it from libmount utils)
A few Makefile.am files were modified to compile accordingly along with trivial renaming
in schedutils source code.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
umount(8) segfaults when update incomplete mtab file after remount to
read-only (-r). For example autofs does not store info about
mountpoint to /etc/mtab file.
# mount /dev/sda1 /mnt/test
# sed -i -e 's:/dev/sda1 .*::g' /etc/mtab
# cd /mnt/test
# umount -r /mnt/test
umount: /mnt/test busy - remounted read-only
Segmentation fault
The command "umount -r" should not care about /etc/mtab if the related
mtab entry does not exist.
Reported-by: Paul Crawford <psc@sat.dundee.ac.uk>
Addresses: https://bugs.launchpad.net/bugs/579858
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux can handle filesystem types with "MAINTYPE.SUBTYPE" format,
where the main type determines the actual filesystem driver while the
subtype can be interpreted by the filesystem itself.
When searching for mount helpers mount(8) and umount(8) should also
interpret such types, falling back to (u)mount.MAINTYPE if
(u)mount.MAINTYPE.SUBTYPE doesn't exist.
This patch implements this, passing the type with "-t TYPE"
to the mount program in this case.
Reported-by: Josef Bacik <josef@redhat.com>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=625064
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
|
|
|
| |
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Fri, May 21, 2010 at 08:00:09AM -0400, Christoph Hellwig wrote:
> On Fri, May 21, 2010 at 01:55:17PM +0200, Petr Uzel wrote:
> > SUSE-based distributions have the following patch for some time. More
> > info here: https://bugzilla.novell.com/show_bug.cgi?id=447036
> >
> > From the Novell bugzilla:
> > <quote>
> > > I cannot see any justification for that sync call at all so I'd
> > > probably just remove it. Your
> > > patch is possibly safer so maybe it should be used as is.
> > </quote>
> >
> > So, does anybody know why/if the sync() is actually needed?
>
> It's not needed. The kernel performs a sync by itself.
Thanks, Christoph.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add --fake option to umount(8), which omits calling the actual umount
syscall (and the loop device deletion) but modifies /etc/mtab. This
is similar to the -f or --fake option to mount(8).
This would allow some simplifications in fuse by allowing it to call
the umount syscall and letting umount(8) just update mtab.
[kzak@redhat.com: - initialize 'res' variable in umount_one() ]
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
Addresses-Suse-Bug: #461732
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
| |
Addresses-Debian-Bug: #320500
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The mount command does not work properly if you replace suid with
POSIX file capabilities. We still need to check for non-root mounts and
the command has to work in very restricted mode for non-root users.
This patch allows you to remove suid bit from mount and umount. Note
that you need a system with filesystem capability support, e.g.
Fedora 10).
# ls -l /bin/mount
-rwxr-xr-x 1 root root 65192 2008-11-09 22:59 /bin/mount
# getcap /bin/mount
/bin/mount = cap_dac_override,cap_sys_admin+ep
[kzak@redhat.com: all the above comments]
Don't bypass security checks when [u]mount uses POSIX file capabilities
rather than setuid root to permit non-root mounts.
Signed-off-by: Geoff Johnstone <geoff.johnstone@googlemail.com>
|
|
|
|
|
|
|
|
|
|
| |
fix:
- don't call canonicalize_spec() for LABELs/UUIDs
- simplify the code
- rename to getfs_by_devdir(), because we use it only for
device names and not for SPECes (see umount.c).
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
No longer checks if mount point has been renamed or removed.
Linux reports EBUSY for these actions, so this check is redundant.
[kzak@redhat.com: - remove the check rather than "#if 0"
- remove unnecessary mnt_err2 stuff]
Signed-off-by: Guan Xin <guanx.bac@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Linux cannot umount a device whose mount point is hidden by subsequent
mount(s). i.e. We must umount the devices associated to a mount point
in the reverse order of when they were mounted. If umount was called
violating this rule, report error and exit.
Signed-off-by: Guan Xin <guanx.bac@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The new loop auto-destruct feature detaches automatically loop devices
when no longer used. This means they are detached with the umount()
call. But when we call umount with -d, del_loop() is called and fails
because the ioctl() returns ENXIO. We have to check for autoclear
loop devices rather than blindly call del_loop().
Reported-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
umount(8) is trying to umount a device two times to prevent some
obscure scenarios. It's maybe a nice feature, but it also produces
duplicate error messages.
# umount /home
umount: /home: device is busy
umount: /home: device is busy
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
This patch adds a hint about lsof and fuser to the "device is busy"
error message.
Addresses-Red-Hat-Bugzilla: #145844
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
* moves error() and die() to sundries.h
* removes at_die
* adds __attribute__ ((__format__ (__printf__ )))
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This patch renames canonicalize() to canonicalize_mountpoint() and
moves this function to realpath.c where is all cannonicalize code.
The canonicalize_mountpoint() function checks for special "none",
"proc", "swap" pseudo mointpoint.
The patch also adds a new generic canonicalize() function.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
* disable to call /sbin/mount.none
* rewrite fstype to "none" for MS_BIND and MS_MOVE
* add notes about "none" to fstab.5 and mount.8
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
{,u}mount calls setuid() and setgid() in the wrong order and doesn't checking
the return value of set{u,g}id(() when running helpers like mount.nfs.
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|