michael@574: Index: command.c michael@574: --- command.c.orig 2006-08-19 09:10:40 +0200 michael@574: +++ command.c 2006-08-24 12:14:21 +0200 michael@574: @@ -72,6 +72,9 @@ michael@574: #include "pyextend.h" michael@574: #include "honeyd_overload.h" michael@574: #include "util.h" michael@574: +#ifndef HAVE_SETENV michael@574: +#include "setenv.h" michael@574: +#endif michael@574: michael@574: ssize_t atomicio(ssize_t (*)(), int, void *, size_t); michael@574: michael@574: Index: compat/getopt.h michael@574: --- compat/getopt.h.orig 2006-08-19 09:10:40 +0200 michael@574: +++ compat/getopt.h 2006-08-24 12:14:21 +0200 michael@574: @@ -40,7 +40,11 @@ michael@574: #ifndef _GETOPT_H_ michael@574: #define _GETOPT_H_ michael@574: michael@574: +#ifdef HAVE_SYS_CDEFS_H michael@574: #include michael@574: +#else michael@574: +#include "cdefs.h" michael@574: +#endif michael@574: michael@574: /* michael@574: * GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions michael@574: Index: compat/sha1.h michael@574: --- compat/sha1.h.orig 2006-08-19 09:10:40 +0200 michael@574: +++ compat/sha1.h 2006-08-24 12:14:21 +0200 michael@574: @@ -15,7 +15,11 @@ michael@574: unsigned char buffer[64]; michael@574: } SHA1_CTX; michael@574: michael@574: +#ifdef HAVE_SYS_CDEFS_H michael@574: #include michael@574: +#else michael@574: +#include "cdefs.h" michael@574: +#endif michael@574: michael@574: __BEGIN_DECLS michael@574: void SHA1Transform(u_int32_t [5], const unsigned char [64]) michael@574: Index: config.h.in michael@574: --- config.h.in.orig 2006-01-17 18:11:44 +0100 michael@574: +++ config.h.in 2006-08-24 12:14:21 +0200 michael@574: @@ -222,6 +222,9 @@ michael@574: /* Define to 1 if you have the `strtoul' function. */ michael@574: #undef HAVE_STRTOUL michael@574: michael@574: +/* Define to 1 if you have the `setenv' function. */ michael@574: +#undef HAVE_SETENV michael@574: + michael@574: /* Define if your system defines struct sockaddr_storage */ michael@574: #undef HAVE_STRUCT_SOCKADDR_STORAGE michael@574: michael@574: @@ -255,6 +258,9 @@ michael@574: /* Define to 1 if you have the header file. */ michael@574: #undef HAVE_SYS_TYPES_H michael@574: michael@574: +/* Define to 1 if you have the header file. */ michael@574: +#undef HAVE_SYS_CDEFS_H michael@574: + michael@574: /* Define to 1 if you have that is POSIX.1 compatible. */ michael@574: #undef HAVE_SYS_WAIT_H michael@574: michael@574: Index: dhcpclient.c michael@574: --- dhcpclient.c.orig 2006-08-19 09:10:41 +0200 michael@574: +++ dhcpclient.c 2006-08-24 12:14:21 +0200 michael@574: @@ -94,6 +94,13 @@ michael@574: michael@574: #define NTRIES 10 michael@574: michael@574: +#ifndef MIN michael@574: +# define MIN(a,b) (((a) < (b)) ? (a) : (b)) michael@574: +#endif /* MIN */ michael@574: +#ifndef MAX michael@574: +# define MAX(a,b) (((a) > (b)) ? (a) : (b)) michael@574: +#endif /* MAX */ michael@574: + michael@574: static int _pack_request(struct dhcpclient_req *, void *, size_t *); michael@574: static int _pack_release(struct dhcpclient_req *, void *, size_t *); michael@574: static int _bcast(struct template *, michael@574: Index: honeyd.c michael@574: --- honeyd.c.orig 2006-08-19 09:14:36 +0200 michael@574: +++ honeyd.c 2006-08-24 12:14:21 +0200 michael@574: @@ -101,6 +101,9 @@ michael@574: #include "histogram.h" michael@574: #include "update.h" michael@574: #include "util.h" michael@574: +#ifndef HAVE_SETENV michael@574: +#include "setenv.h" michael@574: +#endif michael@574: michael@574: #ifdef HAVE_PYTHON michael@574: #include michael@574: Index: honeyd_overload.c michael@574: --- honeyd_overload.c.orig 2006-08-19 09:10:41 +0200 michael@574: +++ honeyd_overload.c 2006-08-24 12:14:21 +0200 michael@574: @@ -295,7 +295,7 @@ michael@574: struct fd *nfd; michael@574: int pair[2]; michael@574: michael@574: - if (socketpair(AF_LOCAL, type, 0, pair) == -1) { michael@574: + if (socketpair(AF_UNIX, type, 0, pair) == -1) { michael@574: warn("%s: socketpair", __func__); michael@574: return (NULL); michael@574: } michael@574: @@ -625,7 +625,7 @@ michael@574: } michael@574: michael@574: /* Get another socketpair */ michael@574: - if (socketpair(AF_LOCAL, SOCK_STREAM, 0, pair) == -1) { michael@574: + if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) { michael@574: DPRINTF((stderr, "%s: socketpair failed", __func__)); michael@574: errno = ETIMEDOUT; /* XXX */ michael@574: return (-1); michael@574: @@ -732,6 +732,7 @@ michael@574: } michael@574: #endif /* !__FreeBSD__ */ michael@574: michael@574: +#ifndef sun michael@574: ssize_t michael@574: recvfrom(int sock, void *buf, size_t len, int flags, struct sockaddr *from, michael@574: socklen_t *fromlen) michael@574: @@ -759,6 +760,7 @@ michael@574: out: michael@574: return (ret); michael@574: } michael@574: +#endif /* !sun */ michael@574: michael@574: ssize_t michael@574: sendto(int sock, const void *buf, size_t len, int flags, michael@574: @@ -795,6 +797,7 @@ michael@574: return (ret); michael@574: } michael@574: michael@574: +#ifndef sun michael@574: int michael@574: getsockname(int sock, struct sockaddr *to, socklen_t *tolen) michael@574: { michael@574: @@ -832,6 +835,7 @@ michael@574: michael@574: return (0); michael@574: } michael@574: +#endif /* !sun */ michael@574: michael@574: ssize_t michael@574: recvmsg(int sock, struct msghdr *msg, int flags) michael@574: @@ -1120,6 +1124,7 @@ michael@574: return (ret); michael@574: } michael@574: michael@574: +#ifndef sun michael@574: int michael@574: accept(int sock, struct sockaddr *addr, socklen_t *addrlen) michael@574: { michael@574: @@ -1169,6 +1174,7 @@ michael@574: michael@574: return (fd); michael@574: } michael@574: +#endif /* !sun */ michael@574: michael@574: #if 0 michael@574: michael@574: Index: personality.c michael@574: --- personality.c.orig 2006-08-19 09:10:40 +0200 michael@574: +++ personality.c 2006-08-24 12:14:21 +0200 michael@574: @@ -32,6 +32,9 @@ michael@574: michael@574: #include michael@574: #include michael@574: +#ifndef UINT_MAX michael@574: +#define UINT_MAX 4294967295U michael@574: +#endif michael@574: michael@574: #include "config.h" michael@574: michael@574: Index: pf_osfp.c michael@574: --- pf_osfp.c.orig 2006-08-19 09:10:40 +0200 michael@574: +++ pf_osfp.c 2006-08-24 12:14:21 +0200 michael@574: @@ -50,6 +50,10 @@ michael@574: # define DPFPRINTF(format, x...) ((void)0) michael@574: # endif /* PFDEBUG */ michael@574: michael@574: +#ifndef MAX michael@574: +# define MAX(a,b) (((a) > (b)) ? (a) : (b)) michael@574: +#endif michael@574: + michael@574: SLIST_HEAD(pf_osfp_list, pf_os_fingerprint) pf_osfp_list; michael@574: pool_t pf_osfp_entry_pl; michael@574: pool_t pf_osfp_pl; michael@715: Index: nmap.prints michael@715: --- nmap.prints.orig 2007-05-28 08:05:05.000000000 +0200 michael@715: +++ nmap.prints 2012-10-02 20:41:53.110772932 +0200 michael@715: @@ -662,18 +662,6 @@ michael@715: T7(DF=N%W=0%ACK=S%Flags=AR%Ops=) michael@715: PU(DF=N%TOS=0%IPLEN=38%RIPTL=15C%RID=E%RIPCK=0%UCK=0%ULEN=134%DAT=E) michael@715: michael@715: -Fingerprint IBM OS/400 V4R2M0 michael@715: -Class IBM | OS/400 | V4 | general purpose michael@715: -TSeq(Class=TD|RI%gcd=<6%SI=<285DC&>206%IPID=I%TS=U) michael@715: -T1(DF=N%W=8000%ACK=S++%Flags=AS%Ops=M) michael@715: -T2(Resp=Y%DF=N%W=0%ACK=S%Flags=AR%Ops=) michael@715: -T3(Resp=Y%DF=N%W=8000%ACK=S++%Flags=AS%Ops=M) michael@715: -T4(DF=N%W=0%ACK=S%Flags=R%Ops=) michael@715: -T5(DF=N%W=0%ACK=S++%Flags=AR%Ops=) michael@715: -T6(DF=N%W=0%ACK=S%Flags=R%Ops=) michael@715: -T7(DF=N%W=0%ACK=S++%Flags=AR%Ops=) michael@715: -PU(DF=N%TOS=0%IPLEN=38%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E) michael@715: - michael@715: Fingerprint IBM OS/400 V4R5M0 michael@715: Class IBM | OS/400 | V4 | general purpose michael@715: T1(DF=N%W=2000%ACK=S++%Flags=AS%Ops=MNWNNT) michael@715: @@ -11085,18 +11073,6 @@ michael@715: michael@715: Fingerprint Microsoft Windows NT 4.0 SP3 michael@715: Class Microsoft | Windows | NT/2K/XP | general purpose michael@715: -TSeq(Class=TD|RI%gcd=<18%SI=<2A00DA&>6B73) michael@715: -T1(DF=Y%W=7FFF|2017%ACK=S++%Flags=AS%Ops=M|MNWNNT) michael@715: -T2(Resp=Y%DF=N%W=0%ACK=S%Flags=AR%Ops=) michael@715: -T3(Resp=Y%DF=Y%W=7FFF|2017%ACK=S++|O%Flags=AS|A%Ops=M|NNT) michael@715: -T4(DF=N%W=0%ACK=O|S%Flags=R%Ops=) michael@715: -T5(DF=N%W=0%ACK=S++%Flags=AR%Ops=) michael@715: -T6(DF=N%W=0%ACK=O|S++%Flags=R%Ops=) michael@715: -T7(DF=N%W=0%ACK=S++%Flags=AR%Ops=) michael@715: -PU(TOS=0%IPLEN=38%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E) michael@715: - michael@715: -Fingerprint Microsoft Windows NT 4.0 SP3 michael@715: -Class Microsoft | Windows | NT/2K/XP | general purpose michael@715: TSeq(Class=TD%gcd=if_ent.intf_len = sizeof(struct intf_entry); michael@715: - strlcpy(inter->if_ent.intf_name, dev, sizeof(inter->if_ent.intf_name)); michael@715: + michael@715: + /* mitigate slash paths in OS that provide */ michael@715: + /* network devices in subdirectories of /dev */ michael@715: + iface = strrchr(dev, '/'); michael@715: + if (iface) michael@715: + iface += sizeof(char); michael@715: + else michael@715: + iface = dev; michael@715: + michael@715: + strlcpy(inter->if_ent.intf_name, iface, sizeof(inter->if_ent.intf_name)); michael@715: michael@715: if (intf_get(intf, &inter->if_ent) < 0) michael@715: err(1, "%s: intf_get", __func__); michael@715: michael@715: if (inter->if_ent.intf_addr.addr_type != ADDR_TYPE_IP) michael@715: errx(1, "%s: bad interface configuration: %s is not IP", michael@715: - __func__, dev); michael@715: + __func__, iface); michael@715: michael@715: return (inter); michael@715: } michael@715: @@ -244,7 +254,7 @@ michael@715: } michael@715: michael@715: void michael@715: -interface_ether_filter(struct interface *inter, michael@715: +interface_ether_filter(char *dev, struct interface *inter, michael@715: int naddresses, char **addresses) michael@715: { michael@715: char line[48]; michael@715: @@ -259,7 +269,7 @@ michael@715: sizeof(inter->if_filter)) michael@715: errx(1, "%s: pcap filter exceeds maximum length", __func__); michael@715: michael@715: - inter->if_eth = eth_open(inter->if_ent.intf_name); michael@715: + inter->if_eth = eth_open(dev); michael@715: if (inter->if_eth == NULL) michael@715: errx(1, "%s: eth_open: %s", inter->if_ent.intf_name); michael@715: michael@715: @@ -307,7 +317,7 @@ michael@715: * ignore our own packets. michael@715: */ michael@715: if (inter->if_ent.intf_link_addr.addr_type == ADDR_TYPE_ETH) { michael@715: - interface_ether_filter(inter, naddresses, addresses); michael@715: + interface_ether_filter(dev, inter, naddresses, addresses); michael@715: michael@715: /* michael@715: * We open all interfaces before parsing the