From f8ccd659560d9fc12ecc1eff7f47f9bbd50565f0 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 12 Aug 2021 10:44:03 +0200 Subject: [PATCH] libmount: remove support for obsolete /dev/.mount/utab The default is /run/mount/utab for years. Signed-off-by: Karel Zak --- libmount/src/mountP.h | 2 -- libmount/src/utils.c | 12 ++---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index 02e6d6dc3c..a2b74b372b 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -76,10 +76,8 @@ UL_DEBUG_DECLARE_MASK(libmount); /* library private paths */ #define MNT_TMPDIR "/tmp/mount" #define MNT_RUNTIME_TOPDIR "/run" -#define MNT_RUNTIME_TOPDIR_OLD "/dev" #define MNT_PATH_UTAB MNT_RUNTIME_TOPDIR "/mount/utab" -#define MNT_PATH_UTAB_OLD MNT_RUNTIME_TOPDIR_OLD "/.mount/utab" #define MNT_UTAB_HEADER "# libmount utab file\n" diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 93a88e6ad2..7da7a5093b 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -858,20 +858,12 @@ const char *mnt_get_mtab_path(void) /* * Don't export this to libmount API -- utab is private library stuff. * - * Returns: path to /run/mount/utab (or /dev/.mount/utab) or $LIBMOUNT_UTAB. + * Returns: path to /run/mount/utab or $LIBMOUNT_UTAB. */ const char *mnt_get_utab_path(void) { - struct stat st; const char *p = safe_getenv("LIBMOUNT_UTAB"); - - if (p) - return p; - - if (stat(MNT_RUNTIME_TOPDIR, &st) == 0) - return MNT_PATH_UTAB; - - return MNT_PATH_UTAB_OLD; + return p ? : MNT_PATH_UTAB; } -- 2.47.2