honeyd/honeyd.patch

changeset 574
1074e5934dd9
child 575
6e491d7671a4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/honeyd/honeyd.patch	Tue Aug 28 18:35:30 2012 +0200
     1.3 @@ -0,0 +1,213 @@
     1.4 +Index: command.c
     1.5 +--- command.c.orig	2006-08-19 09:10:40 +0200
     1.6 ++++ command.c	2006-08-24 12:14:21 +0200
     1.7 +@@ -72,6 +72,9 @@
     1.8 + #include "pyextend.h"
     1.9 + #include "honeyd_overload.h"
    1.10 + #include "util.h"
    1.11 ++#ifndef HAVE_SETENV
    1.12 ++#include "setenv.h"
    1.13 ++#endif
    1.14 + 
    1.15 + ssize_t atomicio(ssize_t (*)(), int, void *, size_t);
    1.16 + 
    1.17 +Index: compat/getopt.h
    1.18 +--- compat/getopt.h.orig	2006-08-19 09:10:40 +0200
    1.19 ++++ compat/getopt.h	2006-08-24 12:14:21 +0200
    1.20 +@@ -40,7 +40,11 @@
    1.21 + #ifndef _GETOPT_H_
    1.22 + #define _GETOPT_H_
    1.23 + 
    1.24 ++#ifdef HAVE_SYS_CDEFS_H
    1.25 + #include <sys/cdefs.h>
    1.26 ++#else
    1.27 ++#include "cdefs.h"
    1.28 ++#endif
    1.29 + 
    1.30 + /*
    1.31 +  * GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
    1.32 +Index: compat/sha1.h
    1.33 +--- compat/sha1.h.orig	2006-08-19 09:10:40 +0200
    1.34 ++++ compat/sha1.h	2006-08-24 12:14:21 +0200
    1.35 +@@ -15,7 +15,11 @@
    1.36 +     unsigned char buffer[64];
    1.37 + } SHA1_CTX;
    1.38 + 
    1.39 ++#ifdef HAVE_SYS_CDEFS_H
    1.40 + #include <sys/cdefs.h>
    1.41 ++#else
    1.42 ++#include "cdefs.h"
    1.43 ++#endif
    1.44 + 
    1.45 + __BEGIN_DECLS
    1.46 + void SHA1Transform(u_int32_t [5], const unsigned char [64])
    1.47 +Index: config.h.in
    1.48 +--- config.h.in.orig	2006-01-17 18:11:44 +0100
    1.49 ++++ config.h.in	2006-08-24 12:14:21 +0200
    1.50 +@@ -222,6 +222,9 @@
    1.51 + /* Define to 1 if you have the `strtoul' function. */
    1.52 + #undef HAVE_STRTOUL
    1.53 + 
    1.54 ++/* Define to 1 if you have the `setenv' function. */
    1.55 ++#undef HAVE_SETENV
    1.56 ++
    1.57 + /* Define if your system defines struct sockaddr_storage */
    1.58 + #undef HAVE_STRUCT_SOCKADDR_STORAGE
    1.59 + 
    1.60 +@@ -255,6 +258,9 @@
    1.61 + /* Define to 1 if you have the <sys/types.h> header file. */
    1.62 + #undef HAVE_SYS_TYPES_H
    1.63 + 
    1.64 ++/* Define to 1 if you have the <sys/cdefs.h> header file. */
    1.65 ++#undef HAVE_SYS_CDEFS_H
    1.66 ++
    1.67 + /* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
    1.68 + #undef HAVE_SYS_WAIT_H
    1.69 + 
    1.70 +Index: configure
    1.71 +--- configure.orig	2006-08-19 09:11:11 +0200
    1.72 ++++ configure	2006-08-24 12:14:21 +0200
    1.73 +@@ -22317,7 +22317,7 @@
    1.74 + 
    1.75 + 
    1.76 + 
    1.77 +-for ac_header in stdarg.h errno.h fcntl.h paths.h stdlib.h string.h time.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/ioccom.h sys/file.h syslog.h unistd.h assert.h
    1.78 ++for ac_header in stdarg.h errno.h fcntl.h paths.h stdlib.h string.h time.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/ioccom.h sys/file.h syslog.h unistd.h assert.h sys/cdefs.h
    1.79 + do
    1.80 + as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
    1.81 + if eval "test \"\${$as_ac_Header+set}\" = set"; then
    1.82 +@@ -23483,7 +23483,7 @@
    1.83 + 
    1.84 + 
    1.85 + 
    1.86 +-for ac_func in asprintf dup2 fgetln gettimeofday memmove memset strcasecmp strchr strdup strncasecmp strtoul strspn getaddrinfo getnameinfo freeaddrinfo setgroups sendmsg recvmsg setregid setruid kqueue
    1.87 ++for ac_func in asprintf dup2 fgetln gettimeofday memmove memset strcasecmp strchr strdup strncasecmp strtoul strspn getaddrinfo getnameinfo freeaddrinfo setgroups sendmsg recvmsg setregid setruid setenv kqueue
    1.88 + do
    1.89 + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
    1.90 + echo "$as_me:$LINENO: checking for $ac_func" >&5
    1.91 +Index: dhcpclient.c
    1.92 +--- dhcpclient.c.orig	2006-08-19 09:10:41 +0200
    1.93 ++++ dhcpclient.c	2006-08-24 12:14:21 +0200
    1.94 +@@ -94,6 +94,13 @@
    1.95 + 
    1.96 + #define NTRIES 10
    1.97 + 
    1.98 ++#ifndef MIN
    1.99 ++# define MIN(a,b)	(((a) < (b)) ? (a) : (b))
   1.100 ++#endif /* MIN */
   1.101 ++#ifndef MAX
   1.102 ++# define MAX(a,b)	(((a) > (b)) ? (a) : (b))
   1.103 ++#endif /* MAX */
   1.104 ++
   1.105 + static int  _pack_request(struct dhcpclient_req *, void *, size_t *);
   1.106 + static int  _pack_release(struct dhcpclient_req *, void *, size_t *);
   1.107 + static int  _bcast(struct template *,
   1.108 +Index: honeyd.c
   1.109 +--- honeyd.c.orig	2006-08-19 09:14:36 +0200
   1.110 ++++ honeyd.c	2006-08-24 12:14:21 +0200
   1.111 +@@ -101,6 +101,9 @@
   1.112 + #include "histogram.h"
   1.113 + #include "update.h"
   1.114 + #include "util.h"
   1.115 ++#ifndef HAVE_SETENV
   1.116 ++#include "setenv.h"
   1.117 ++#endif
   1.118 + 
   1.119 + #ifdef HAVE_PYTHON
   1.120 + #include <Python.h>
   1.121 +Index: honeyd_overload.c
   1.122 +--- honeyd_overload.c.orig	2006-08-19 09:10:41 +0200
   1.123 ++++ honeyd_overload.c	2006-08-24 12:14:21 +0200
   1.124 +@@ -295,7 +295,7 @@
   1.125 + 	struct fd *nfd;
   1.126 + 	int pair[2];
   1.127 + 
   1.128 +-	if (socketpair(AF_LOCAL, type, 0, pair) == -1) {
   1.129 ++	if (socketpair(AF_UNIX, type, 0, pair) == -1) {
   1.130 + 		warn("%s: socketpair", __func__);
   1.131 + 		return (NULL);
   1.132 + 	}
   1.133 +@@ -625,7 +625,7 @@
   1.134 + 	}
   1.135 + 
   1.136 + 	/* Get another socketpair */
   1.137 +-	if (socketpair(AF_LOCAL, SOCK_STREAM, 0, pair) == -1) {
   1.138 ++	if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) {
   1.139 + 		DPRINTF((stderr, "%s: socketpair failed", __func__));
   1.140 + 		errno = ETIMEDOUT; /* XXX */
   1.141 + 		return (-1);
   1.142 +@@ -732,6 +732,7 @@
   1.143 + }
   1.144 + #endif /* !__FreeBSD__ */
   1.145 + 
   1.146 ++#ifndef sun
   1.147 + ssize_t
   1.148 + recvfrom(int sock, void *buf, size_t len, int flags, struct sockaddr *from,
   1.149 +     socklen_t *fromlen)
   1.150 +@@ -759,6 +760,7 @@
   1.151 +  out:
   1.152 + 	return (ret);
   1.153 + }
   1.154 ++#endif /* !sun */
   1.155 + 
   1.156 + ssize_t
   1.157 + sendto(int sock, const void *buf, size_t len, int flags,
   1.158 +@@ -795,6 +797,7 @@
   1.159 + 	return (ret);
   1.160 + }
   1.161 + 
   1.162 ++#ifndef sun
   1.163 + int
   1.164 + getsockname(int sock, struct sockaddr *to, socklen_t *tolen)
   1.165 + {
   1.166 +@@ -832,6 +835,7 @@
   1.167 + 
   1.168 + 	return (0);
   1.169 + }
   1.170 ++#endif /* !sun */
   1.171 + 
   1.172 + ssize_t
   1.173 + recvmsg(int sock, struct msghdr *msg, int flags)
   1.174 +@@ -1120,6 +1124,7 @@
   1.175 + 	return (ret);
   1.176 + }
   1.177 + 
   1.178 ++#ifndef sun
   1.179 + int
   1.180 + accept(int sock, struct sockaddr *addr, socklen_t *addrlen)
   1.181 + {
   1.182 +@@ -1169,6 +1174,7 @@
   1.183 + 
   1.184 + 	return (fd);
   1.185 + }
   1.186 ++#endif /* !sun */
   1.187 + 
   1.188 + #if 0
   1.189 + 
   1.190 +Index: personality.c
   1.191 +--- personality.c.orig	2006-08-19 09:10:40 +0200
   1.192 ++++ personality.c	2006-08-24 12:14:21 +0200
   1.193 +@@ -32,6 +32,9 @@
   1.194 + 
   1.195 + #include <sys/param.h>
   1.196 + #include <sys/types.h>
   1.197 ++#ifndef UINT_MAX
   1.198 ++#define UINT_MAX    4294967295U
   1.199 ++#endif
   1.200 + 
   1.201 + #include "config.h"
   1.202 + 
   1.203 +Index: pf_osfp.c
   1.204 +--- pf_osfp.c.orig	2006-08-19 09:10:40 +0200
   1.205 ++++ pf_osfp.c	2006-08-24 12:14:21 +0200
   1.206 +@@ -50,6 +50,10 @@
   1.207 + #  define DPFPRINTF(format, x...)	((void)0)
   1.208 + # endif /* PFDEBUG */
   1.209 + 
   1.210 ++#ifndef MAX
   1.211 ++# define MAX(a,b)  (((a) > (b)) ? (a) : (b))
   1.212 ++#endif
   1.213 ++
   1.214 + SLIST_HEAD(pf_osfp_list, pf_os_fingerprint) pf_osfp_list;
   1.215 + pool_t pf_osfp_entry_pl;
   1.216 + pool_t pf_osfp_pl;

mercurial