]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: remove support for obsolete /dev/.mount/utab
authorKarel Zak <kzak@redhat.com>
Thu, 12 Aug 2021 08:44:03 +0000 (10:44 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 12 Aug 2021 08:44:03 +0000 (10:44 +0200)
The default is /run/mount/utab for years.

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/mountP.h
libmount/src/utils.c

index 02e6d6dc3c2134af9897d04fc31358da13226ff7..a2b74b372b10dceb000b3a2b105d2c5aea254fea 100644 (file)
@@ -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"
 
index 93a88e6ad2a2e6b769d5411385f9c1ae1e6c2b3f..7da7a5093b0dbb17796d73ad853dda21cc444c20 100644 (file)
@@ -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;
 }