summaryrefslogtreecommitdiffstats
path: root/mount/fsprobe.c
diff options
context:
space:
mode:
authorKarel Zak2008-12-13 02:47:42 +0100
committerKarel Zak2008-12-19 12:45:20 +0100
commitf1b3f066f7cbeee0864317fb85e8bb622da34917 (patch)
treec682fcede20aefe890bba26a2f102595073b729b /mount/fsprobe.c
parentfdisk: remove unnecessary gettext call (diff)
downloadkernel-qcow2-util-linux-f1b3f066f7cbeee0864317fb85e8bb622da34917.tar.gz
kernel-qcow2-util-linux-f1b3f066f7cbeee0864317fb85e8bb622da34917.tar.xz
kernel-qcow2-util-linux-f1b3f066f7cbeee0864317fb85e8bb622da34917.zip
mount: clean up SPEC canonicalization
The SPEC (fsname) field in fstab/mtab could be: - devname - NAME=value (e.g LABEL, UUID) - directory (MS_MOVE, MS_BIND, ..) - pseudo-fs keyword (tmpfs, proc, sysfs, ...) the pseudo-fs keywords shouldn't be canonicalized to absolute path. It means we have to differ between SPEC and mountpoint (fs_dir). Unfortunately, the keywords was checked on wrong place. This patch move this check to the new function canonicalize_spec(). The fsname in mtab entry is canonicalized when the FS type is not pseudo filesystem. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/fsprobe.c')
-rw-r--r--mount/fsprobe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mount/fsprobe.c b/mount/fsprobe.c
index 96548647c..07ffbd9ab 100644
--- a/mount/fsprobe.c
+++ b/mount/fsprobe.c
@@ -170,6 +170,9 @@ fsprobe_get_devname_for_mounting(const char *spec)
if (!spec)
return NULL;
+ if (is_pseudo_fs(spec))
+ return xstrdup(spec);
+
if (parse_spec(spec, &name, &value) != 0)
return NULL; /* parse error */
@@ -203,6 +206,8 @@ fsprobe_get_devname(const char *spec)
if (!spec)
return NULL;
+ if (is_pseudo_fs(spec))
+ return xstrdup(spec);
if (parse_spec(spec, &name, &value) != 0)
return NULL; /* parse error */