]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: don't canonicalize the source of a pseudofs
authorDave Reisner <d@falconindy.com>
Mon, 26 Dec 2011 23:47:24 +0000 (18:47 -0500)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Jan 2012 13:28:30 +0000 (14:28 +0100)
In line with previous patches, the source of a pseudofs is strictly
semantic; do not attempt to resolve it to a filesystem path.

As a side effect of this, nspec needs to be initialized to NULL since
it may not be assigned null by spec_to_devname when the FS is deemed
a pseudofs.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
mount/mount.c

index a18b2df87d52e8e49bb5ea170d9b2d672d4af650..57c0f597764438dca296f3e068043a279c59331e 100644 (file)
@@ -2033,7 +2033,7 @@ is_existing_file (const char *s) {
 static int
 mount_one (const char *spec, const char *node, const char *types,
           const char *fstabopts, char *cmdlineopts, int freq, int pass) {
-       const char *nspec;
+       const char *nspec = NULL;
        char *opts;
 
        /* Substitute values in opts, if required */
@@ -2063,7 +2063,8 @@ mount_one (const char *spec, const char *node, const char *types,
                              strncmp(types, "nfs", 3) &&
                              strncmp(types, "cifs", 4) &&
                              strncmp(types, "smbfs", 5))) {
-               nspec = spec_to_devname(spec);
+               if (!is_pseudo_fs(types))
+                       nspec = spec_to_devname(spec);
                if (nspec)
                        spec = nspec;
        }