local-ldconfig-multiarch
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Fri, 26 Jan 2018 22:35:29 +0000 (22:35 +0000)
committerAurelien Jarno <aurel32@debian.org>
Fri, 26 Jan 2018 22:35:29 +0000 (22:35 +0000)
Gbp-Pq: Topic any
Gbp-Pq: Name local-ldconfig-multiarch.diff

elf/ldconfig.c

index f335bb4a9356c7d2c51e83fb4d90331c16986451..4a355ce7b9816ef53f35def4fd56b07a730e33e0 100644 (file)
 #define PATH_MAX 1024
 #endif
 
+/* Get the generated information about the trusted/standard directories.  */
+#include "trusted-dirs.h"
+
+static const char system_dirs[] = SYSTEM_DIRS;
+static const size_t system_dirs_len[] =
+{
+  SYSTEM_DIRS_LEN
+};
+#define nsystem_dirs_len \
+  (sizeof (system_dirs_len) / sizeof (system_dirs_len[0]))
+
 static const struct
 {
   const char *name;
@@ -1393,12 +1404,19 @@ main (int argc, char **argv)
 
   if (!opt_only_cline)
     {
+      const char *strp = system_dirs;
+      size_t idx = 0;
+
       parse_conf (config_file, true);
 
       /* Always add the standard search paths.  */
-      add_system_dir (SLIBDIR);
-      if (strcmp (SLIBDIR, LIBDIR))
-       add_system_dir (LIBDIR);
+      do
+        {
+          add_system_dir (strp);
+          strp += system_dirs_len[idx] + 1;
+          idx++;
+        }
+      while (idx < nsystem_dirs_len);
     }
 
   const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;