diff options
author | Oliver Lehmann <oliver@FreeBSD.org> | 2006-05-23 04:25:03 +0000 |
---|---|---|
committer | Oliver Lehmann <oliver@FreeBSD.org> | 2006-05-23 04:25:03 +0000 |
commit | c5a2ff0e1d2a766beb977dd4a7f691c0e33a8224 (patch) | |
tree | a5407a04123e28b14427d61779f2d191b804d1a9 /security/oidentd | |
parent | d8796de8f6dbc4e1283eede7e985f75f59907d0a (diff) | |
download | ports-c5a2ff0e1d2a766beb977dd4a7f691c0e33a8224.tar.gz ports-c5a2ff0e1d2a766beb977dd4a7f691c0e33a8224.zip |
Notes
Diffstat (limited to 'security/oidentd')
-rw-r--r-- | security/oidentd/Makefile | 4 | ||||
-rw-r--r-- | security/oidentd/distinfo | 6 | ||||
-rw-r--r-- | security/oidentd/files/patch-configure | 18 | ||||
-rw-r--r-- | security/oidentd/files/patch-ipv6_missing.h | 42 | ||||
-rw-r--r-- | security/oidentd/files/patch-unprivileged_ipv6 | 400 |
5 files changed, 5 insertions, 465 deletions
diff --git a/security/oidentd/Makefile b/security/oidentd/Makefile index 8ea7bfcd0f74..e314b7490b06 100644 --- a/security/oidentd/Makefile +++ b/security/oidentd/Makefile @@ -6,8 +6,7 @@ # PORTNAME= oidentd -PORTVERSION= 2.0.7 -PORTREVISION= 8 +PORTVERSION= 2.0.8 CATEGORIES= security MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ojnk @@ -16,6 +15,7 @@ MAINTAINER= oliver@FreeBSD.org COMMENT= Ident server that supports user-defined ident strings USE_RC_SUBR= yes +USE_GETOPT_LONG=yes GNU_CONFIGURE= yes CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} diff --git a/security/oidentd/distinfo b/security/oidentd/distinfo index 1cf357551564..584892ee3b78 100644 --- a/security/oidentd/distinfo +++ b/security/oidentd/distinfo @@ -1,3 +1,3 @@ -MD5 (oidentd-2.0.7.tar.gz) = cf1c017496b066b45ffe3d7a303fd6ad -SHA256 (oidentd-2.0.7.tar.gz) = 2f3d837c8134b71c6fce4d93c291d090b28efb961393094b93d6f0b7a6adb81d -SIZE (oidentd-2.0.7.tar.gz) = 196027 +MD5 (oidentd-2.0.8.tar.gz) = c3d9a56255819ef8904b867284386911 +SHA256 (oidentd-2.0.8.tar.gz) = a54cbed187281f8d5a301d1d8fd5cb0f30bfb13a5a8e9ab752ace76c1010fb6f +SIZE (oidentd-2.0.8.tar.gz) = 212354 diff --git a/security/oidentd/files/patch-configure b/security/oidentd/files/patch-configure index 75f25e400a8f..89c41e1cbbb3 100644 --- a/security/oidentd/files/patch-configure +++ b/security/oidentd/files/patch-configure @@ -31,21 +31,3 @@ #include <netinet/ip_nat.h> _ACEOF rm -f conftest.$ac_objext -@@ -5888,7 +5896,7 @@ - - if test "$masq_support" = "no"; then - case "$host_os" in -- *freebsd[45]* ) -+ *freebsd[4-9]* ) - use_kmem=no - os_src=freebsd4.c - ;; -@@ -5900,7 +5908,7 @@ - esac - else - case "$host_os" in -- *freebsd5* ) -+ *freebsd[5-9]* ) - use_kmem=yes - os_src=freebsd5.c - ;; diff --git a/security/oidentd/files/patch-ipv6_missing.h b/security/oidentd/files/patch-ipv6_missing.h deleted file mode 100644 index 143c7778f776..000000000000 --- a/security/oidentd/files/patch-ipv6_missing.h +++ /dev/null @@ -1,42 +0,0 @@ ---- src/missing/ipv6_missing.h.orig Tue Dec 3 06:05:18 2002 -+++ src/missing/ipv6_missing.h Sat Sep 4 16:05:28 2004 -@@ -1,20 +1,32 @@ - #ifndef __IPV6_MISSING_H - #define __IPV6_MISSING_H - -+/* Correspond some of these values with present-day FreeBSD; -+ * verified on 4.10-STABLE and 5.3-BETA2. -+ */ -+ -+#ifndef EAI_MEMORY -+# define EAI_MEMORY 6 -+#endif - #ifndef EAI_NODATA --# define EAI_NODATA 1 --# define EAI_MEMORY 2 -+# define EAI_NODATA 7 - #endif - - #ifndef AI_PASSIVE --# define AI_PASSIVE 1 --# define AI_CANONNAME 2 -+# define AI_PASSIVE 0x00000001 -+#endif -+#ifndef AI_CANONNAME -+# define AI_CANONNAME 0x00000002 - #endif - - #ifndef NI_NUMERICHOST --# define NI_NUMERICHOST 2 --# define NI_NAMEREQD 4 --# define NI_NUMERICSERV 8 -+# define NI_NUMERICHOST 0x00000002 -+#endif -+#ifndef NI_NAMEREQD -+# define NI_NAMEREQD 0x00000004 -+#endif -+#ifndef NI_NUMERICSERV -+# define NI_NUMERICSERV 0x00000008 - #endif - - #ifndef HAVE_STRUCT_ADDRINFO diff --git a/security/oidentd/files/patch-unprivileged_ipv6 b/security/oidentd/files/patch-unprivileged_ipv6 deleted file mode 100644 index 5a798d101d46..000000000000 --- a/security/oidentd/files/patch-unprivileged_ipv6 +++ /dev/null @@ -1,400 +0,0 @@ -diff -ru src.old/kernel/freebsd.c src/kernel/freebsd.c ---- src.old/kernel/freebsd.c Tue May 18 23:12:23 2004 -+++ src/kernel/freebsd.c Tue May 18 23:13:45 2004 -@@ -159,11 +159,11 @@ - - #ifdef _HAVE_OLD_INPCB - --static struct socket *getlist4( void *arg, -+static struct socket *getlist( void *arg, - in_port_t lport, - in_port_t fport, -- const struct in_addr *laddr, -- const struct in_addr *faddr) -+ const struct sockaddr *laddr, -+ const struct sockaddr *faddr) - { - struct inpcb *pcbp = arg; - struct inpcb *head; -@@ -175,8 +175,8 @@ - - do { - if (opt_enabled(PROXY)) { -- if (faddr->s_addr == SIN4(&proxy)->sin_addr.s_addr && -- laddr->s_addr != SIN4(&proxy)->sin_addr.s_addr && -+ if (SIN4(faddr)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr && -+ SIN4(laddr)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr && - pcbp->inp_fport == fport && - pcbp->inp_lport == lport) - { -@@ -184,8 +184,8 @@ - } - } - -- if (pcbp->inp_faddr.s_addr == faddr->s_addr && -- pcbp->inp_laddr.s_addr == laddr->s_addr && -+ if (pcbp->inp_faddr.s_addr == SIN4(faddr)->sin_addr.s_addr && -+ pcbp->inp_laddr.s_addr == SIN4(laddr)->sin_addr.s_addr && - pcbp->inp_fport == fport && - pcbp->inp_lport == lport) - { -@@ -199,28 +199,45 @@ - - #else - --static struct socket *getlist4( void *arg, -+static struct socket *getlist( void *arg, - in_port_t lport, - in_port_t fport, -- const struct in_addr *laddr, -- const struct in_addr *faddr) -+ const struct sockaddr *local, -+ const struct sockaddr *remote) - { - struct inpcb *head, pcbp; - struct inpcbhead *pcbhead = arg; -+ char *faddr, *laddr, *pfaddr, *pladdr; -+ int alen; - -- (void) laddr; -+ if (remote->sa_family != local->sa_family) -+ return (NULL); -+ switch (remote->sa_family) { -+ case AF_INET: -+ faddr = (char *)&SIN4(remote)->sin_addr; -+ laddr = (char *)&SIN4(local)->sin_addr; -+ break; -+#ifdef INP_IPV6 -+ case AF_INET6: -+ faddr = (char *)&SIN6(remote)->sin6_addr; -+ laddr = (char *)&SIN6(local)->sin6_addr; -+ break; -+#endif -+ default: -+ return (NULL); -+ } - - head = pcbhead->lh_first; - if (head == NULL) - return (NULL); - -- do { -+ for (; head != NULL; head = pcbp.inp_list.le_next) { - if (getbuf((u_long) head, &pcbp, sizeof(struct inpcb)) == -1) - break; - -- if (opt_enabled(PROXY)) { -- if (faddr->s_addr == SIN4(&proxy)->sin_addr.s_addr && -- laddr->s_addr != SIN4(&proxy)->sin_addr.s_addr && -+ if (opt_enabled(PROXY) && remote->sa_family == AF_INET) { -+ if (SIN4(remote)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr && -+ SIN4(local)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr && - pcbp.inp_fport == fport && - pcbp.inp_lport == lport) - { -@@ -228,16 +245,39 @@ - } - } - -- if (pcbp.inp_faddr.s_addr == faddr->s_addr && -- pcbp.inp_laddr.s_addr == laddr->s_addr && -+#ifdef INP_IPV6 -+ if (pcbp.inp_vflag & INP_IPV4) -+ { -+ if (remote->sa_family != AF_INET) -+ continue; -+ pfaddr = (char *)&pcbp.inp_faddr; -+ pladdr = (char *)&pcbp.inp_laddr; -+ alen = sizeof(struct in_addr); -+ } -+ else if (pcbp.inp_vflag & INP_IPV6) -+ { -+ if (remote->sa_family != AF_INET6) -+ continue; -+ pfaddr = (char *)&pcbp.in6p_faddr; -+ pladdr = (char *)&pcbp.in6p_laddr; -+ alen = sizeof(struct in6_addr); -+ } -+ else -+ continue; -+#else -+ pfaddr = (char *)&pcbp.inp_faddr; -+ pladdr = (char *)&pcbp.inp_laddr; -+ alen = sizeof(struct in_addr); -+#endif -+ if (memcmp(pfaddr, faddr, alen) == 0 && -+ memcmp(pladdr, laddr, alen) == 0 && - pcbp.inp_fport == fport && - pcbp.inp_lport == lport) - { - return (pcbp.inp_socket); - } - -- head = pcbp.inp_list.le_next; -- } while (head != NULL); -+ } - - return (NULL); - } -@@ -248,7 +288,7 @@ - ** Return the UID of the connection owner - */ - --int get_user4( in_port_t lport, -+static int get_user( in_port_t lport, - in_port_t fport, - struct sockaddr_storage *laddr, - struct sockaddr_storage *faddr) -@@ -276,8 +316,9 @@ - tcb.inp_prev = (struct inpcb *) kinfo->nl[N_TCB].n_value; - #endif - -- sockp = getlist4(&tcb, lport, fport, -- &SIN4(laddr)->sin_addr, &SIN4(faddr)->sin_addr); -+ sockp = getlist(&tcb, lport, fport, -+ (struct sockaddr *)laddr, -+ (struct sockaddr *)faddr); - - if (sockp == NULL) - return (-1); -@@ -346,6 +387,14 @@ - return (-1); - } - -+int get_user4( in_port_t lport, -+ in_port_t fport, -+ struct sockaddr_storage *laddr, -+ struct sockaddr_storage *faddr) -+{ -+ return (get_user(lport, fport, laddr, faddr)); -+} -+ - #ifdef MASQ_SUPPORT - - /* -@@ -456,36 +505,7 @@ - struct sockaddr_storage *laddr, - struct sockaddr_storage *faddr) - { -- struct ucred ucred; -- struct sockaddr_in6 sin6[2]; -- int len; -- int ret; -- -- len = sizeof(struct ucred); -- -- memset(sin6, 0, sizeof(sin6)); -- -- sin6[0].sin6_len = sizeof(struct sockaddr_in6); -- sin6[0].sin6_family = AF_INET6; -- sin6[0].sin6_port = lport; -- memcpy(&sin6[0].sin6_addr, &SIN6(laddr)->sin6_addr, -- sizeof(sin6[0].sin6_addr)); -- -- sin6[1].sin6_len = sizeof(struct sockaddr_in6); -- sin6[1].sin6_family = AF_INET6; -- sin6[1].sin6_port = fport; -- memcpy(&sin6[1].sin6_addr, &SIN6(faddr)->sin6_addr, -- sizeof(sin6[1].sin6_addr)); -- -- ret = sysctlbyname("net.inet6.tcp6.getcred", -- &ucred, &len, sin6, sizeof(sin6)); -- -- if (ret == -1) { -- debug("sysctlbyname: %s", strerror(errno)); -- return (-1); -- } -- -- return (ucred.cr_uid); -+ return (get_user(lport, fport, laddr, faddr)); - } - - #endif -diff -ru src.old/kernel/freebsd5.c src/kernel/freebsd5.c ---- src.old/kernel/freebsd5.c Tue May 18 23:12:23 2004 -+++ src/kernel/freebsd5.c Tue May 18 23:12:46 2004 -@@ -160,11 +160,11 @@ - - #ifdef _HAVE_OLD_INPCB - --static struct socket *getlist4( void *arg, -+static struct socket *getlist( void *arg, - in_port_t lport, - in_port_t fport, -- const struct in_addr *laddr, -- const struct in_addr *faddr) -+ const struct sockaddr *laddr, -+ const struct sockaddr *faddr) - { - struct inpcb *pcbp = arg; - struct inpcb *head; -@@ -176,8 +176,8 @@ - - do { - if (opt_enabled(PROXY)) { -- if (faddr->s_addr == SIN4(&proxy)->sin_addr.s_addr && -- laddr->s_addr != SIN4(&proxy)->sin_addr.s_addr && -+ if (SIN4(faddr)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr && -+ SIN4(laddr)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr && - pcbp->inp_fport == fport && - pcbp->inp_lport == lport) - { -@@ -185,8 +185,8 @@ - } - } - -- if (pcbp->inp_faddr.s_addr == faddr->s_addr && -- pcbp->inp_laddr.s_addr == laddr->s_addr && -+ if (pcbp->inp_faddr.s_addr == SIN4(faddr)->sin_addr.s_addr && -+ pcbp->inp_laddr.s_addr == SIN4(laddr)->sin_addr.s_addr && - pcbp->inp_fport == fport && - pcbp->inp_lport == lport) - { -@@ -200,16 +200,31 @@ - - #else - --static struct socket *getlist4( void *arg, -+static struct socket *getlist( void *arg, - in_port_t lport, - in_port_t fport, -- const struct in_addr *laddr, -- const struct in_addr *faddr) -+ const struct sockaddr *local, -+ const struct sockaddr *remote) - { - struct inpcb *head, pcbp; - struct inpcbhead *pcbhead = arg; -+ char *faddr, *laddr, *pfaddr, *pladdr; -+ int alen; - -- (void) laddr; -+ if (remote->sa_family != local->sa_family) -+ return (NULL); -+ switch (remote->sa_family) { -+ case AF_INET: -+ faddr = (char *)&SIN4(remote)->sin_addr; -+ laddr = (char *)&SIN4(local)->sin_addr; -+ break; -+ case AF_INET6: -+ faddr = (char *)&SIN6(remote)->sin6_addr; -+ laddr = (char *)&SIN6(local)->sin6_addr; -+ break; -+ default: -+ return (NULL); -+ } - - head = pcbhead->lh_first; - if (head == NULL) -@@ -219,9 +234,9 @@ - if (getbuf((u_long) head, &pcbp, sizeof(struct inpcb)) == -1) - break; - -- if (opt_enabled(PROXY)) { -- if (faddr->s_addr == SIN4(&proxy)->sin_addr.s_addr && -- laddr->s_addr != SIN4(&proxy)->sin_addr.s_addr && -+ if (opt_enabled(PROXY) && remote->sa_family == AF_INET) { -+ if (SIN4(remote)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr && -+ SIN4(local)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr && - pcbp.inp_fport == fport && - pcbp.inp_lport == lport) - { -@@ -229,8 +244,22 @@ - } - } - -- if (pcbp.inp_faddr.s_addr == faddr->s_addr && -- pcbp.inp_laddr.s_addr == laddr->s_addr && -+ if (remote->sa_family == AF_INET) -+ { -+ pfaddr = (char *)&pcbp.inp_faddr; -+ pladdr = (char *)&pcbp.inp_laddr; -+ alen = sizeof(struct in_addr); -+ } -+ else if (remote->sa_family == AF_INET6) -+ { -+ pfaddr = (char *)&pcbp.in6p_faddr; -+ pladdr = (char *)&pcbp.in6p_laddr; -+ alen = sizeof(struct in6_addr); -+ } -+ else -+ continue; -+ if (memcmp(pfaddr, faddr, alen) == 0 && -+ memcmp(pladdr, laddr, alen) == 0 && - pcbp.inp_fport == fport && - pcbp.inp_lport == lport) - { -@@ -249,7 +278,7 @@ - ** Return the UID of the connection owner - */ - --int get_user4( in_port_t lport, -+static int get_user( in_port_t lport, - in_port_t fport, - struct sockaddr_storage *laddr, - struct sockaddr_storage *faddr) -@@ -276,8 +305,9 @@ - tcb.inp_prev = (struct inpcb *) kinfo->nl[N_TCB].n_value; - #endif - -- sockp = getlist4(&tcb, lport, fport, -- &SIN4(laddr)->sin_addr, &SIN4(faddr)->sin_addr); -+ sockp = getlist(&tcb, lport, fport, -+ (struct sockaddr *)laddr, -+ (struct sockaddr *)faddr); - - if (sockp == NULL) - return (-1); -@@ -338,6 +368,14 @@ - return (-1); - } - -+int get_user4( in_port_t lport, -+ in_port_t fport, -+ struct sockaddr_storage *laddr, -+ struct sockaddr_storage *faddr) -+{ -+ return (get_user(lport, fport, laddr, faddr)); -+} -+ - #ifdef MASQ_SUPPORT - - /* -@@ -448,36 +486,7 @@ - struct sockaddr_storage *laddr, - struct sockaddr_storage *faddr) - { -- struct ucred ucred; -- struct sockaddr_in6 sin6[2]; -- int len; -- int ret; -- -- len = sizeof(struct ucred); -- -- memset(sin6, 0, sizeof(sin6)); -- -- sin6[0].sin6_len = sizeof(struct sockaddr_in6); -- sin6[0].sin6_family = AF_INET6; -- sin6[0].sin6_port = lport; -- memcpy(&sin6[0].sin6_addr, &SIN6(laddr)->sin6_addr, -- sizeof(sin6[0].sin6_addr)); -- -- sin6[1].sin6_len = sizeof(struct sockaddr_in6); -- sin6[1].sin6_family = AF_INET6; -- sin6[1].sin6_port = fport; -- memcpy(&sin6[1].sin6_addr, &SIN6(faddr)->sin6_addr, -- sizeof(sin6[1].sin6_addr)); -- -- ret = sysctlbyname("net.inet6.tcp6.getcred", -- &ucred, &len, sin6, sizeof(sin6)); -- -- if (ret == -1) { -- debug("sysctlbyname: %s", strerror(errno)); -- return (-1); -- } -- -- return (ucred.cr_uid); -+ return (get_user(lport, fport, laddr, faddr)); - } - - #endif |