update to version 2001.313

- no longer depend on c-client
- enable gssapi (kerberos5) support
This commit is contained in:
jakob 2001-09-24 22:01:49 +00:00
parent c257518fc3
commit 49f6871211
14 changed files with 239 additions and 157 deletions

View File

@ -1,32 +1,34 @@
# $OpenBSD: Makefile,v 1.19 2001/03/24 19:55:51 jakob Exp $
# $OpenBSD: Makefile,v 1.20 2001/09/24 22:01:49 jakob Exp $
COMMENT= University of Washington IMAP4rev1/POP2/POP3 mail servers
DISTNAME= imap-2000c
PKGNAME= imap-uw-2000c
VERSION= 2001.313
DISTNAME= pine4.40
PKGNAME= imap-uw-${VERSION}
CATEGORIES= mail
NEED_VERSION= 1.363
NEED_VERSION= 1.460
HOMEPAGE= http://www.washington.edu/imap/
MAINTAINER= Jakob Schlyter <jakob@openbsd.org>
MASTER_SITES= ftp://ftp.cac.washington.edu/pine/ \
ftp://ftp.sunet.se/pub/unix/mail/pine/
PERMIT_PACKAGE_CDROM= no
PERMIT_PACKAGE_FTP= yes
PERMIT_DISTFILES_CDROM= no
PERMIT_DISTFILES_FTP= yes
MASTER_SITES= ftp://ftp.cac.washington.edu/imap/ \
ftp://ftp.cac.washington.edu/imap/old/
EXTRACT_SUFX= .tar.Z
LIB_DEPENDS= c-client.2.1::mail/c-client
WRKDIST= ${WRKDIR}/${DISTNAME}/imap
ALL_TARGET= bso
MAKE_FLAGS= SPECIALAUTHENTICATORS=ssl
MAKE_FLAGS= EXTRACFLAGS="${CFLAGS}" SSLTYPE="unix" \
EXTRAAUTHENTICATORS="gss"
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/imapd/imapd ${PREFIX}/libexec
${INSTALL_PROGRAM} ${WRKSRC}/imapd/imapd ${PREFIX}/libexec
${INSTALL_PROGRAM} ${WRKSRC}/ipopd/ipop2d ${PREFIX}/libexec
${INSTALL_PROGRAM} ${WRKSRC}/ipopd/ipop3d ${PREFIX}/libexec
${INSTALL_MAN} ${WRKSRC}/src/imapd/imapd.8c ${PREFIX}/man/man8/imapd.8

View File

@ -1,3 +1,3 @@
MD5 (imap-2000c.tar.Z) = 90bdc0670812234a0589286798575980
RMD160 (imap-2000c.tar.Z) = b74b352383ebb277ed7cb6138a04403172666035
SHA1 (imap-2000c.tar.Z) = 60f8f46ad77db8672037400a80f8d5f47eef2168
MD5 (pine4.40.tar.gz) = 5173fecdd0cc7c3b7da7394817ae869f
RMD160 (pine4.40.tar.gz) = 5a5a8e1c2e86b2a9dcabb5591a8795d6b47526c4
SHA1 (pine4.40.tar.gz) = 90ed30803e6b25add43bf53ec260cdf313cfb77b

View File

@ -1,24 +0,0 @@
--- Makefile.orig Wed Jan 24 00:50:36 2001
+++ Makefile Sun Feb 18 13:50:08 2001
@@ -431,20 +431,10 @@
$(TOOLS)/$@ "$(LN)" src/imapd imapd
$(LN) $(TOOLS)/$@ .
-build: OSTYPE rebuild rebuildclean bundled
+build: OSTYPE bundled
OSTYPE:
- @echo Building c-client for $(OS)...
- echo $(SPECIALS) $(EXTRASPECIALS) > c-client/SPECIALS
- $(CD) c-client;$(MAKE) $(OS) EXTRACFLAGS='$(EXTRACFLAGS)'\
- EXTRALDFLAGS='$(EXTRALDFLAGS)'\
- EXTRADRIVERS='$(EXTRADRIVERS)'\
- EXTRAAUTHENTICATORS='$(EXTRAAUTHENTICATORS)'\
- SPECIALAUTHENTICATORS='$(SPECIALAUTHENTICATORS)'\
- PASSWDTYPE=$(PASSWDTYPE)\
- $(SPECIALS) $(EXTRASPECIALS)
echo $(OS) > OSTYPE
- $(TOUCH) rebuild
rebuild:
@echo Rebuilding c-client for `$(CAT) OSTYPE`...

View File

@ -1,13 +0,0 @@
--- src/osdep/unix/Makefile.ssl.orig Wed Dec 6 20:07:34 2000
+++ src/osdep/unix/Makefile.ssl Wed Dec 6 20:08:01 2000
@@ -20,8 +20,8 @@
# Extended flags needed for additional authenticators. You may need to modify.
-SSLDIR=/usr/local/ssl
-SSLCERTS=$(SSLDIR)/certs
+SSLDIR=/usr
+SSLCERTS=/etc/ssl
SSLINCLUDE=$(SSLDIR)/include
SSLLIB=$(SSLDIR)/lib

View File

@ -1,3 +1,5 @@
$OpenBSD: patch-imapd.8c,v 1.2 2001/09/24 22:01:49 jakob Exp $
--- src/imapd/imapd.8c.orig Tue Oct 13 04:31:21 1998
+++ src/imapd/imapd.8c Sat Oct 16 23:59:57 1999
@@ -1,9 +1,9 @@

View File

@ -1,3 +1,5 @@
$OpenBSD: patch-ipopd.8c,v 1.2 2001/09/24 22:01:49 jakob Exp $
--- src/ipopd/ipopd.8c.orig Fri Jan 17 02:52:10 1992
+++ src/ipopd/ipopd.8c Sat Oct 16 23:59:21 1999
@@ -1,11 +1,11 @@

View File

@ -0,0 +1,81 @@
$OpenBSD: patch-src_c-client_auth_gss.c,v 1.1 2001/09/24 22:01:49 jakob Exp $
--- src/c-client/auth_gss.c.orig Wed Aug 8 23:24:07 2001
+++ src/c-client/auth_gss.c Tue Sep 11 12:05:07 2001
@@ -19,8 +19,19 @@
*/
#define PROTOTYPE(x) x
+
+#ifdef HEIMDAL
+#include <gssapi.h>
+#include <krb5.h>
+#else
#include <gssapi/gssapi_generic.h>
#include <gssapi/gssapi_krb5.h>
+#endif
+
+#ifdef HEIMDAL
+#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
+#define KRB5_FCC_NOFILE KRB5_CC_NOTFOUND
+#endif
long auth_gssapi_valid (void);
long auth_gssapi_client (authchallenge_t challenger,authrespond_t responder,
@@ -28,6 +39,8 @@
unsigned long *trial,char *user);
char *auth_gssapi_server (authresponse_t responder,int argc,char *argv[]);
+static long has_keytab (void);
+
AUTHENTICATOR auth_gss = {
AU_SECURE | AU_AUTHUSER, /* secure authenticator */
"GSSAPI", /* authenticator name */
@@ -45,7 +58,6 @@
#define SERVER_LOG(x,y) syslog (LOG_ALERT,x,y)
-extern char *krb5_defkeyname; /* sneaky way to get this name */
/* Check if GSSAPI valid on this system
* Returns: T if valid, NIL otherwise
@@ -63,10 +75,38 @@
/* see if can build a name */
if (gss_import_name (&smn,&buf,gss_nt_service_name,&name) != GSS_S_COMPLETE)
return NIL; /* failed */
- if ((s = strchr (krb5_defkeyname,':')) && stat (++s,&sbuf))
+ if (!has_keytab ())
auth_gss.server = NIL; /* can't do server if no keytab */
gss_release_name (&smn,&name);/* finished with name */
return LONGT;
+}
+
+/* Check if there is a keytab.
+ * Returns: T if it exists, NIL otherwise
+ */
+
+static long has_keytab (void)
+{
+ krb5_context context;
+ krb5_error_code ret;
+ krb5_keytab kt;
+ krb5_kt_cursor cursor;
+
+ ret = krb5_init_context (&context);
+ if (ret)
+ return NIL;
+ ret = krb5_kt_default (context, &kt);
+ if (ret) {
+ krb5_free_context (context);
+ return NIL;
+ }
+ ret = krb5_kt_start_seq_get (context, kt, &cursor);
+ krb5_kt_close (context, kt);
+ krb5_free_context (context);
+ if (ret)
+ return NIL;
+ else
+ return T;
}
/* Client authenticator

View File

@ -1,32 +0,0 @@
$OpenBSD: patch-src_imapd_Makefile,v 1.2 2001/03/19 17:50:28 wilfried Exp $
--- src/imapd/Makefile.orig Tue Jan 9 22:08:17 2001
+++ src/imapd/Makefile Mon Mar 19 17:43:36 2001
@@ -36,24 +36,16 @@
#EXTRACFLAGS= -DNETSCAPE_BRAIN_DAMAGE=\"http://www.washington.edu/pine\"
-# Get local definitions from c-client directory
-
-C = ../c-client
-CCLIENTLIB = $C/c-client.a
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS` $(EXTRACFLAGS) -DANOFILE=\"$(ANO)\" \
+CFLAGS += -I$(PREFIX)/include/c-client $(EXTRACFLAGS) -DANOFILE=\"$(ANO)\" \
-DALERTFILE=\"$(ALERT)\" -DUSERALERTFILE=\"$(USERALERT)\"
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+LDFLAGS += -L$(PREFIX)/lib -lc-client -lssl -lcrypto
all: imapd
-imapd: $(CCLIENTLIB) imapd.o
+imapd: imapd.o
$(CC) $(CFLAGS) -o imapd imapd.o $(LDFLAGS)
-imapd.o: $C/mail.h $C/misc.h $C/osdep.h
-
-$(CCLIENTLIB):
- cd $C;make
+imapd.o:
clean:
rm -f *.o imapd || true

View File

@ -1,40 +0,0 @@
$OpenBSD: patch-src_ipopd_Makefile,v 1.2 2001/03/19 17:50:28 wilfried Exp $
--- src/ipopd/Makefile.orig Wed Oct 25 01:55:07 2000
+++ src/ipopd/Makefile Mon Mar 19 17:43:30 2001
@@ -18,30 +18,22 @@
# CPYRIGHT, included with this Distribution.
-C = ../c-client
-CCLIENTLIB = $C/c-client.a
SHELL = /bin/sh
-# Get local definitions from c-client directory
-
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+CFLAGS += -I$(PREFIX)/include/c-client
+LDFLAGS += -L$(PREFIX)/lib -lc-client -lssl -lcrypto
ipopd: ipop2d ipop3d
-ipop2d: $(CCLIENTLIB) ipop2d.o
+ipop2d: ipop2d.o
$(CC) $(CFLAGS) -o ipop2d ipop2d.o $(LDFLAGS)
-ipop3d: $(CCLIENTLIB) ipop3d.o
+ipop3d: ipop3d.o
$(CC) $(CFLAGS) -o ipop3d ipop3d.o $(LDFLAGS)
-ipop2d.o: $C/mail.h $C/misc.h $C/osdep.h
-
-ipop3d.o: $C/mail.h $C/misc.h $C/osdep.h
+ipop2d.o:
-$(CCLIENTLIB):
- cd $C;make
+ipop3d.o:
clean:
rm -f *.o ipop2d ipop3d || true

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-src_mtest_Makefile,v 1.2 2001/03/19 17:50:28 wilfried Exp $
--- src/mtest/Makefile.orig Wed Oct 25 01:55:39 2000
+++ src/mtest/Makefile Mon Mar 19 17:43:25 2001
@@ -18,25 +18,17 @@
# CPYRIGHT, included with this Distribution.
-C = ../c-client
-CCLIENTLIB = $C/c-client.a
SHELL = /bin/sh
-# Get local definitions from c-client directory
-
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+CFLAGS += -I$(PREFIX)/include/c-client
+LDFLAGS += -L$(PREFIX)/lib -lc-client -lssl -lcrypto
all: mtest
-mtest: $(CCLIENTLIB) mtest.o
+mtest: mtest.o
$(CC) $(CFLAGS) -o mtest mtest.o $(LDFLAGS)
-mtest.o: $C/mail.h $C/misc.h $C/osdep.h $C/rfc822.h $C/smtp.h $C/nntp.h
-
-$(CCLIENTLIB):
- cd $C;make
+mtest.o:
clean:
rm -f *.o mtest || true

View File

@ -0,0 +1,104 @@
$OpenBSD: patch-src_osdep_unix_Makefile,v 1.1 2001/09/24 22:01:49 jakob Exp $
--- src/osdep/unix/Makefile.orig Tue Jul 3 08:02:10 2001
+++ src/osdep/unix/Makefile Sun Aug 26 12:49:37 2001
@@ -28,8 +28,8 @@
# Extended flags needed for SSL. You may need to modify.
-SSLDIR=/usr/local/ssl
-SSLCERTS=$(SSLDIR)/certs
+SSLDIR=/usr
+SSLCERTS=/etc/ssl
SSLINCLUDE=$(SSLDIR)/include
SSLLIB=$(SSLDIR)/lib
@@ -107,6 +107,7 @@
DEFAULTAUTHENTICATORS=md5 pla log
DEFAULTDRIVERS=imap nntp pop3 mh mx mbx tenex mtx mmdf unix news phile
+.SUFFIXES: .o .so
# Normally no need to change any of these
@@ -115,6 +116,7 @@
dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
unix.o mbox.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o
+SOBINARIES=$(BINARIES:.o=.so)
CFLAGS=-g
CAT=cat
@@ -123,6 +125,7 @@
RM=rm -rf
SH=sh
+PICFLAG= -fpic
# Primary build command
@@ -234,7 +237,7 @@
SPOOLDIR=/var \
ACTIVEFILE=/usr/local/news/lib/active \
RSHPATH=/usr/bin/rsh \
- BASECFLAGS="-O2 -pipe"
+ BASECFLAGS="-pipe"
cvx: # Convex
$(BUILD) `$(CAT) SPECIALS` OS=$@ \
@@ -762,23 +765,29 @@
# Build it!
-build: clean once $(ARCHIVE)
+build: clean once $(ARCHIVE) $(SHLIB)
-all: $(ARCHIVE)
+all: $(ARCHIVE) $(SHLIB)
$(ARCHIVE): $(BINARIES)
sh -c '$(RM) $(ARCHIVE) || true'
@$(CAT) ARCHIVE
@$(SH) ARCHIVE
+$(SHLIB): $(SOBINARIES)
+ $(CC) -shared $(PICFLAG) -o $(SHLIB) $(SOBINARIES)
+
.c.o:
`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
+.c.so:
+ `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $(PICFLAG) -DPIC $(@:.so=.c) -o $@
+
# Cleanup
clean:
- sh -c '$(RM) auths.c crexcl.c nfstest.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true'
+ sh -c '$(RM) auths.c crexcl.c nfstest.c linkage.[ch] siglocal.c osdep*.[ch] *.o *.so ARCHIVE *FLAGS *TYPE $(ARCHIVE) $(SHLIB) || true'
# Dependencies
@@ -812,7 +821,7 @@
# OS-dependent
-osdep.o:mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
+OSDEPS= mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
osdep.h env_unix.h tcp_unix.h \
osdep.c env_unix.c fs_unix.c ftl_unix.c nl_unix.c tcp_unix.c \
auths.c crexcl.c flocksim.c nfstest.c flcksafe.c fsync.c gethstid.c \
@@ -824,7 +833,12 @@
write.c sslstdio.c \
strerror.c strpbrk.c strstr.c strtok.c strtoul.c \
OSCFLAGS
- `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
+
+osdep.o: $(OSDEPS)
+ `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` osdep.c
+
+osdep.so: $(OSDEPS)
+ `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` $(PICFLAG) -DPIC osdep.c -o $@
osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c
$(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-src_osdep_unix_Makefile.gss,v 1.1 2001/09/24 22:01:49 jakob Exp $
--- src/osdep/unix/Makefile.gss.orig Wed Oct 25 01:59:31 2000
+++ src/osdep/unix/Makefile.gss Sun Aug 26 14:30:52 2001
@@ -21,11 +21,10 @@
# Extended flags needed for additional authenticators. You may need to modify.
GSSDIR=/usr/local
-GSSCFLAGS= -I$(GSSDIR)/include
-GSSOLDLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err
-GSSNEWLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err
+GSSCFLAGS= -I/usr/include/kerberosV -DHEIMDAL
+GSSLDFLAGS= -lgssapi -lkrb5 -lasn1 -lcom_err -ldes -lcrypto
gss: # GSSAPI Kerberos V flags
echo $(GSSCFLAGS) >> OSCFLAGS
- sh -c '(test -f $(GSSDIR)/lib/libk5crypto.a) && echo $(GSSNEWLDFLAGS) || echo $(GSSOLDLDFLAGS)' >> LDFLAGS
+ echo $(GSSLDFLAGS) >> LDFLAGS

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_osdep_unix_env_unix.c,v 1.1 2001/09/24 22:01:49 jakob Exp $
--- src/osdep/unix/env_unix.c.orig Thu Dec 21 01:12:13 2000
+++ src/osdep/unix/env_unix.c Thu Jan 18 16:11:09 2001
@@ -971,7 +971,8 @@ long dotlock_lock (char *file,DOTLOCK *b
}
close (pi[0]); close (pi[1]);
}
- if (lockEaccesError) { /* punt silently if paranoid site */
+ if (strncmp(base->lock,"/var/mail/",10) && lockEaccesError) {
+ /* punt silently if paranoid site */
sprintf (tmp,"Mailbox vulnerable - directory %.80s",base->lock);
if (s = strrchr (tmp,'/')) *s = '\0';
strcat (tmp," must have 1777 protection");

View File

@ -1,5 +1,5 @@
This is the IMAP4rev1 server from the University of Washington.
Included are backwards-compatbile (almost) POP2 and POP3 servers.
Included are backwards-compatible (almost) POP2 and POP3 servers.
ipop2d POP2 daemon
ipop3d POP3 daemon