diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2002-01-12 13:04:42 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2002-01-12 13:04:42 +0000 |
commit | 12423e6cf01721c16a92705333211fcf7461f570 (patch) | |
tree | 908bd5ac5d3b0b6047a906848f3ae7bf7dfae584 /mail | |
parent | 8c1545f23596a8a9db30ef309520231470af85c6 (diff) | |
download | ports-12423e6cf01721c16a92705333211fcf7461f570.tar.gz ports-12423e6cf01721c16a92705333211fcf7461f570.zip |
Notes
Diffstat (limited to 'mail')
-rw-r--r-- | mail/popa3d/Makefile | 19 | ||||
-rw-r--r-- | mail/popa3d/distinfo | 3 | ||||
-rw-r--r-- | mail/popa3d/files.smtp/patch-aa | 37 | ||||
-rw-r--r-- | mail/popa3d/files.smtp/patch-ab | 23 | ||||
-rw-r--r-- | mail/popa3d/files.smtp/patch-pop_auth.c | 11 | ||||
-rw-r--r-- | mail/popa3d/files.smtp/patch-pop_pbs.c | 11 | ||||
-rw-r--r-- | mail/popa3d/files.smtp/patch-pop_root.c | 18 | ||||
-rw-r--r-- | mail/popa3d/files/POPAUTH (renamed from mail/popa3d/files.smtp/POPAUTH) | 0 | ||||
-rw-r--r-- | mail/popa3d/files/patch-aa | 43 | ||||
-rw-r--r-- | mail/popa3d/files/patch-ab | 40 | ||||
-rw-r--r-- | mail/popa3d/files/pop-before-sendmail.patch | 184 | ||||
-rw-r--r-- | mail/popa3d/files/popauth.m4 (renamed from mail/popa3d/files.smtp/popauth.m4) | 0 | ||||
-rw-r--r-- | mail/popa3d/pkg-plist | 2 |
13 files changed, 225 insertions, 166 deletions
diff --git a/mail/popa3d/Makefile b/mail/popa3d/Makefile index a2c7e3f22505..671bda34f66f 100644 --- a/mail/popa3d/Makefile +++ b/mail/popa3d/Makefile @@ -6,7 +6,7 @@ # PORTNAME= popa3d -PORTVERSION= 0.4 +PORTVERSION= 0.5 CATEGORIES= mail MASTER_SITES= http://www.openwall.com/popa3d/ \ ftp://ftp.openwall.com/popa3d/ \ @@ -16,18 +16,12 @@ MASTER_SITES= http://www.openwall.com/popa3d/ \ PKGNAMESUFFIX?= -before-sendmail .endif -.if defined(SMTP_AFTER_POP3) -PATCH_SITES= http://www.openwall.com/popa3d/contrib/ -PATCHFILES= popa3d-0.4-before-sendmail.tar.gz -PATCH_DIST_STRIP= -p1 -.endif - -MAINTAINER= gonza@techline.ru +MAINTAINER= dinoex@FreeBSD.org ALL_TARGET= popa3d .if defined(SMTP_AFTER_POP3) -PATCHDIR= ${MASTERDIR}/files.smtp +EXTRA_PATCHES+= ${FILESDIR}/pop-before-sendmail.patch PLIST= ${WRKDIR}/.PLIST.more pre-configure: @@ -36,7 +30,6 @@ pre-configure: @${ECHO} "share/sendmail/cf/hack/popauth.m4" >>${PLIST} post-patch: - @${PERL5} -pi -e "s=LOG_MAIL=LOG_DAEMON=" ${WRKSRC}/params.h @${PERL5} -pi -e "s=db1/db.h=db.h=" ${WRKSRC}/pop_root.c .endif @@ -47,14 +40,14 @@ do-install: ${INSTALL} ${COPY} -o root -g wheel -m 500 \ ${WRKSRC}/popa3d ${PREFIX}/libexec/popa3d .if defined(SMTP_AFTER_POP3) - ${INSTALL_DATA} ${PATCHDIR}/popauth.m4 ${CFDIR}/hack + ${INSTALL_DATA} ${FILESDIR}/popauth.m4 ${CFDIR}/hack .endif .if !defined(NOPORTDOCS) ${MKDIR} ${PREFIX}/share/doc/popa3d ${INSTALL_MAN} ${WRKSRC}/DESIGN ${PREFIX}/share/doc/popa3d - ${INSTALL_MAN} ${WRKSRC}/COPYING ${PREFIX}/share/doc/popa3d + ${INSTALL_MAN} ${WRKSRC}/LICENSE ${PREFIX}/share/doc/popa3d .if defined(SMTP_AFTER_POP3) - ${INSTALL_DATA} ${PATCHDIR}/POPAUTH ${PREFIX}/share/doc/popa3d + ${INSTALL_DATA} ${FILESDIR}/POPAUTH ${PREFIX}/share/doc/popa3d .endif .endif diff --git a/mail/popa3d/distinfo b/mail/popa3d/distinfo index aff3cb035e42..f6f322249136 100644 --- a/mail/popa3d/distinfo +++ b/mail/popa3d/distinfo @@ -1,2 +1 @@ -MD5 (popa3d-0.4.tar.gz) = 4ce2ed209abeaeaae7724d8d24bb7dbf -MD5 (popa3d-0.4-before-sendmail.tar.gz) = 8e1aed8c86e1df777eee116667ad9d54 +MD5 (popa3d-0.5.tar.gz) = ffe1644da7ffd0e66bf7e1c671f729aa diff --git a/mail/popa3d/files.smtp/patch-aa b/mail/popa3d/files.smtp/patch-aa deleted file mode 100644 index b873e9ac3561..000000000000 --- a/mail/popa3d/files.smtp/patch-aa +++ /dev/null @@ -1,37 +0,0 @@ ---- params.h.orig Tue Feb 1 09:16:24 2000 -+++ params.h Sat Mar 4 16:12:48 2000 -@@ -33,7 +33,7 @@ - * An unprivileged dummy user to run as before authentication. The user - * and its UID must not be used for any other purpose. - */ --#define POP_USER "popa3d" -+#define POP_USER "pop" - - /* - * Sessions will be closed if idle for longer than POP_TIMEOUT seconds. -@@ -62,7 +62,7 @@ - * Do we have shadow passwords? (Not for *BSD.) - * Note: password aging is not supported. - */ --#define AUTH_SHADOW 1 -+#define AUTH_SHADOW 0 - - /* - * A salt used to waste some CPU time on dummy crypt(3) calls and make -@@ -81,14 +81,14 @@ - * Your mail spool directory. Note: only local (non-NFS) mode 775 mail - * spools are currently supported. - */ --#define MAIL_SPOOL_PATH "/var/spool/mail" -+#define MAIL_SPOOL_PATH "/var/mail" - - /* - * How do we talk to syslogd? These should be fine for most systems. - */ - #define SYSLOG_IDENT "popa3d" - #define SYSLOG_OPTIONS LOG_PID --#define SYSLOG_FACILITY LOG_DAEMON -+#define SYSLOG_FACILITY LOG_MAIL - #define SYSLOG_PRIORITY LOG_NOTICE - - /* diff --git a/mail/popa3d/files.smtp/patch-ab b/mail/popa3d/files.smtp/patch-ab deleted file mode 100644 index 2565bb67698a..000000000000 --- a/mail/popa3d/files.smtp/patch-ab +++ /dev/null @@ -1,23 +0,0 @@ ---- Makefile.orig Mon Jul 16 11:35:16 2001 -+++ Makefile Mon Jul 16 11:43:29 2001 -@@ -1,9 +1,8 @@ --CC = gcc --LD = gcc -+CC? = gcc - RM = rm -f - CFLAGS = -c -Wall -O2 -fomit-frame-pointer -DPOPB4SMTP -DVALIDTIME=600 - #LDFLAGS = -s --LDFLAGS = -s -lcrypt -ldb1 -+LDFLAGS = -s -lcrypt - - - PROJ = popa3d -@@ -14,7 +13,7 @@ - misc.o pop_pbs.o - - popa3d: $(OBJS) -- $(LD) $(LDFLAGS) $(OBJS) -o popa3d -+ $(CC) $(LDFLAGS) $(OBJS) -o popa3d - - md5/md5.o: md5/md5.c md5/md5.h - $(CC) $(CFLAGS) -D_LIBC md5/md5.c -o md5/md5.o diff --git a/mail/popa3d/files.smtp/patch-pop_auth.c b/mail/popa3d/files.smtp/patch-pop_auth.c deleted file mode 100644 index fe0638ac55a7..000000000000 --- a/mail/popa3d/files.smtp/patch-pop_auth.c +++ /dev/null @@ -1,11 +0,0 @@ ---- pop_auth.c.orig Mon Jul 16 11:51:30 2001 -+++ pop_auth.c Mon Jul 16 11:54:35 2001 -@@ -12,6 +12,8 @@ - #include "protocol.h" - #include "pop_auth.h" - -+char *client_addr(int); -+ - static char *pop_user, *pop_pass; - - static int pop_auth_quit(char *params) diff --git a/mail/popa3d/files.smtp/patch-pop_pbs.c b/mail/popa3d/files.smtp/patch-pop_pbs.c deleted file mode 100644 index 397de2d09e9c..000000000000 --- a/mail/popa3d/files.smtp/patch-pop_pbs.c +++ /dev/null @@ -1,11 +0,0 @@ ---- pop_pbs.c.orig Mon Jul 16 11:38:00 2001 -+++ pop_pbs.c Mon Jul 16 11:41:40 2001 -@@ -1,6 +1,7 @@ -+#include <sys/types.h> - #include <sys/socket.h> -+#include <netinet/in.h> - #include <arpa/inet.h> --#include <sys/types.h> - #include <sys/stat.h> - - char addr_buf[256]; diff --git a/mail/popa3d/files.smtp/patch-pop_root.c b/mail/popa3d/files.smtp/patch-pop_root.c deleted file mode 100644 index cdc98a60e1f5..000000000000 --- a/mail/popa3d/files.smtp/patch-pop_root.c +++ /dev/null @@ -1,18 +0,0 @@ ---- pop_root.c.neu.orig Mon Jul 16 11:55:05 2001 -+++ pop_root.c Tue Jul 17 11:45:22 2001 -@@ -210,6 +210,7 @@ - sem=sem_attach(0x50413453); - sem_enter(sem); - db=dbopen("/etc/mail/popauth.db",O_RDWR,0664,DB_HASH,0 ); -+ if ( db != NULL ) { - key.data=client_addr(1); - key.size=strlen(key.data); - sprintf(ts,"%d",(int)time(0)); -@@ -233,6 +234,7 @@ - ret=db->seq(db,&key,&data,R_NEXT); - } - db->close(db); -+ } - sem_leave(sem); - #endif - diff --git a/mail/popa3d/files.smtp/POPAUTH b/mail/popa3d/files/POPAUTH index abb368505724..abb368505724 100644 --- a/mail/popa3d/files.smtp/POPAUTH +++ b/mail/popa3d/files/POPAUTH diff --git a/mail/popa3d/files/patch-aa b/mail/popa3d/files/patch-aa index b873e9ac3561..7d0d1221a136 100644 --- a/mail/popa3d/files/patch-aa +++ b/mail/popa3d/files/patch-aa @@ -1,37 +1,22 @@ ---- params.h.orig Tue Feb 1 09:16:24 2000 -+++ params.h Sat Mar 4 16:12:48 2000 -@@ -33,7 +33,7 @@ - * An unprivileged dummy user to run as before authentication. The user - * and its UID must not be used for any other purpose. +--- params.h.orig Tue Oct 16 06:10:34 2001 ++++ params.h Sat Dec 22 11:57:52 2001 +@@ -99,7 +99,7 @@ + * A pseudo-user to run as before authentication. The user and its UID + * must not be used for any other purpose. */ --#define POP_USER "popa3d" +-#define POP_USER POP_SERVER +#define POP_USER "pop" /* - * Sessions will be closed if idle for longer than POP_TIMEOUT seconds. -@@ -62,7 +62,7 @@ - * Do we have shadow passwords? (Not for *BSD.) - * Note: password aging is not supported. + * An empty directory to chroot to before authentication. The directory +@@ -142,8 +142,8 @@ + * + * Note that there's no built-in password aging support. */ +-#define AUTH_PASSWD 0 -#define AUTH_SHADOW 1 ++#define AUTH_PASSWD 1 +#define AUTH_SHADOW 0 + #define AUTH_PAM 0 + #define AUTH_PAM_USERPASS 0 - /* - * A salt used to waste some CPU time on dummy crypt(3) calls and make -@@ -81,14 +81,14 @@ - * Your mail spool directory. Note: only local (non-NFS) mode 775 mail - * spools are currently supported. - */ --#define MAIL_SPOOL_PATH "/var/spool/mail" -+#define MAIL_SPOOL_PATH "/var/mail" - - /* - * How do we talk to syslogd? These should be fine for most systems. - */ - #define SYSLOG_IDENT "popa3d" - #define SYSLOG_OPTIONS LOG_PID --#define SYSLOG_FACILITY LOG_DAEMON -+#define SYSLOG_FACILITY LOG_MAIL - #define SYSLOG_PRIORITY LOG_NOTICE - - /* diff --git a/mail/popa3d/files/patch-ab b/mail/popa3d/files/patch-ab index b08ab0b7125b..122542270080 100644 --- a/mail/popa3d/files/patch-ab +++ b/mail/popa3d/files/patch-ab @@ -1,24 +1,22 @@ ---- Makefile.orig Tue Feb 1 06:56:46 2000 -+++ Makefile Sat Mar 4 18:34:28 2000 -@@ -1,9 +1,8 @@ +--- Makefile.orig Sun Oct 28 02:10:49 2001 ++++ Makefile Sat Dec 22 11:59:22 2001 +@@ -1,15 +1,15 @@ -CC = gcc -LD = gcc -+CC?= gcc ++CC? = gcc ++LD = ${CC} RM = rm -f - CFLAGS = -c -Wall -O2 -fomit-frame-pointer --LDFLAGS = -s --#LDFLAGS = -s -lcrypt -+#LDFLAGS = -s -+LDFLAGS = -s -lcrypt - - PROJ = popa3d - OBJS = md5/md5.o \ -@@ -13,7 +12,7 @@ - misc.o - - popa3d: $(OBJS) -- $(LD) $(LDFLAGS) $(OBJS) -o popa3d -+ $(CC) $(LDFLAGS) $(OBJS) -o popa3d - - md5/md5.o: md5/md5.c md5/md5.h - $(CC) $(CFLAGS) -D_LIBC md5/md5.c -o md5/md5.o + MKDIR = mkdir -p + INSTALL = install +-CFLAGS = -c -Wall -O2 -fomit-frame-pointer ++CFLAGS += -c -Wall -O2 -fomit-frame-pointer + # You may use OpenSSL's MD5 routines instead of the ones supplied here + #CFLAGS += -DHAVE_OPENSSL + LDFLAGS = -s + LIBS = + # Linux with glibc, FreeBSD, NetBSD +-#LIBS += -lcrypt ++LIBS += -lcrypt + # HP-UX trusted system + #LIBS += -lsec + # Solaris (POP_STANDALONE, POP_VIRTUAL) diff --git a/mail/popa3d/files/pop-before-sendmail.patch b/mail/popa3d/files/pop-before-sendmail.patch new file mode 100644 index 000000000000..b50e65f37847 --- /dev/null +++ b/mail/popa3d/files/pop-before-sendmail.patch @@ -0,0 +1,184 @@ +--- Makefile.orig Sat Dec 22 12:00:30 2001 ++++ Makefile Sat Dec 22 12:20:30 2001 +@@ -39,6 +39,9 @@ + misc.o \ + md5/md5.o + ++OBJS += pop_db.o ++CFLAGS += -DPOPB4SMTP -DVALIDTIME=600 ++ + all: $(PROJ) + + popa3d: $(OBJS) +--- pop_auth.c.orig Thu Sep 6 01:52:35 2001 ++++ pop_auth.c Sat Dec 22 17:41:02 2001 +@@ -14,6 +14,7 @@ + #if POP_VIRTUAL + #include "virtual.h" + #endif ++#include "pop_db.h" + + static char *pop_user, *pop_pass; + +@@ -75,15 +76,17 @@ + #if POP_VIRTUAL + if (virtual_domain) { + syslog(result == AUTH_OK ? SYSLOG_PRI_LO : SYSLOG_PRI_HI, +- "Authentication %s for %s@%s", ++ "Authentication %s for %s@%s from %s", + result == AUTH_OK ? "passed" : "failed", + user ? user : "UNKNOWN USER", +- virtual_domain); ++ virtual_domain, ++ client_addr(1) ); + return; + } + #endif + syslog(result == AUTH_OK ? SYSLOG_PRI_LO : SYSLOG_PRI_HI, +- "Authentication %s for %s", ++ "Authentication %s for %s from %s", + result == AUTH_OK ? "passed" : "failed", +- user ? user : "UNKNOWN USER"); ++ user ? user : "UNKNOWN USER", ++ client_addr(1)); + } +--- pop_db.c.orig Sat Dec 22 15:55:37 2001 ++++ pop_db.c Sat Dec 22 17:41:50 2001 +@@ -0,0 +1,107 @@ ++ ++#include <sys/types.h> ++#include <sys/socket.h> ++#include <netinet/in.h> ++#include <arpa/inet.h> ++#include <sys/stat.h> ++ ++#ifdef POPB4SMTP ++#include <fcntl.h> ++#include <db.h> ++#include <time.h> ++#include <stdio.h> ++#include <string.h> ++#include <stdlib.h> ++#endif ++ ++#include "pop_db.h" ++ ++int log_error(char *s); ++ ++ ++/* Function from G.Glendown Dec 2000 */ ++ ++char addr_buf[256]; ++ ++char *client_addr(int fd) ++{ ++ struct sockaddr sa; ++ struct sockaddr_in *sockin = (struct sockaddr_in *) (&sa); ++ int length = sizeof(sa); ++ ++ strcpy(addr_buf,"0.0.0.0"); ++ ++ if (fd == -1) { ++ return addr_buf; ++ } ++ ++ if (getpeername(fd, &sa, &length) < 0) { ++ return addr_buf; ++ } ++ ++ strcpy(addr_buf, (char *)inet_ntoa(sockin->sin_addr)); ++ return addr_buf; ++} ++ ++#ifdef POPB4SMTP ++ ++/* Function written by Dirk Meyer */ ++ ++void write_db_entry(void) ++{ ++ DB *db; ++ DBT key, data; ++ char ts[16]; ++ int ret, fd, st; ++ time_t tv; ++ ++ /* create is not set, this is intended, ++ function will be ignored, if database was not created */ ++ db = dbopen("/etc/mail/popauth.db", O_RDWR, 0644, DB_HASH, NULL); ++ if ( db == NULL ) ++ return; ++ ++ /* lock all changes */ ++ fd = db->fd(db); ++ if ( fd == -1 ) { ++ st = -1; ++ log_error( "db->fd() failed" ); ++ } else { ++ st = flock(fd, LOCK_EX); ++ } ++ ++ if (st == 0) { ++ /* generate entry */ ++ key.data = client_addr(1); ++ key.size = strlen(key.data); ++ sprintf(ts, "%lu", (long)time(NULL)); ++ data.data = ts; ++ data.size = strlen(ts); ++ db->put(db, &key, &data, 0); ++ db->sync(db,0); ++ ++ /* cleanup old entrys */ ++ ret = db->seq(db, &key, &data, R_FIRST); ++ while (!ret) { ++ data.size = data.size < 16 ? data.size : 15; ++ strncpy(ts,data.data, data.size); ++ ts[data.size] = 0; ++ tv = atol(ts); ++ if ((tv+VALIDTIME) < time(NULL)) { ++ db->del(db, &key, 0); ++ db->sync(db, 0); ++ /* start over */ ++ ret = db->seq(db, &key, &data, R_FIRST); ++ continue; ++ } ++ ret = db->seq(db, &key, &data, R_NEXT); ++ } ++ st = flock(fd, LOCK_UN); ++ } else { ++ log_error( "lock() failed" ); ++ } ++ db->close(db); ++} ++ ++#endif ++ +--- pop_db.h.orig Sat Dec 22 15:55:37 2001 ++++ pop_db.h Sat Dec 22 15:55:37 2001 +@@ -0,0 +1,4 @@ ++ ++char *client_addr(int fd); ++void write_db_entry(void); ++ +--- pop_root.c.orig Sat Sep 8 14:58:32 2001 ++++ pop_root.c Sat Dec 22 17:27:37 2001 +@@ -32,6 +32,9 @@ + #if POP_VIRTUAL + #include "virtual.h" + #endif ++#ifdef POPB4SMTP ++#include "pop_db.h" ++#endif + + #if !VIRTUAL_ONLY + extern struct passwd *auth_userpass(char *user, char *pass, int *known); +@@ -151,6 +154,10 @@ + if (!*pass) return AUTH_FAILED; + memset(pass, 0, strlen(pass)); + if (!*user) return AUTH_FAILED; ++ ++#ifdef POPB4SMTP ++ write_db_entry(); ++#endif + + if (set_user(pw)) return AUTH_FAILED; + diff --git a/mail/popa3d/files.smtp/popauth.m4 b/mail/popa3d/files/popauth.m4 index 2520978ad904..2520978ad904 100644 --- a/mail/popa3d/files.smtp/popauth.m4 +++ b/mail/popa3d/files/popauth.m4 diff --git a/mail/popa3d/pkg-plist b/mail/popa3d/pkg-plist index 0567735d177d..ed48f930d33b 100644 --- a/mail/popa3d/pkg-plist +++ b/mail/popa3d/pkg-plist @@ -1,5 +1,5 @@ @comment $FreeBSD$ libexec/popa3d %%PORTDOCS%%share/doc/popa3d/DESIGN -%%PORTDOCS%%share/doc/popa3d/COPYING +%%PORTDOCS%%share/doc/popa3d/LICENSE %%PORTDOCS%%@dirrm share/doc/popa3d |