mount: Do not call mnt_pretty_path() on net file systems.

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>
This commit is contained in:
Stanislav Brabec 2019-02-06 00:07:54 +01:00 committed by Karel Zak
parent cc06250f11
commit 8487dbee9f
1 changed files with 1 additions and 1 deletions

View 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));