summaryrefslogtreecommitdiffstats
path: root/mount/mount.c
diff options
context:
space:
mode:
authorKarel Zak2007-10-04 15:07:30 +0200
committerKarel Zak2007-10-04 15:07:30 +0200
commitf92dc20fcb9bb9f15ac95e0e3d6ae96ecfb59619 (patch)
treef7db2d29d6abe5c56a61e77e2e5de1434ba37f20 /mount/mount.c
parentrtcwake: fix verbose message (diff)
downloadkernel-qcow2-util-linux-f92dc20fcb9bb9f15ac95e0e3d6ae96ecfb59619.tar.gz
kernel-qcow2-util-linux-f92dc20fcb9bb9f15ac95e0e3d6ae96ecfb59619.tar.xz
kernel-qcow2-util-linux-f92dc20fcb9bb9f15ac95e0e3d6ae96ecfb59619.zip
mount: cleanup "none" fstype usage
* 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>
Diffstat (limited to 'mount/mount.c')
-rw-r--r--mount/mount.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mount/mount.c b/mount/mount.c
index 5bc2b30c3..2e458cad0 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -624,7 +624,10 @@ check_special_mountprog(const char *spec, const char *node, const char *type, in
if (!external_allowed)
return 0;
- if (type && strlen(type) < 100) {
+ if (type == NULL || strcmp(type, "none") == 0)
+ return 0;
+
+ if (strlen(type) < 100) {
sprintf(mountprog, "/sbin/mount.%s", type);
if (stat(mountprog, &statbuf) == 0) {
if (verbose)
@@ -719,8 +722,8 @@ guess_fstype_and_mount(const char *spec, const char *node, const char **types,
if (*types && strcasecmp (*types, "auto") == 0)
*types = NULL;
- if (!*types && (flags & (MS_BIND | MS_MOVE)))
- *types = "none"; /* random, but not "bind" */
+ if (flags & (MS_BIND | MS_MOVE))
+ *types = "none";
if (!*types && !(flags & MS_REMOUNT)) {
*types = guess_fstype_by_devname(spec);