From e778642a9eb96975fcf3baa61dfa10add628af1a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 14 Apr 2016 14:26:54 +0200 Subject: libmount: don't support /etc/mtab by default The file mtab is evil and already unused by mainstream distributions. Now libmount is able to detect mtab->/proc/mounts and use /proc/self/mountinfo if necessary. This heuristic seems overkill in many cases. It's also dangerous on systems where mountinfo is strongly required (systemd based distros). This patch #ifdefs mtab code and forces libmount to always use /proc/self/mountinfo. The new configure option --enable-libmount-support-mtab is necessary to enable old behavior to support mtab. Signed-off-by: Karel Zak --- libmount/src/tab_update.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libmount/src/tab_update.c') diff --git a/libmount/src/tab_update.c b/libmount/src/tab_update.c index 631e1cd9f..d85cb89da 100644 --- a/libmount/src/tab_update.c +++ b/libmount/src/tab_update.c @@ -105,7 +105,9 @@ int mnt_update_set_filename(struct libmnt_update *upd, const char *filename, /* detect tab filename -- /etc/mtab or /run/mount/utab */ +#ifdef USE_LIBMOUNT_SUPPORT_MTAB mnt_has_regular_mtab(&path, &rw); +#endif if (!rw) { path = NULL; mnt_has_regular_utab(&path, &rw); -- cgit v1.2.3-55-g7522