summary refs log tree commit diff
path: root/elf/ldconfig.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-03-07 22:06:18 +0100
committerFlorian Weimer <fweimer@redhat.com>2016-03-07 22:06:18 +0100
commit920b35c92ed8f41796c090c2819434e56701da5b (patch)
tree547f2a768b3468145c0def879950bd643ab36752 /elf/ldconfig.c
parent515b0760fa1cc7f4ec6d1e96d265105bf8481fe0 (diff)
downloadglibc-920b35c92ed8f41796c090c2819434e56701da5b.tar.gz
glibc-920b35c92ed8f41796c090c2819434e56701da5b.tar.xz
glibc-920b35c92ed8f41796c090c2819434e56701da5b.zip
ldconfig: Do not remove stale symbolic links with -X [BZ #19610]
Diffstat (limited to 'elf/ldconfig.c')
-rw-r--r--elf/ldconfig.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 9c6f2ba791..467ca8266a 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -100,7 +100,8 @@ int opt_format = 1;
 /* Build cache.  */
 static int opt_build_cache = 1;
 
-/* Generate links.  */
+/* Enable symbolic link processing.  If set, create or update symbolic
+   links, and remove stale symbolic links.  */
 static int opt_link = 1;
 
 /* Only process directories specified on the command line.  */
@@ -141,7 +142,7 @@ static const struct argp_option options[] =
   { "print-cache", 'p', NULL, 0, N_("Print cache"), 0},
   { "verbose", 'v', NULL, 0, N_("Generate verbose messages"), 0},
   { NULL, 'N', NULL, 0, N_("Don't build cache"), 0},
-  { NULL, 'X', NULL, 0, N_("Don't generate links"), 0},
+  { NULL, 'X', NULL, 0, N_("Don't update symbolic links"), 0},
   { NULL, 'r', N_("ROOT"), 0, N_("Change to and use ROOT as root directory"), 0},
   { NULL, 'C', N_("CACHE"), 0, N_("Use CACHE as cache file"), 0},
   { NULL, 'f', N_("CONF"), 0, N_("Use CONF as configuration file"), 0},
@@ -800,7 +801,7 @@ search_dir (const struct dir_entry *entry)
 		error (0, errno, _("Cannot stat %s"), file_name);
 
 	      /* Remove stale symlinks.  */
-	      if (strstr (direntry->d_name, ".so."))
+	      if (opt_link && strstr (direntry->d_name, ".so."))
 		unlink (real_file_name);
 	      continue;
 	    }