From 1b0ea8c5d886fedabd611a569b5ec58a6f5153e6 Mon Sep 17 00:00:00 2001 From: Joan Bruguera Date: Sat, 18 Feb 2023 21:52:15 +0000 Subject: elf: Restore ldconfig libc6 implicit soname logic [BZ #30125] While cleaning up old libc version support, the deprecated libc4 code was accidentally kept in `implicit_soname`, instead of the libc6 code. This causes additional symlinks to be created by `ldconfig` for libraries without a soname, e.g. a library `libsomething.123.456.789` without a soname will create a `libsomething.123` -> `libsomething.123.456.789` symlink. As the libc6 version of the `implicit_soname` code is a trivial `xstrdup`, just inline it and remove `implicit_soname` altogether. Some further simplification looks possible (e.g. the call to `create_links` looks like a no-op if `soname == NULL`, other than the verbose printfs), but logic is kept as-is for now. Fixes: BZ #30125 Fixes: 8ee878592c4a ("Assume only FLAG_ELF_LIBC6 suport") Signed-off-by: Joan Bruguera Reviewed-by: Adhemerval Zanella --- elf/ldconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'elf/ldconfig.c') diff --git a/elf/ldconfig.c b/elf/ldconfig.c index 3f1b30c..2fc45ad 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c @@ -616,7 +616,7 @@ manual_link (char *library) goto out; } if (soname == NULL) - soname = implicit_soname (libname, flag); + soname = xstrdup (libname); create_links (real_path, path, libname, soname); free (soname); out: @@ -849,7 +849,7 @@ search_dir (const struct dir_entry *entry) } if (soname == NULL) - soname = implicit_soname (direntry->d_name, flag); + soname = xstrdup (direntry->d_name); /* A link may just point to itself. */ if (is_link) -- cgit v1.1