Package: wmaloader
Followup-For: Bug #722866

I see you've had a successful mips64el build since.  However the attached
patch fixes this problem the proper way by making wmaloader use libupnp's
pkgconfig to find the libraries your build was missing.

This debdiff is worth applying for all architectures to aid in any NMU
at some point, if anyone is reading:

+  * Use pkg-config to find libupnp (Closes: #722866)
+  * Fix warnings due to missing headers or wrong declarations.
+  * Add ${misc:Depends} to debian/control (raised by Lintian)
+  * Apply hardening flags and fix resulting build errors

Nick  (libupnp maintainer)
diff -u wmaloader-0.1/Makefile wmaloader-0.1/Makefile
--- wmaloader-0.1/Makefile
+++ wmaloader-0.1/Makefile
@@ -15,19 +15,15 @@
 # along with wmaloader; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
 
 # Where to install binary
 DEST=/usr/sbin
 
-# Path to uPnP include files
-UPNP_INC=/usr/include/upnp
-
-# Path to uPnP libraries
-UPNP_LIBS=/usr/lib
-
 CC=gcc
-LDFLAGS=-lpthread -lixml -lupnp -lthreadutil -L$(UPNP_LIBS)
-CFLAGS=-Wall -O2 -I$(UPNP_INC) $(LIBS) -D_REENTRANT
+LDFLAGS += $(shell pkg-config --libs libupnp)
+CFLAGS  += -Wall $(shell pkg-config --cflags libupnp) -D_REENTRANT
 
 TARGET=wmaloader
 OBJS=wmaloader.o image_transfer.o common.o
diff -u wmaloader-0.1/wmaloader.c wmaloader-0.1/wmaloader.c
--- wmaloader-0.1/wmaloader.c
+++ wmaloader-0.1/wmaloader.c
@@ -28,6 +28,7 @@
 #include <semaphore.h>
 #include <getopt.h>
 #include <stdarg.h>
+#include <string.h>
 
 /* upnp library */
 #include "upnp.h"
@@ -151,7 +152,7 @@
   else{
 	int do_boot = TRUE;
 	
-	char *state = ixmlNode_getNodeValue
+	const char *state = ixmlNode_getNodeValue
 	  (ixmlNode_getFirstChild
 	   (ixmlNodeList_item
 		(ixmlElement_getElementsByTagName
diff -u wmaloader-0.1/image_transfer.c wmaloader-0.1/image_transfer.c
--- wmaloader-0.1/image_transfer.c
+++ wmaloader-0.1/image_transfer.c
@@ -47,7 +47,7 @@
   /* Initialise socket. Return true for success, false for
 	 failure. */
 
-  int len;
+  socklen_t len;
 
   /* Save file name of source file */
   source = source_file;
@@ -116,7 +116,7 @@
   /* Internal use only */
   
   struct sockaddr_in addr; // socket address IPV4
-  int len = sizeof(struct sockaddr_in);
+  socklen_t len = sizeof(struct sockaddr_in);
   int new_socket;
   int temp_fd;
 
diff -u wmaloader-0.1/debian/rules wmaloader-0.1/debian/rules
--- wmaloader-0.1/debian/rules
+++ wmaloader-0.1/debian/rules
@@ -5,6 +5,8 @@
 # Uncomment this to turn on verbose mode. 
 # export DH_VERBOSE=0
 
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
 build: 
 	$(MAKE)
 
diff -u wmaloader-0.1/debian/control wmaloader-0.1/debian/control
--- wmaloader-0.1/debian/control
+++ wmaloader-0.1/debian/control
@@ -2,13 +2,13 @@
 Section: net
 Priority: extra
 Maintainer: Steve McIntyre <93...@debian.org>
-Build-Depends: libupnp-dev, debhelper (>= 5.0.0)
+Build-Depends: libupnp-dev, debhelper (>= 5.0.0), hardening-includes, pkg-config
 Standards-Version: 3.8.2.0
 
 Package: wmaloader
 Priority: extra
 Architecture: any
-Depends: ${shlibs:Depends}, adduser
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
 Description: firmware downloader for Linksys WMA11B media adapter
  wmaloader is a simple program that can download filesystem images to
  the Linksys WMA11B. It performs the same function as the Windows
diff -u wmaloader-0.1/debian/changelog wmaloader-0.1/debian/changelog
--- wmaloader-0.1/debian/changelog
+++ wmaloader-0.1/debian/changelog
@@ -1,3 +1,13 @@
+wmaloader (0.1-5.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Use pkg-config to find libupnp (Closes: #722866)
+  * Fix warnings due to missing headers or wrong declarations.
+  * Add ${misc:Depends} to debian/control (raised by Lintian)
+  * Apply hardening flags and fix resulting build errors
+
+ -- Nick Leverton <n...@leverton.org>  Mon, 29 Sep 2014 16:41:19 +0100
+
 wmaloader (0.1-5.1) unstable; urgency=low
 
   * Non-maintainer upload.
only in patch2:
unchanged:
--- wmaloader-0.1.orig/common.c
+++ wmaloader-0.1/common.c
@@ -42,6 +42,6 @@
 
   if (!ret) return;
   
-  if (backgrounded)	syslog(LOG_INFO, buffer);
-  else printf(buffer);
+  if (backgrounded)	syslog(LOG_INFO, "%s", buffer);
+  else printf("%s", buffer);
 }

Reply via email to