Index: ossp-pkg/lmtp2nntp/.configure RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/.configure,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/.configure,v' 2>/dev/null --- .configure 2001/08/20 10:50:07 1.1 +++ .configure 2001/08/20 11:28:29 1.2 @@ -1,5 +1,4 @@ #!/bin/sh ./configure \ --prefix=/tmp/lmtp2nntp \ - --with-str=/cw \ - --enable-debug + --with-str=/cw Index: ossp-pkg/lmtp2nntp/.cvsignore RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/.cvsignore,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/.cvsignore,v' 2>/dev/null --- .cvsignore 2001/08/20 10:33:43 1.5 +++ .cvsignore 2001/08/20 11:28:29 1.6 @@ -3,6 +3,8 @@ configure config.status config.log +config.h +config.h.in lmtp2nntp lmtp2nntp.1 lmtp2nntp-*.tar.gz Index: ossp-pkg/lmtp2nntp/autogen.sh RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/autogen.sh,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/autogen.sh,v' 2>/dev/null --- autogen.sh 2001/08/20 10:33:22 1.2 +++ autogen.sh 2001/08/20 11:28:29 1.3 @@ -35,7 +35,7 @@ # GNU Autoconf generation echo "GNU Autoconf $autoconf_version -> configure, config.h.in" autoconf -#autoheader +autoheader # GNU Shtool generation echo "GNU Shtool $shtoolize_version -> shtool" Index: ossp-pkg/lmtp2nntp/configure.ac RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/configure.ac,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/configure.ac,v' 2>/dev/null --- configure.ac 2001/08/20 10:45:44 1.3 +++ configure.ac 2001/08/20 11:28:29 1.4 @@ -18,8 +18,12 @@ AC_PROG_CPP AC_CHECK_DEBUGGING AC_CHECK_EXTLIB([Generic String Library], str, str_parse, str.h, :, echo "REQUIRE STR!"; exit 1) +AC_CHECK_LIB(socket, getprotobyname) +AC_CHECK_LIB(nsl, gethostbyname) +AC_CHECK_FUNCS(inet_pton inet_aton) dnl # standard output generation +AC_CONFIG_HEADERS(config.h) AC_CONFIG_FILES(Makefile:Makefile.in) AC_OUTPUT Index: ossp-pkg/lmtp2nntp/sa.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/sa.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/sa.c,v' 2>/dev/null --- sa.c 2001/08/12 13:44:10 1.2 +++ sa.c 2001/08/20 11:28:29 1.3 @@ -42,8 +42,34 @@ #include #include +#include "config.h" #include "sa.h" +#if !defined(AF_LOCAL) && defined(AF_UNIX) +#define AF_LOCAL AF_UNIX +#endif + +#ifndef HAVE_INET_PTON +#ifdef HAVE_INET_ATON +static int inet_pton(int family, const char *strptr, void *addrptr) +{ + struct in_addr in_val; + + if (family == AF_INET) { + if (inet_aton(strptr, &in_val)) { + memcpy(addrptr, &in_val, sizeof(struct in_addr)); + return 1; + } + return 0; + } + errno = EAFNOSUPPORT; + return -1; +} +#else +#error "neither inet_pton nor inet_aton available" +#endif +#endif + sa_t *sa_create(int sa_type, ...) { va_list ap; @@ -52,7 +78,9 @@ socklen_t sl; struct sockaddr *sa; struct sockaddr_in sa4; +#ifdef AF_INET6 struct sockaddr_in6 sa6; +#endif struct sockaddr_un sau; struct hostent *he; struct servent *se; @@ -70,6 +98,7 @@ sa = NULL; sl = 0; if (sa_type == SA_UNIX) { +#if defined(AF_LOCAL) if ((cpPath = va_arg(ap, char *)) == NULL) return NULL; if ((nPath = strlen(cpPath)) >= (sizeof(sau.sun_path)-1)) @@ -79,6 +108,9 @@ memcpy(sau.sun_path, cpPath, nPath + 1); sa = (struct sockaddr *)&sau; sl = sizeof(sau); +#else + return NULL; +#endif } else if (sa_type == SA_IP) { if ((cpProto = va_arg(ap, char *)) == NULL) @@ -116,12 +148,14 @@ sa = (struct sockaddr *)&sa4; sl = sizeof(sa4); } +#ifdef AF_INET6 else if (inet_pton(AF_INET6, cpHost, &sa6.sin6_addr.s6_addr) == 1) { sa6.sin6_family = AF_INET6; sa6.sin6_port = htons(nPort); sa = (struct sockaddr *)&sa6; sl = sizeof(sa6); } +#endif else if ((he = gethostbyname(cpHost)) != NULL) { if (he->h_addrtype == AF_INET) { sa4.sin_family = AF_INET; @@ -130,6 +164,7 @@ sa = (struct sockaddr *)&sa4; sl = sizeof(sa4); } +#ifdef AF_INET6 else if (he->h_addrtype == AF_INET6) { sa6.sin6_family = AF_INET6; sa6.sin6_port = htons(nPort); @@ -137,6 +172,7 @@ sa = (struct sockaddr *)&sa6; sl = sizeof(sa6); } +#endif } } else Index: ossp-pkg/lmtp2nntp/trace.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/trace.c,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/trace.c,v' 2>/dev/null --- trace.c 2001/08/14 08:15:26 1.1 +++ trace.c 2001/08/20 11:28:30 1.2 @@ -1,6 +1,19 @@ +#include +#include + #include "trace.h" +#ifndef _POSIX_PATH_MAX +#if defined(PATH_MAX) +#define _POSIX_PATH_MAX PATH_MAX +#elif defined(MAX_PATH) +#define _POSIX_PATH_MAX MAX_PATH +#else +#error "unable to determime maximum path limit" +#endif +#endif + /* * tracing */ @@ -9,10 +22,10 @@ { ssize_t rc; int tf; - static char tfn[PATH_MAX] = "/tmp/trace"; + static char tfn[_POSIX_PATH_MAX] = "/tmp/trace"; if ((d == -1) && (buf != NULL) && (nbytes == 0)) { - strncpy(tfn, buf, PATH_MAX-1); + strncpy(tfn, buf, _POSIX_PATH_MAX-1); } rc = read(d, buf, nbytes); if ((tf = open(tfn, O_CREAT|O_WRONLY|O_APPEND, 0664)) != -1) { @@ -26,10 +39,10 @@ { ssize_t rc; int tf; - static char tfn[PATH_MAX] = "/tmp/trace"; + static char tfn[_POSIX_PATH_MAX] = "/tmp/trace"; if ((d == -1) && (buf != NULL) && (nbytes == 0)) { - strncpy(tfn, buf, PATH_MAX-1); + strncpy(tfn, buf, _POSIX_PATH_MAX-1); } rc = write(d, buf, nbytes); Index: ossp-pkg/lmtp2nntp/trace.h RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/trace.h,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/trace.h,v' 2>/dev/null --- trace.h 2001/08/14 08:15:26 1.1 +++ trace.h 2001/08/20 11:28:30 1.2 @@ -5,10 +5,8 @@ #include #include #include -#include #include #include -#include ssize_t trace_read (int, void *, size_t); ssize_t trace_write(int, const void *, size_t);