3
0
forked from pool/util-linux
util-linux/mount-new-improve-error-messages.patch
Stephan Kulow aa19c628f4 Accepting request 125114 from Base:System
- improve error messages from new mount (bnc#767208)
 - backport patches from upstream git:
  - mount-new-add-loopdev-specific-error-message.patch
  - mount-new-use-MNT_ERR-for-error-messages.patch
  - libmount-add-special-MNT_ERR-codes.patch
  - mount-new-improve-error-messages.patch
  - libmount-add-MNT_ERR_LOOPDEV.patch

- fix automount with quota (rh#825836)
  - mount-new-allow-sloppy-for-non-root.patch
- fix wrong mount options for CIFS mounts (bnc#766157)
  - libmount-don-t-use-nosuid-noexec-nodev-for-cifs-user.patch

OBS-URL: https://build.opensuse.org/request/show/125114
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=149
2012-06-16 05:24:42 +00:00

47 lines
1.5 KiB
Diff

From 58f108ef2b9c8cc0362e7781a72e5e921dc383b3 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 17 Apr 2012 11:36:36 +0200
Subject: [PATCH] mount: (new) improve error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
---
sys-utils/mount.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
Index: util-linux-2.21.2/sys-utils/mount.c
===================================================================
--- util-linux-2.21.2.orig/sys-utils/mount.c
+++ util-linux-2.21.2/sys-utils/mount.c
@@ -367,16 +367,13 @@ try_readonly:
return MOUNT_EX_USAGE;
}
- /*
- * TODO: add mnt_context_fstab_applied() to check if we found
- * target/source in the file.
- */
- if (!tgt) {
- if (mflags & MS_REMOUNT)
- warnx(_("%s not mounted"), src ? src : tgt);
- else
+ if (!tgt || (!src && !(mflags & MS_PROPAGATION))) {
+ if (!mnt_context_fstab_applied(cxt))
warnx(_("can't find %s in %s"), src ? src : tgt,
mnt_get_fstab_path());
+ else if (mflags & MS_REMOUNT)
+ warnx(_("%s not mounted"), src ? src : tgt);
+
return MOUNT_EX_USAGE;
}
@@ -485,6 +482,8 @@ try_readonly:
case EINVAL:
if (mflags & MS_REMOUNT)
warnx(_("%s not mounted or bad option"), tgt);
+ else if (mflags & MS_PROPAGATION)
+ warnx(_("%s is not mountpoint or bad option"), tgt);
else
warnx(_("wrong fs type, bad option, bad superblock on %s,\n"
" missing codepage or helper program, or other error"),