diff --git a/security/pidentd/Makefile b/security/pidentd/Makefile index a95e0e975f4d..59cd50bcd6c8 100644 --- a/security/pidentd/Makefile +++ b/security/pidentd/Makefile @@ -7,25 +7,37 @@ # DISTNAME= pidentd-2.8.5 -CATEGORIES= security net +CATEGORIES= security net ipv6 MASTER_SITES= ftp://ftp.lysator.liu.se/pub/ident/servers/ \ ftp://ftp.fu-berlin.de/unix/security/ident/servers/ +PATCH_SITES= http://www.imasy.or.jp/~ume/ipv6/ +PATCHFILES= pidentd-2.8.5-ipv6-1.5.diff.gz +PATCH_DIST_STRIP= -p2 + MAINTAINER= torstenb@FreeBSD.org ALL_TARGET= freebsd MAKE_ENV= REALPREFIX=${PREFIX} MAN8= identd.8 idecrypt.8 +.include + +.if ${OSVERSION} >= 400014 +ADD_GDEFS+= -DINET6 -D__ss_family=ss_family -D__ss_len=ss_len +.endif + # Uncomment to activate the use of verifiable "cookies". The idea is to be # able to detect fake "logs" intended to get your innocent users in trouble. # Naturally, since it uses libdes, you must have the "secure" dist installed. # USE_DES= true .if defined(USE_DES) -ADD_GDEFS= -DINCLUDE_CRYPT +ADD_GDEFS+= -DINCLUDE_CRYPT ADD_GLIBS= -ldes +.endif +.if defined(USE_DES) || ${OSVERSION} >= 400014 MAKE_ENV+= ADD_GDEFS="${ADD_GDEFS}" ADD_GLIBS="${ADD_GLIBS}" .endif -.include +.include diff --git a/security/pidentd/distinfo b/security/pidentd/distinfo index 4d56776585f3..bff1d565a410 100644 --- a/security/pidentd/distinfo +++ b/security/pidentd/distinfo @@ -1 +1,2 @@ MD5 (pidentd-2.8.5.tar.gz) = 15d3d8b7ad9433b91634618b1f7b6417 +MD5 (pidentd-2.8.5-ipv6-1.5.diff.gz) = a8bf86a6f00611c0e3f7e1e153c73d7d diff --git a/security/pidentd/files/patch-al b/security/pidentd/files/patch-al index 427a9f5122d2..d31cbc6acc65 100644 --- a/security/pidentd/files/patch-al +++ b/security/pidentd/files/patch-al @@ -1,6 +1,6 @@ ---- /dev/null Wed Jul 14 15:27:00 1999 -+++ src/freebsd-sysctl.c Thu Jul 8 15:52:57 1999 -@@ -0,0 +1,32 @@ +--- /dev/null Thu Feb 10 20:03:15 2000 ++++ src/freebsd-sysctl.c Thu Feb 10 20:03:40 2000 +@@ -0,0 +1,98 @@ +#include +#include +#include @@ -15,6 +15,71 @@ + return 0; +} + ++#ifdef INET6 ++int k_getuid(struct sockaddr *faddr, int fport, struct sockaddr *laddr, ++ int lport, int *uid) { ++ struct sockaddr_in sin[2]; ++ struct sockaddr_in6 sin6[2]; ++ struct ucred uc; ++ size_t oldlen = sizeof(uc); ++ struct sockaddr *sa; ++ int salen; ++ char *ctlname; ++ ++ if (faddr->sa_family != laddr->sa_family) ++ return -1; ++ if (faddr->sa_family == AF_INET) { ++ sin[0].sin_family = sin[1].sin_family = AF_INET; ++ sin[0].sin_len = sin[1].sin_len = sizeof(struct sockaddr_in); ++ memcpy(&sin[0].sin_addr, ++ &((struct sockaddr_in *)laddr)->sin_addr, ++ sizeof(struct in_addr)); ++ memcpy(&sin[1].sin_addr, ++ &((struct sockaddr_in *)faddr)->sin_addr, ++ sizeof(struct in_addr)); ++ sin[0].sin_port = (u_int16_t)lport; ++ sin[1].sin_port = (u_int16_t)fport; ++ sa = (struct sockaddr *)sin; ++ salen = sizeof(sin); ++ ctlname = "net.inet.tcp.getcred"; ++ } else if (IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)faddr)->sin6_addr)) { ++ sin[0].sin_family = sin[1].sin_family = AF_INET; ++ sin[0].sin_len = sin[1].sin_len = sizeof(struct sockaddr_in); ++ memcpy(&sin[0].sin_addr, ++ &((struct sockaddr_in6 *)laddr)->sin6_addr.s6_addr[12], ++ sizeof(struct in_addr)); ++ memcpy(&sin[1].sin_addr, ++ &((struct sockaddr_in6 *)faddr)->sin6_addr.s6_addr[12], ++ sizeof(struct in_addr)); ++ sin[0].sin_port = (u_int16_t)lport; ++ sin[1].sin_port = (u_int16_t)fport; ++ sa = (struct sockaddr *)sin; ++ salen = sizeof(sin); ++ ctlname = "net.inet.tcp.getcred"; ++ } else { ++ sin6[0].sin6_family = sin6[1].sin6_family = AF_INET6; ++ sin6[0].sin6_len = sin6[1].sin6_len ++ = sizeof(struct sockaddr_in6); ++ memcpy(&sin6[0].sin6_addr, ++ &((struct sockaddr_in6 *)laddr)->sin6_addr, ++ sizeof(struct in6_addr)); ++ memcpy(&sin6[1].sin6_addr, ++ &((struct sockaddr_in6 *)faddr)->sin6_addr, ++ sizeof(struct in6_addr)); ++ sin6[0].sin6_port = (u_int16_t)lport; ++ sin6[1].sin6_port = (u_int16_t)fport; ++ sa = (struct sockaddr *)sin6; ++ salen = sizeof(sin6); ++ ctlname = "net.inet6.tcp6.getcred"; ++ } ++ ++ if (sysctlbyname(ctlname, &uc, &oldlen, sa, salen)) ++ return -1; ++ ++ *uid = uc.cr_uid; ++ return 0; ++} ++#else +int k_getuid(struct in_addr *faddr, int fport, struct in_addr *laddr, + int lport, int *uid) { + struct sockaddr_in sin[2]; @@ -33,3 +98,4 @@ + *uid = uc.cr_uid; + return 0; +} ++#endif