From: Stanislav Brabec Date: Tue, 5 Feb 2019 23:07:54 +0000 (+0100) Subject: mount: Do not call mnt_pretty_path() on net file systems. X-Git-Tag: v2.33.2~26 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Futil-linux.git;a=commitdiff_plain;h=4f437ada0bc4a3af1d6636a924a7b15eead3b567 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 --- diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 5e139e8969..aebcf261e3 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -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));