]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: Do not call mnt_pretty_path() on net file systems.
authorStanislav Brabec <sbrabec@suse.cz>
Tue, 5 Feb 2019 23:07:54 +0000 (00:07 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 6 Feb 2019 10:56:47 +0000 (11:56 +0100)
Calling mnt_pretty_path() on network file systems can cause mangling of
the output:
root# mount | grep nfs
nfs.example.com:/home on /home type nfs4 ...
root# mkdir -p nfs.example.com:/home
root# mount | grep nfs
/root/nfs.example.com:/home on /home type nfs4 ...

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
sys-utils/mount.c

index f4a387b8a21af7a66c517a5dd3f70c230c1b1fe9..b91d4779a71d26dbc32de9dca39673e65c846570 100644 (file)
@@ -143,7 +143,7 @@ static void print_all(struct libmnt_context *cxt, char *pattern, int show_label)
                if (type && pattern && !mnt_match_fstype(type, pattern))
                        continue;
 
-               if (!mnt_fs_is_pseudofs(fs))
+               if (!mnt_fs_is_pseudofs(fs) && !mnt_fs_is_netfs(fs))
                        xsrc = mnt_pretty_path(src, cache);
                printf ("%s on ", xsrc ? xsrc : src);
                safe_fputs(mnt_fs_get_target(fs));