util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Brabec <sbrabec@suse.cz>
To: util-linux@vger.kernel.org
Subject: [PATCH] mount: Do not call mnt_pretty_path() on net file systems.
Date: Tue, 5 Feb 2019 23:57:10 +0100	[thread overview]
Message-ID: <8a0a088e-2ed7-9233-438a-6fb04f08046f@suse.cz> (raw)

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

             reply	other threads:[~2019-02-05 22:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 22:57 Stanislav Brabec [this message]
2019-02-05 23:07 ` [PATCH] mount: Do not call mnt_pretty_path() on net file systems 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a0a088e-2ed7-9233-438a-6fb04f08046f@suse.cz \
    --to=sbrabec@suse.cz \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).