util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mount: Do not call mnt_pretty_path() on net file systems.
@ 2019-02-05 22:57 Stanislav Brabec
  2019-02-05 23:07 ` Stanislav Brabec
  0 siblings, 1 reply; 6+ messages in thread
From: Stanislav Brabec @ 2019-02-05 22:57 UTC (permalink / raw)
  To: util-linux

Calling mnt_pretty_path() on network file systems can cause mangling of
the output:

nfs.example.com:/home on /home type nfs4 ...
/root/nfs.example.com:/home on /home type nfs4 ...

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
---
 sys-utils/mount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index f4a387b8a..b91d4779a 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));
-- 
2.20.1

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@suse.com
Křižíkova 148/34 (Corso IIa)                    tel: +420 284 084 060
186 00 Praha 8-Karlín                          fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-22 18:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 22:57 [PATCH] mount: Do not call mnt_pretty_path() on net file systems Stanislav Brabec
2019-02-05 23:07 ` Stanislav Brabec
2019-02-06 10:58   ` Karel Zak
2019-02-19 15:50     ` Stanislav Brabec
2019-02-22 10:26       ` Karel Zak
2019-02-22 18:39         ` Stanislav Brabec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).