diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2001-07-30 15:51:33 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2001-07-30 15:51:33 +0000 |
commit | 919e336a9b4519fb9c30b628783f05de47fa27dc (patch) | |
tree | 13c70dfd754f9b9dcd3cf0b52773a61290d9df5f /mail/popper | |
parent | New port rain version 1.2.7 Beta 3: Rain is a packeting tool used (diff) |
Switch to OPIE
Diffstat (limited to 'mail/popper')
-rw-r--r-- | mail/popper/Makefile | 8 | ||||
-rw-r--r-- | mail/popper/files/patch-ab | 195 | ||||
-rw-r--r-- | mail/popper/files/patch-af | 45 | ||||
-rw-r--r-- | mail/popper/files/patch-ak | 18 | ||||
-rw-r--r-- | mail/popper/files/patch-am | 56 | ||||
-rw-r--r-- | mail/popper/scripts/pre-install | 2 |
6 files changed, 186 insertions, 138 deletions
diff --git a/mail/popper/Makefile b/mail/popper/Makefile index af55d4791f5f..7e1f37e64bcf 100644 --- a/mail/popper/Makefile +++ b/mail/popper/Makefile @@ -7,7 +7,7 @@ PORTNAME= qpopper PORTVERSION= 2.53 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail MASTER_SITES= ftp://ftp.qualcomm.com/eudora/servers/unix/popper/old/ DISTNAME= ${PORTNAME}${PORTVERSION} @@ -28,10 +28,8 @@ O_DEFS= -DSETPROCTITLE -DKEEP_TEMP_DROP -DBSD44_DBM -DBIND43 \ -DBULLDB -DNONAUTHFILE='\"/etc/ftpusers\"' .if !defined(APOP_ONLY) -.if exists(/usr/lib/libskey.a) -P_LIBS= -lskey -O_DEFS+= -DSKEY -.endif +P_LIBS= -lopie +O_DEFS+= -DOPIE .else O_DEFS+= -DAPOP_ONLY .endif diff --git a/mail/popper/files/patch-ab b/mail/popper/files/patch-ab index 483cc435ea27..b106989e561c 100644 --- a/mail/popper/files/patch-ab +++ b/mail/popper/files/patch-ab @@ -1,123 +1,74 @@ -SKEY + pw_expire patches - -*** pop_pass.c.orig Fri May 24 22:26:25 1996 ---- pop_pass.c Tue Dec 10 23:52:23 1996 -*************** -*** 482,497 **** - POP * p; - struct passwd * pw; - { - /* We don't accept connections from users with null passwords */ - /* Compare the supplied password with the password file entry */ - -! if ((pw->pw_passwd == NULL) || (*pw->pw_passwd == '\0') || -! strcmp(crypt(p->pop_parm[1], pw->pw_passwd), pw->pw_passwd)) { -! sleep(SLEEP_SECONDS); -! return (pop_msg(p,POP_FAILURE, pwerrmsg, p->user)); - } - - return(POP_SUCCESS); - } - - #endif /* AUTH */ ---- 482,530 ---- - POP * p; - struct passwd * pw; - { -+ #ifdef SKEY -+ int pass_ok; -+ #endif -+ #if defined(BSD) && (BSD >= 199306) -+ /* Check password change and expire times before granting access */ -+ time_t now = time((time_t *) NULL); -+ -+ if ((pw->pw_change && now > pw->pw_change) || -+ (pw->pw_expire && now > pw->pw_expire)) -+ goto error; -+ #endif -+ - /* We don't accept connections from users with null passwords */ -+ if ((pw->pw_passwd == NULL) || (*pw->pw_passwd == '\0')) -+ goto error; -+ - /* Compare the supplied password with the password file entry */ -+ #ifdef SKEY -+ pass_ok = skeyaccess(p->user, NULL, p->client, p->ipaddr); -+ if (strcmp(skey_crypt(p->pop_parm[1], pw->pw_passwd, pw, pass_ok), -+ pw->pw_passwd)) { -+ static char buf[128]; -+ struct skey skey; - -! if (skeychallenge(&skey, p->user, buf)) -! goto error; -! if (pass_ok) -! sleep(SLEEP_SECONDS); -! return (pop_msg(p,POP_FAILURE, -! "\"%s\" %s%s, password is incorrect.", -! p->user, buf, -! pass_ok ? "" : " (required)")); - } -+ #else -+ if (strcmp(crypt(p->pop_parm[1], pw->pw_passwd), pw->pw_passwd)) -+ goto error; -+ #endif - - return(POP_SUCCESS); -+ -+ error: -+ sleep(SLEEP_SECONDS); -+ return (pop_msg(p,POP_FAILURE, pwerrmsg, p->user)); - } - - #endif /* AUTH */ -*** pop_user.c.orig Sat Mar 29 07:30:36 1997 ---- pop_user.c Wed Apr 23 07:03:37 1997 -*************** -*** 163,168 **** ---- 163,180 ---- - } - #endif /* APOP */ - -+ #ifdef SKEY -+ { -+ static char buf[128]; -+ struct skey skey; -+ -+ if (!skeychallenge(&skey, p->user, buf)) -+ return(pop_msg(p,POP_SUCCESS,"%s%s", buf, -+ skeyaccess(p->user, NULL, p->client, p->ipaddr) ? -+ "" : " (required)")); +--- pop_pass.c.orig Mon Jul 30 19:29:19 2001 ++++ pop_pass.c Mon Jul 30 19:29:25 2001 +@@ -19,6 +19,12 @@ + #include <pwd.h> + #include "popper.h" + ++#ifdef OPIE ++#include <opie.h> ++extern int pwok; ++extern struct opie opiestate; ++#endif /* OPIE */ ++ + #define SLEEP_SECONDS 10 + + +@@ -487,16 +493,28 @@ + POP * p; + struct passwd * pw; + { ++#if defined(BSD) && (BSD >= 199306) ++ /* Check password change and expire times before granting access */ ++ time_t now = time((time_t *) NULL); ++ ++ if ((pw->pw_change && now > pw->pw_change) || ++ (pw->pw_expire && now > pw->pw_expire)) ++ goto error; ++#endif ++ + /* We don't accept connections from users with null passwords */ +- /* Compare the supplied password with the password file entry */ ++ if ((pw->pw_passwd == NULL) || (*pw->pw_passwd == '\0')) ++ goto error; + +- if ((pw->pw_passwd == NULL) || (*pw->pw_passwd == '\0') || +- strcmp(crypt(p->pop_parm[1], pw->pw_passwd), pw->pw_passwd)) { +- sleep(SLEEP_SECONDS); +- return (pop_msg(p,POP_FAILURE, pwerrmsg, p->user)); +- } ++ /* Compare the supplied password with the password file entry */ ++ if (strcmp(crypt(p->pop_parm[1], pw->pw_passwd), pw->pw_passwd)) ++ goto error; + + return(POP_SUCCESS); ++ ++ error: ++ sleep(SLEEP_SECONDS); ++ return (pop_msg(p,POP_FAILURE, pwerrmsg, p->user)); + } + + #endif /* AUTH_SPECIAL */ +@@ -611,12 +629,23 @@ + return(pop_msg(p, POP_FAILURE, "\"%s\": shell not found.", p->user)); + #endif + ++#ifdef OPIE ++ if (opieverify(&opiestate, p->pop_parm[1])) { ++ if (pwok) { ++#endif /* OPIE */ + if ((p->kerberos ? auth_user_kerberos(p, pw) : auth_user(p, pwp)) + != POP_SUCCESS) { + pop_log(p,POP_PRIORITY,"Failed attempted login to %s from host %s", + p->user, p->client); + return(POP_FAILURE); + } ++#ifdef OPIE ++ } else { ++ sleep(SLEEP_SECONDS); ++ return (pop_msg(p,POP_FAILURE, pwerrmsg, p->user)); ++ } + } -+ #endif -+ - /* Tell the user that the password is required */ - return (pop_msg(p,POP_SUCCESS,"Password required for %s.",p->user)); - } -*** popper.h.orig Thu Nov 20 00:20:39 1997 ---- popper.h Thu Nov 20 16:27:10 1997 -*************** -*** 31,41 **** - - #ifdef HAVE_SYS_PARAM_H - #include <sys/param.h> -- # if (defined(BSD) && (BSD >= 199103)) -- # define HAVE_UNISTD_H -- # define HAVE_VPRINTF -- # define BIND43 -- # endif - #endif - - #ifdef BSDI ---- 31,36 ---- -*************** -*** 308,313 **** ---- 303,311 ---- - extern AUTH_DAT kdata; - #endif /* KERBEROS */ - -+ #if defined(SKEY) -+ #include <skey.h> -+ #endif - #if defined(AUTHFILE) - extern int checkauthfile(); - #endif ++#endif /* OPIE */ + + #ifdef SECURENISPLUS + seteuid(uid_save); diff --git a/mail/popper/files/patch-af b/mail/popper/files/patch-af new file mode 100644 index 000000000000..c2fac6abc345 --- /dev/null +++ b/mail/popper/files/patch-af @@ -0,0 +1,45 @@ +--- pop_user.c.orig Fri Jul 10 03:44:08 1998 ++++ pop_user.c Mon Jul 30 19:30:00 2001 +@@ -40,6 +40,12 @@ + + #include "popper.h" + ++#ifdef OPIE ++#include <opie.h> ++int pwok, af_pwok; ++struct opie opiestate; ++#endif /* OPIE */ ++ + /* + * user: Prompt for the user name at the start of a POP session + */ +@@ -62,6 +68,9 @@ + struct stat st; + datum key, value; + # endif ++#ifdef OPIE ++ char prompt[OPIE_CHALLENGE_MAX + 1]; ++#endif /* OPIE */ + + #ifdef KERBEROS + if (p->kerberos && strcmp(p->pop_parm[1], p->user)) { +@@ -167,6 +176,19 @@ + #endif /* APOP */ + + /* Tell the user that the password is required */ ++#ifdef OPIE ++ if (((pw = getpwnam(p->user)) == NULL) || (pw->pw_passwd == NULL) || ++ (*pw->pw_passwd == '\0')) ++ return (pop_auth_fail(p, POP_FAILURE, pwerrmsg, p->user)); ++ ++ pwok = af_pwok && opiealways(pw->pw_dir); ++ ++ opiechallenge(&opiestate, p->user, prompt); ++ ++ return (pop_msg(p,POP_SUCCESS,"OTP response %s %s for %s.", prompt, ++ pwok ? "requested" : "required", p->user)); ++#else /* OPIE */ + return (pop_msg(p,POP_SUCCESS,"Password required for %s.",p->user)); ++#endif /* OPIE */ + } + diff --git a/mail/popper/files/patch-ak b/mail/popper/files/patch-ak index a683dd4cefb5..53f66e69d88d 100644 --- a/mail/popper/files/patch-ak +++ b/mail/popper/files/patch-ak @@ -1,6 +1,18 @@ ---- popper.h.orig Mon Apr 17 22:33:43 2000 -+++ popper.h Mon Apr 17 22:50:27 2000 -@@ -55,11 +55,14 @@ +--- popper.h.orig Mon Jul 30 19:28:19 2001 ++++ popper.h Mon Jul 30 19:30:20 2001 +@@ -31,11 +31,6 @@ + + #ifdef HAVE_SYS_PARAM_H + #include <sys/param.h> +-# if (defined(BSD) && (BSD >= 199103)) +-# define HAVE_UNISTD_H +-# define HAVE_VPRINTF +-# define BIND43 +-# endif + #endif + + #ifdef BSDI +@@ -60,11 +55,14 @@ #define MAXUSERNAMELEN 65 #define MAXDROPLEN 64 diff --git a/mail/popper/files/patch-am b/mail/popper/files/patch-am index f776dcf43056..597d7e2b6d47 100644 --- a/mail/popper/files/patch-am +++ b/mail/popper/files/patch-am @@ -1,34 +1,76 @@ ---- pop_init.c.orig Thu Jul 9 19:44:07 1998 -+++ pop_init.c Mon Jul 12 22:56:01 1999 -@@ -237,4 +237,4 @@ +--- pop_init.c.orig Fri Jul 10 03:44:07 1998 ++++ pop_init.c Mon Jul 30 19:29:00 2001 +@@ -32,6 +32,11 @@ + # include <strings.h> + #endif + ++#ifdef OPIE ++#include <opie.h> ++extern int af_pwok; ++#endif /* OPIE */ ++ + #ifndef HAVE_INDEX + # define index(s,c) strchr(s,c) + # define rindex(s,c) strrchr(s,c) +@@ -113,6 +118,10 @@ + } + #endif /* KERBEROS */ + ++#ifdef OPIE ++ af_pwok = opieaccessfile(p->client); ++#endif /* OPIE */ ++ + return(POP_SUCCESS); + } + +@@ -235,8 +244,8 @@ + + if ((p->trace = fopen(optarg,"a+")) == NULL) { pop_log(p,POP_PRIORITY, - "Unable to open trace file \"%s\", err = %d", - optarg,errno); + "Unable to open trace file \"%s\": ", + optarg, strerror(errno)); exit(1); -@@ -268,3 +268,4 @@ + } + trace_file_name = optarg; +@@ -266,7 +275,8 @@ + len = sizeof(cs); + if (getpeername(sp,(struct sockaddr *)&cs,&len) < 0){ pop_log(p,POP_PRIORITY, - "Unable to obtain socket and address of client, err = %d",errno); + "Unable to obtain socket and address of client: %s", + strerror(errno)); exit(1); -@@ -283,4 +284,4 @@ + } + +@@ -281,8 +291,8 @@ + ch = gethostbyaddr((char *) &cs.sin_addr, sizeof(cs.sin_addr), AF_INET); + if (ch == NULL){ pop_log(p,POP_PRIORITY, - "(v%s) Unable to get canonical name of client, err = %d", - VERSION, errno); + "(v"VERSION") Unable to get canonical name of client %s: %s", + p->ipaddr, hstrerror(h_errno)); p->client = p->ipaddr; -@@ -362,3 +363,4 @@ + } + /* Save the cannonical name of the client host in +@@ -360,14 +370,16 @@ + /* Create input file stream for TCP/IP communication */ + if ((p->input = fdopen(sp,"r")) == NULL){ pop_log(p,POP_PRIORITY, - "Unable to open communication stream for input, err = %d",errno); + "Unable to open communication stream for input: ", + strerror(errno)); exit (1); -@@ -369,3 +371,4 @@ + } + + /* Create output file stream for TCP/IP communication */ + if ((p->output = fdopen(sp,"w")) == NULL){ pop_log(p,POP_PRIORITY, - "Unable to open communication stream for output, err = %d",errno); + "Unable to open communication stream for output: ", + strerror(errno)); exit (1); + } + diff --git a/mail/popper/scripts/pre-install b/mail/popper/scripts/pre-install index d3e1fef66350..efea0df5b772 100644 --- a/mail/popper/scripts/pre-install +++ b/mail/popper/scripts/pre-install @@ -12,5 +12,5 @@ usrdir=${PREFIX}/etc/popper if [ ! -d $usrdir ]; then mkdir -p $usrdir fi -chown pop.daemon $usrdir +chown pop:daemon $usrdir chmod 700 $usrdir |