Package: extract
Version: 1:0.6.3-4
Severity: important
Tags: upstream patch
Dear Maintainer,
The extract command is currently unusable in Debian amd64.
Every plugin loaded fails with this sort of error message:
>Resolving symbol
>`EXTRACTOR_64-linux-gnu/libextractor/libextractor_elf_extract' failed,
>so I tried `_EXTRACTOR_64-linux-gnu/libextractor/libextractor_elf_extract',
>but that failed also.
>Errors are: `/usr/lib/x86_64-linux-gnu/libextractor/libextractor_elf.so:
>undefined symbol:
>EXTRACTOR_64-linux-gnu/libextractor/libextractor_elf_extract' and
>`/usr/lib/x86_64-linux-gnu/libextractor/libextractor_elf.so: undefined symbol:
>_EXTRACTOR_64-linux-gnu/libextractor/libextractor_elf_extract'.
>Resolving `extract' method of plugin `elf' failed: (null)
>Plugin `elf' failed to load!
The plugins are stored in /usr/lib/x86_64-linux-gnu/libextractor/ on my system.
The program parses the .so name to derive the extract function symbol name,
and is confused by the _ in the lib path.
I have modified the source to search for the last _ in the .so filename instead
of the first.
The first patch is against Debian's 0.6.3-4 as retrieved by apt-get source.
The second patch is against upstream HEAD (currently rev21634) which has
re-arranged the code a bit.
These patches are untested as I am having trouble building a working binary
(vanilla or modified) but as you can see the changes are fairly minor.
Regards,
Harun Trefry
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-2-amd64 (SMP w/3 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages extract depends on:
ii dpkg 1.16.3
ii install-info 4.13a.dfsg.1-10
ii libc6 2.13-32
ii libextractor-plugins 1:0.6.3-4
ii libextractor3 1:0.6.3-4
extract recommends no packages.
extract suggests no packages.
-- no debconf information
diff -r -u libextractor-0.6.3/src/main/extractor.c mine/src/main/extractor.c
--- libextractor-0.6.3/src/main/extractor.c 2011-11-28 17:52:27.000000000 +0800
+++ mine/src/main/extractor.c 2012-05-29 23:30:12.772916677 +0800
@@ -691,14 +691,14 @@
const char *(*opt_fun)(void);
if (NULL != options) *options = NULL;
- sym_name = strstr (prefix, "_");
+ sym_name = strrchr (prefix, '_');
if (sym_name == NULL)
return NULL;
sym_name++;
sym = strdup (sym_name);
if (sym == NULL)
return NULL;
- dot = strstr (sym, ".");
+ dot = strchr (sym, '.');
if (dot != NULL)
*dot = '\0';
name = malloc(strlen(sym) + strlen(template) + 1);
Index: extractor_plugins.c
===================================================================
--- extractor_plugins.c (revision 21634)
+++ extractor_plugins.c (working copy)
@@ -71,14 +71,14 @@
const char *(*opt_fun)(void);
if (NULL != options) *options = NULL;
- sym_name = strstr (prefix, "_");
+ sym_name = strrchr (prefix, '_');
if (sym_name == NULL)
return NULL;
sym_name++;
sym = strdup (sym_name);
if (sym == NULL)
return NULL;
- dot = strstr (sym, ".");
+ dot = strchr (sym, '.');
if (dot != NULL)
*dot = '\0';
name = malloc(strlen(sym) + strlen(template) + 1);
Index: extractor_plugpath.c
===================================================================
--- extractor_plugpath.c (revision 21634)
+++ extractor_plugpath.c (working copy)
@@ -407,7 +407,7 @@
if ( (NULL != (la = strstr (ent->d_name, ".la"))) &&
(la[3] == '\0') )
continue; /* only load '.so' and '.dll' */
- sym_name = strstr (ent->d_name, "_");
+ sym_name = strrchr (ent->d_name, '_');
if (sym_name == NULL)
continue;
sym_name++;
@@ -417,7 +417,7 @@
CLOSEDIR (dir);
return;
}
- dot = strstr (sym, ".");
+ dot = strchr (sym, '.');
if (dot != NULL)
*dot = '\0';
if (0 == strcmp (sym, sc->short_name))
@@ -491,7 +491,7 @@
(la[2] == '\0')) )
continue; /* only load '.so' and '.dll' */
- sym_name = strstr (ent->d_name, "_");
+ sym_name = strrchr (ent->d_name, '_');
if (sym_name == NULL)
continue;
sym_name++;
@@ -501,7 +501,7 @@
closedir (dir);
return;
}
- dot = strstr (sym, ".");
+ dot = strchr (sym, '.');
if (dot != NULL)
*dot = '\0';
#if DEBUG > 1