]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: supports paths canonicalization for alternative fstabs
authorKarel Zak <kzak@redhat.com>
Wed, 24 Oct 2012 21:59:04 +0000 (23:59 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 24 Oct 2012 21:59:04 +0000 (23:59 +0200)
 # mount --fstab /path/my.fstab

has to support standard operations with paths.

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/mount.c

index a6d046ba617faea311c601882c876a1d2406d59c..ed7417788dac7dea9908892c8ca12fd0ec81124d 100644 (file)
@@ -898,6 +898,16 @@ int main(int argc, char **argv)
        argc -= optind;
        argv += optind;
 
+       if (fstab && !mnt_context_is_nocanonicalize(cxt)) {
+               /*
+                * We have external (context independent) fstab instance, let's
+                * make a connection between the fstab and the canonicalization
+                * cache.
+                */
+               struct libmnt_cache *cache = mnt_context_get_cache(cxt);
+               mnt_table_set_cache(fstab, cache);
+       }
+
        if (!mnt_context_get_source(cxt) &&
            !mnt_context_get_target(cxt) &&
            !argc &&