Source: libnids
Version: 1.23-2
Severity: serious
Tags: patch

Hi,

After being rebuilt with a recent toolchain, attempting to link against
libnids gives the error:
> /usr/lib/libnids.so: undefined reference to `before'
> /usr/lib/libnids.so: undefined reference to `after'

Notably mips64el already contains a broken binary in the archive as can
be seen from this build log of dsniff:
https://buildd.debian.org/status/fetch.php?pkg=dsniff&arch=mips64el&ver=2.4b1%2Bdebian-23&stamp=1487505250&raw=0

powerpcspe and ppc64 also seem to be broken.

A patch to fix this was already applied to the package in Ubuntu and
I've attached it for convenience.

Thanks,
James
diff -Nru libnids-1.23/debian/changelog libnids-1.23/debian/changelog
--- libnids-1.23/debian/changelog	2010-07-21 19:23:34.000000000 +0000
+++ libnids-1.23/debian/changelog	2015-12-06 06:16:57.000000000 +0000
@@ -1,3 +1,11 @@
+libnids (1.23-2ubuntu1) xenial; urgency=medium
+
+  * debian/patches/before-after.patch: Fix declarations of before and after
+    functions so that they are defined in util.h, fixing undefined references
+    in libnibs.so.
+
+ -- Logan Rosen <lo...@ubuntu.com>  Sun, 06 Dec 2015 01:16:24 -0500
+
 libnids (1.23-2) unstable; urgency=high
 
   * Update my email address (closes: #574042).
diff -Nru libnids-1.23/debian/control libnids-1.23/debian/control
--- libnids-1.23/debian/control	2010-07-21 00:14:44.000000000 +0000
+++ libnids-1.23/debian/control	2015-12-06 06:16:58.000000000 +0000
@@ -1,7 +1,8 @@
 Source: libnids
 Section: libdevel
 Priority: optional
-Maintainer: Vasilis Pappas <vpap...@gmail.com>
+Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
+XSBC-Original-Maintainer: Vasilis Pappas <vpap...@gmail.com>
 Build-Depends: libpcap0.8-dev, libnet1-dev (>= 1.1.2.1), debhelper (>= 5), autotools-dev, pkg-config, libglib2.0-dev
 Standards-Version: 3.9.0
 
diff -Nru libnids-1.23/debian/patches/before-after.patch libnids-1.23/debian/patches/before-after.patch
--- libnids-1.23/debian/patches/before-after.patch	1970-01-01 00:00:00.000000000 +0000
+++ libnids-1.23/debian/patches/before-after.patch	2015-12-06 06:16:16.000000000 +0000
@@ -0,0 +1,52 @@
+Description: fix before and after declarations
+ Fix declarations of before and after functions so that they just happen in the header file to fix undefined references in libnids.so.
+Origin: upstream, http://downloads.sourceforge.net/project/libnids/libnids/1.24/libnids-1.24.tar.gz
+Forwarded: no
+Applied-Upstream: 1.24
+Last-Update: 2015-12-06
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/util.c
++++ b/src/util.c
+@@ -29,18 +29,6 @@
+   return ret;
+ }
+ 
+-inline int
+-before(u_int seq1, u_int seq2)
+-{
+-  return ((int)(seq1 - seq2) < 0);
+-}
+-
+-inline int
+-after(u_int seq1, u_int seq2)
+-{
+-  return ((int)(seq2 - seq1) < 0);
+-}
+-
+ void
+ register_callback(struct proc_node **procs, void (*x))
+ {
+--- a/src/util.h
++++ b/src/util.h
+@@ -23,8 +23,18 @@
+ 
+ void nids_no_mem(char *);
+ char *test_malloc(int);
+-inline int before(u_int seq1, u_int seq2);
+-inline int after(u_int seq1, u_int seq2);
++
++static inline int
++before(u_int seq1, u_int seq2)
++{
++  return ((int)(seq1 - seq2) < 0);
++}
++
++static inline int
++after(u_int seq1, u_int seq2)
++{
++  return ((int)(seq2 - seq1) < 0);
++}
+ void register_callback(struct proc_node **procs, void (*x));
+ void unregister_callback(struct proc_node **procs, void (*x));
+ 
diff -Nru libnids-1.23/debian/patches/series libnids-1.23/debian/patches/series
--- libnids-1.23/debian/patches/series	2010-07-21 00:13:10.000000000 +0000
+++ libnids-1.23/debian/patches/series	2015-12-06 06:11:40.000000000 +0000
@@ -1 +1,2 @@
 debian-changes-1.23-2
+before-after.patch

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to