[nc] Fix i386 connection issues and size_t format warnings

Petr Sabata psabata at fedoraproject.org
Tue Apr 12 07:15:31 UTC 2011


commit 51afa5bf07812cf81406585b388077313d40c230
Author: Petr Sabata <psabata at redhat.com>
Date:   Tue Apr 12 09:14:27 2011 +0200

    Fix i386 connection issues and size_t format warnings

 nc-1.100-format-size_t.patch |   19 +++++++++++++++++++
 nc-1.100-libbsd.patch        |   26 ++++++++++++++++++++++++++
 nc.spec                      |   10 +++++++++-
 3 files changed, 54 insertions(+), 1 deletions(-)
---
diff --git a/nc-1.100-format-size_t.patch b/nc-1.100-format-size_t.patch
new file mode 100644
index 0000000..b40c64e
--- /dev/null
+++ b/nc-1.100-format-size_t.patch
@@ -0,0 +1,19 @@
+diff --git a/socks.c b/socks.c
+index c71453b..def5084 100644
+--- a/socks.c
++++ b/socks.c
+@@ -231,12 +231,12 @@ socks_connect(const char *host, const char *port,
+ 		case SOCKS_IPV4:
+ 			cnt = atomicio(read, proxyfd, buf + 4, 6);
+ 			if (cnt != 6)
+-				err(1, "read failed (%d/6)", cnt);
++				err(1, "read failed (%zd/6)", cnt);
+ 			break;
+ 		case SOCKS_IPV6:
+ 			cnt = atomicio(read, proxyfd, buf + 4, 18);
+ 			if (cnt != 18)
+-				err(1, "read failed (%d/18)", cnt);
++				err(1, "read failed (%zd/18)", cnt);
+ 			break;
+ 		default:
+ 			errx(1, "connection failed, unsupported address type");
diff --git a/nc-1.100-libbsd.patch b/nc-1.100-libbsd.patch
new file mode 100644
index 0000000..802e61b
--- /dev/null
+++ b/nc-1.100-libbsd.patch
@@ -0,0 +1,26 @@
+diff --git a/netcat.c b/netcat.c
+index cb36f88..b7e4d5e 100644
+--- a/netcat.c
++++ b/netcat.c
+@@ -48,7 +48,7 @@
+ #include <poll.h>
+ #include <stdarg.h>
+ #include <stdio.h>
+-#include <stdlib.h>
++#include <bsd/stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+diff --git a/socks.c b/socks.c
+index 909c86e..c71453b 100644
+--- a/socks.c
++++ b/socks.c
+@@ -34,7 +34,7 @@
+ #include <errno.h>
+ #include <netdb.h>
+ #include <stdio.h>
+-#include <stdlib.h>
++#include <bsd/stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <resolv.h>
diff --git a/nc.spec b/nc.spec
index e0fefd6..69412c2 100644
--- a/nc.spec
+++ b/nc.spec
@@ -1,7 +1,7 @@
 Summary:    Reads and writes data across network connections using TCP or UDP
 Name:       nc
 Version:    1.100
-Release:    1%{?dist}
+Release:    2%{?dist}
 URL:        http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
 License:    BSD ISC
 Group:      Applications/Internet
@@ -14,6 +14,8 @@ Patch2:     nc-1.100-udp-stop.patch
 Patch3:     nc-1.100-udp-portscan.patch
 Patch4:     nc-1.100-crlf.patch
 Patch5:     nc-1.100-comma.patch
+Patch6:     nc-1.100-libbsd.patch
+Patch7:     nc-1.100-format-size_t.patch
 
 BuildRequires: libbsd-devel
 
@@ -38,6 +40,8 @@ capabilities.
 %patch3 -p1 -b .udp-portscan
 %patch4 -p1 -b .crlf
 %patch5 -p1 -b .comma
+%patch6 -p1 -b .libbsd
+%patch7 -p1 -b .format-size_t
 cp -p %{SOURCE1} .
 
 %build
@@ -55,6 +59,10 @@ install -m 644 nc.1 %{buildroot}%{_mandir}/man1
 %{_mandir}/man1/nc.1*
 
 %changelog
+* Mon Apr 11 2011 Petr Sabata <psabata at redhat.com> - 1.100-2
+- Include libbsd stdlib, rhbz#694407
+- Use %zd format for size_t
+
 * Tue Mar 08 2011 Petr Sabata <psabata at redhat.com> - 1.100-1
 - Update to current upstream
 - Moving from glib to libbsd


More information about the scm-commits mailing list