diff options
author | Karel Zak | 2010-11-25 23:22:53 +0100 |
---|---|---|
committer | Karel Zak | 2011-01-03 12:28:46 +0100 |
commit | dd36965211907fd482db8966938334ede5ece089 (patch) | |
tree | d322bf4e93ad4a5dcec704b863c1b7bdf406c9cd /shlibs/mount/src/context_umount.c | |
parent | libmount: fix utab file and dir modes, add new debug messages (diff) | |
download | kernel-qcow2-util-linux-dd36965211907fd482db8966938334ede5ece089.tar.gz kernel-qcow2-util-linux-dd36965211907fd482db8966938334ede5ece089.tar.xz kernel-qcow2-util-linux-dd36965211907fd482db8966938334ede5ece089.zip |
libmount: use better format for utab, improve bind mounts
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/context_umount.c')
-rw-r--r-- | shlibs/mount/src/context_umount.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/shlibs/mount/src/context_umount.c b/shlibs/mount/src/context_umount.c index 00bad1091..7cb4a2a44 100644 --- a/shlibs/mount/src/context_umount.c +++ b/shlibs/mount/src/context_umount.c @@ -83,7 +83,10 @@ static int lookup_umount_fs(mnt_context *cxt) rc = mnt_fs_set_fstype(cxt->fs, mnt_fs_get_fstype(fs)); if (!rc) rc = mnt_fs_set_optstr(cxt->fs, mnt_fs_get_optstr(fs)); + if (!rc && mnt_fs_get_bindsrc(fs)) + rc = mnt_fs_set_bindsrc(cxt->fs, mnt_fs_get_bindsrc(fs)); + DBG(CXT, mnt_debug_h(cxt, "umount: mtab applied")); cxt->flags |= MNT_FL_TAB_APPLIED; return rc; } @@ -150,6 +153,8 @@ static int evaluate_permissions(mnt_context *cxt) if (!mnt_context_is_restricted(cxt)) return 0; /* superuser mount */ + DBG(CXT, mnt_debug_h(cxt, "umount: evaluating permissions")); + if (!(cxt->flags & MNT_FL_TAB_APPLIED)) { DBG(CXT, mnt_debug_h(cxt, "cannot found %s in mtab and you are not root", @@ -187,6 +192,12 @@ static int evaluate_permissions(mnt_context *cxt) tgt = mnt_fs_get_target(cxt->fs); src = mnt_fs_get_source(cxt->fs); + if (mnt_fs_get_bindsrc(cxt->fs)) { + src = mnt_fs_get_bindsrc(cxt->fs); + DBG(CXT, mnt_debug_h(cxt, + "umount: using bind source: %s", src)); + } + /* If fstab contains the two lines * /dev/sda1 /mnt/zip auto user,noauto 0 0 * /dev/sda4 /mnt/zip auto user,noauto 0 0 |