From: Ian Kent Date: Mon, 13 Mar 2023 01:43:02 +0000 (+0800) Subject: mount: ignore autofs entries in mount listing X-Git-Tag: v2.39-rc2~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9004e76b4ba716022a7c851ffa7fbd9e9e4bf073;p=thirdparty%2Futil-linux.git mount: ignore autofs entries in mount listing Since we can't enable use of ignoring autofs mounts that have the "ignore" option present by default (systemd could get confused) it's necessary to enable it for individual applications. The mount utility is one applcation we need it for so enable it. Signed-off-by: Ian Kent Cc: John Westerdale Cc: Frank Hertz Cc: Frank Sorenson --- diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 6590272c7d..dba6fcae92 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -124,6 +124,8 @@ static void print_all(struct libmnt_context *cxt, char *pattern, int show_label) struct libmnt_fs *fs; struct libmnt_cache *cache = NULL; + mnt_context_enable_noautofs(cxt, 1); + if (mnt_context_get_mtab(cxt, &tb)) err(MNT_EX_SYSERR, _("failed to read mtab"));