summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/context.c
diff options
context:
space:
mode:
authorKarel Zak2010-11-23 20:39:55 +0100
committerKarel Zak2011-01-03 12:28:46 +0100
commitb0bb8fb6f9c3d54d230b785695a5bceab7e3f320 (patch)
tree967b3095dab666a892f40271598dd359dfd5fc12 /shlibs/mount/src/context.c
parenttests: improve libmount context mount and umount test (diff)
downloadkernel-qcow2-util-linux-b0bb8fb6f9c3d54d230b785695a5bceab7e3f320.tar.gz
kernel-qcow2-util-linux-b0bb8fb6f9c3d54d230b785695a5bceab7e3f320.tar.xz
kernel-qcow2-util-linux-b0bb8fb6f9c3d54d230b785695a5bceab7e3f320.zip
libmount: fix utab file and dir modes, add new debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/context.c')
-rw-r--r--shlibs/mount/src/context.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/shlibs/mount/src/context.c b/shlibs/mount/src/context.c
index 2cc76a0ad..6ee68c16a 100644
--- a/shlibs/mount/src/context.c
+++ b/shlibs/mount/src/context.c
@@ -46,7 +46,7 @@ mnt_context *mnt_new_context()
if (!cxt->mtab_writable)
/* use /dev/.mount/utab if /etc/mtab is useless */
- mnt_has_regular_mtab(&cxt->utab_path, &cxt->utab_writable);
+ mnt_has_regular_utab(&cxt->utab_path, &cxt->utab_writable);
return cxt;
}
@@ -1054,11 +1054,18 @@ int mnt_context_prepare_update(mnt_context *cxt)
/* Don't try to touch mtab if umounting root FS */
cxt->flags |= MNT_FL_NOMTAB;
- if ((cxt->flags & MNT_FL_NOMTAB) || cxt->helper)
+ if (cxt->flags & MNT_FL_NOMTAB) {
+ DBG(CXT, mnt_debug_h(cxt, "skip update: NOMTAB flag"));
return 0;
- if (!cxt->mtab_writable && !cxt->utab_writable)
+ }
+ if (cxt->helper) {
+ DBG(CXT, mnt_debug_h(cxt, "skip update: external helper"));
return 0;
-
+ }
+ if (!cxt->mtab_writable && !cxt->utab_writable) {
+ DBG(CXT, mnt_debug_h(cxt, "skip update: no writable destination"));
+ return 0;
+ }
if (!cxt->update) {
cxt->update = mnt_new_update(!cxt->mtab_writable);
if (!cxt->update)
@@ -1386,6 +1393,9 @@ int main(int argc, char *argv[])
{ "--umount", test_umount, "[-t <type>] [-f][-l][-r] <src>|<target>" },
{ NULL }};
+
+ umask(S_IWGRP|S_IWOTH); /* to be compatible with mount(8) */
+
return mnt_run_test(tss, argc, argv);
}