]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: _PATH_VENDORDIR workaround
authorKarel Zak <kzak@redhat.com>
Tue, 2 Jul 2024 08:39:12 +0000 (10:39 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Jul 2024 08:54:53 +0000 (10:54 +0200)
It appears that certain versions of libeconf do not handle calls to
econf_readDirs() with NULL path. Therefore, let's set the default to
"/usr/etc" if no value is defined by using the "--with-vendordir="
option.

Addresses: https://github.com/util-linux/util-linux/issues/3091
Signed-off-by: Karel Zak <kzak@redhat.com>
include/pathnames.h
lib/logindefs.c
libblkid/src/config.c
meson.build

index 81fa405f63c7fdd19dc25134bdef71dfaffb27cf..de456c53e7a9dfa929af97ff79e421f66c4db0b0 100644 (file)
 /* Maximum number of PIDs system supports */
 #define _PATH_PROC_PIDMAX      "/proc/sys/kernel/pid_max"
 
+/* libeconf default */
+#ifndef _PATH_VENDORDIR
+# define _PATH_VENDORDIR       "/usr/etc"
+#endif
+
 #endif /* PATHNAMES_H */
index 95631223aae45a8d95dc66c2a928e3cb8fbf5e2a..b51e65fdf06e445462ce5abf78d00dcb02179b36 100644 (file)
@@ -255,11 +255,7 @@ static void load_defaults(void)
                free_getlogindefs_data();
 
        error = econf_readDirs(&file,
-#if USE_VENDORDIR
                        _PATH_VENDORDIR,
-#else
-                       NULL,
-#endif
                        "/etc", "login", "defs", "= \t", "#");
 
        if (error)
index 66c1864f0c6f40518ce65246b6688a7a68927909..19c80ea9df36b0a06c6b8b2881a330fed5a84435 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "blkidP.h"
 #include "env.h"
+#include "pathnames.h"
 
 static int parse_evaluate(struct blkid_config *conf, char *s)
 {
@@ -162,11 +163,7 @@ struct blkid_config *blkid_read_config(const char *filename)
                error = econf_readFile(&file, filename, "= \t", "#");
        } else {
                error = econf_readDirs(&file,
-#if USE_VENDORDIR
                                       _PATH_VENDORDIR,
-#else
-                                      NULL,
-#endif
                                       "/etc", "blkid", "conf", "= \t", "#");
        }
 
index a5df66d202495ee51261cd3b692ee64738b9ae5a..e3a2780ad1a18b5b7464806977f54e803a25d5d7 100644 (file)
@@ -79,7 +79,9 @@ conf.set_quoted('_PATH_LOCALSTATEDIR', localstatedir)
 conf.set_quoted('CONFIG_ADJTIME_PATH', '/etc/adjtime')
 conf.set_quoted('ADJTIME_PATH', '/etc/adjtime') # yes, both are used :(
 
-conf.set_quoted('_PATH_VENDORDIR', vendordir)
+if vendordir != ''
+  conf.set_quoted('_PATH_VENDORDIR', vendordir)
+endif
 conf.set('USE_VENDORDIR', vendordir == '' ? false : 1)
 
 build_libblkid = get_option('build-libblkid').allowed()