summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2014-01-24 14:38:53 +0200
committerPanu Matilainen <pmatilai@redhat.com>2014-01-24 15:02:39 +0200
commitee5a500fee1b96ab6d4acf091fdc9b8388a80c41 (patch)
tree73f64bb9cd66fe711926d2fb7b925d7688d171b5 /tools
parent89df36524bace71decee4ab4f979d4ffb449c9a7 (diff)
downloadrpm-ee5a500fee1b96ab6d4acf091fdc9b8388a80c41.tar.gz
Filter out garbage sonames from dependencies (ticket #158)
- The original case of empty string ending up in a dependency is already taken care of by commit 66a01c977ea198fb05c5df22013884a6973485c5 and soname filtering. However if filtering is disabled, an an empty (or all-whitespace) soname will produce gems like "()(64bit)" on multilib arches, so we need to sanity check the soname itself in elfdeps. - The linker doesn't seem to care what kind of junk the soname contains, we care just a little bit more as eg empty strings and whitespace messes up other things.
Diffstat (limited to 'tools')
-rw-r--r--tools/elfdeps.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/elfdeps.c b/tools/elfdeps.c
index 8679f89ee..cf22cc6c6 100644
--- a/tools/elfdeps.c
+++ b/tools/elfdeps.c
@@ -48,6 +48,19 @@ static int skipPrivate(const char *s)
*/
static int skipSoname(const char *soname)
{
+ int sane = 0;
+
+ /* Filter out empty and all-whitespace sonames */
+ for (const char *s = soname; *s != '\0'; s++) {
+ if (!risspace(*s)) {
+ sane = 1;
+ break;
+ }
+ }
+
+ if (!sane)
+ return 1;
+
if (filter_soname) {
if (!strstr(soname, ".so"))
return 1;