pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/security/arirang osfinger.c forgot to include <arpa/in...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/111d3ce7d257
branches:  trunk
changeset: 502250:111d3ce7d257
user:      tv <tv%pkgsrc.org@localhost>
date:      Thu Nov 03 16:45:13 2005 +0000

description:
osfinger.c forgot to include <arpa/inet.h> for htons().

Use traditional recv loop over a stream socket rather than depending on
MSG_WAITALL to be available.  (Interix doesn't have MSG_WAITALL.)

diffstat:

 security/arirang/Makefile         |   3 ++-
 security/arirang/patches/patch-aa |  28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletions(-)

diffs (45 lines):

diff -r 98f1d1db6dd9 -r 111d3ce7d257 security/arirang/Makefile
--- a/security/arirang/Makefile Thu Nov 03 16:43:59 2005 +0000
+++ b/security/arirang/Makefile Thu Nov 03 16:45:13 2005 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.10 2005/06/17 03:50:31 jlam Exp $
+# $NetBSD: Makefile,v 1.11 2005/11/03 16:45:13 tv Exp $
 #
 
 DISTNAME=      arirang-1.6
+PKGREVISION=   1
 CATEGORIES=    security www
 MASTER_SITES=  http://monkey.org/~pilot/arirang/
 
diff -r 98f1d1db6dd9 -r 111d3ce7d257 security/arirang/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/arirang/patches/patch-aa Thu Nov 03 16:45:13 2005 +0000
@@ -0,0 +1,28 @@
+$NetBSD: patch-aa,v 1.3 2005/11/03 16:45:13 tv Exp $
+
+--- osfinger.c.orig    2002-07-21 02:49:32.000000000 -0400
++++ osfinger.c
+@@ -33,6 +33,7 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
++#include <arpa/inet.h>
+ #include <signal.h>
+ 
+ #include "arirang.h"
+@@ -71,7 +72,14 @@ osdetect(char *scanhost)
+       }
+       snprintf(osfinger, sizeof(osfinger), "GET %s%s HTTP/1.0\n\n", NETCRAFT_FINGER, scanhost);
+       send(sock, osfinger, strlen(osfinger), 0);
+-      recv(sock, headBuff, sizeof(headBuff), MSG_WAITALL);
++
++      {
++              int toRead = sizeof(headBuff);
++              int wasRead;
++
++              while ((wasRead = recv(sock, headBuff, toRead, 0)) > 0)
++                  toRead -= wasRead;
++      }
+ 
+       ptr = strstr(headBuff, "running <b>");
+ 



Home | Main Index | Thread Index | Old Index