nmh-workers
[Top] [All Lists]

KPOP/Hesiod support in nmh

1998-07-02 13:06:10
I've re-enabled the vestigial KPOP and Hesiod support in nmh...
Patches enclosed.

I wasn't quite sure where in the configure.in to put the krb and
hesiod stuff... you can't check for the libraries until you've run
AC_CHECK_NETLIBS, but I figured the option-reading parts should go
with the rest of the options. (The names --with-krb4 and --with-hesiod
are for compatibility with other packages that use those names, so
that people's config.site files will just work.)

A few other patches were needed to deal with drift between MH and nmh.

Right now, it links all of the clients against the krb stuff... the
only ones that should really need it are msgchk and inc, but actually
lots of other things end up needing it because of how the libraries
are split up.

It works... I managed to inc my mail with it.

*** ./acconfig.h.orig   Thu Jul  2 14:54:04 1998
--- ./acconfig.h        Thu Jul  2 13:25:21 1998
***************
*** 189,194 ****
--- 189,212 ----
  #undef POP
  
  /*
+  * Define this to compile support for using Hesiod to locate
+  * pop servers into inc and msgchk. Do not change this value
+  * manually. You must run configure with the
+  * '--with-hesiod=PREFIX' option to correctly build Hesiod
+  * support
+  */
+ #undef HESIOD
+ 
+ /*
+  * Define this to compile client-side support for kpop
+  * (kerberized pop) into inc and msgchk.  Do not change this
+  * value manually.  You must run configure with the
+  * '--with-krb4=PREFIX' option to correctly build the kpop
+  * client support.
+  */
+ #undef KPOP
+ 
+ /*
   * Compile in support for the Emacs front-end mh-e.
   */
  #undef MHE
*** ./configure.in.orig Thu Jul  2 14:54:05 1998
--- ./configure.in      Thu Jul  2 13:42:08 1998
***************
*** 80,85 ****
--- 80,99 ----
  AC_SUBST(POPLIB)dnl
  AC_SUBST(POPSED)dnl
  
+ dnl Do you want support for hesiod?
+ AC_ARG_WITH(hesiod,
+ [  --with-hesiod=PREFIX    specify location of Hesiod])
+ if test x$with_hesiod != xno; then
+   AC_DEFINE(HESIOD)dnl
+ fi  
+ 
+ dnl Do you want support for kpop?
+ AC_ARG_WITH(krb4,
+ [  --with-krb4=PREFIX      specify location of Kerberos V4 for kpop support])
+ if test x$with_krb4 != xno; then
+   AC_DEFINE(KPOP)dnl
+ fi
+ 
  dnl Do you want to debug nmh?
  undefine([nmh-debug])dnl
  AC_ARG_ENABLE(nmh-debug,
***************
*** 283,288 ****
--- 297,341 ----
  AC_CHECK_FUNC(dbm_open, ,
    AC_CHECK_LIB(ndbm, dbm_open, ,
      AC_CHECK_LIB(dbm, dbm_open)))
+ 
+ dnl ----------------
+ dnl CHECK FOR HESIOD
+ dnl ----------------
+ if test "$with_hesiod" != no; then
+   if test "$with_hesiod" != yes; then
+     HESIOD_INCLUDES="-I$with_hesiod/include"
+     HESIOD_LIBS="-L$with_hesiod/lib"
+   fi
+   AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send))
+   AC_CHECK_LIB(hesiod, hes_resolve, HESIOD_LIBS="$HESIOD_LIBS -lhesiod",
+     [AC_MSG_ERROR(Hesiod library not found)], $HESIOD_LIBS)
+ fi
+ AC_SUBST(HESIOD_INCLUDES)
+ AC_SUBST(HESIOD_LIBS)
+ 
+ dnl --------------
+ dnl CHECK FOR KRB4
+ dnl --------------
+ if test "$with_krb4" != no; then
+   if test "$with_krb4" != yes; then
+     KRB4_INCLUDES="-I$with_krb4/include"
+     if test -d "$with_krb4/include/kerberosIV"; then
+       KRB4_INCLUDES="$KRB4_INCLUDES -I$with_krb4/include/kerberosIV"
+     fi
+     KRB4_LIBS="-L$with_krb4/lib"
+   elif test -d /usr/include/kerberosIV; then
+     KRB4_INCLUDES=-I/usr/include/kerberosIV
+   fi
+   AC_CHECK_LIB(krb4, krb_rd_req,
+     [KRB4_LIBS="$KRB4_LIBS -lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err"],
+     [AC_CHECK_LIB(krb, krb_rd_req,
+       [KRB4_LIBS="-lkrb -ldes"],
+       [AC_MSG_ERROR(Kerberos 4 libraries not found)],
+       $KRB4_LIBS -ldes)],
+     $KRB4_LIBS -ldes425 -lkrb5 -lcrypto -lcom_err)
+   AC_SUBST(KRB4_INCLUDES)
+   AC_SUBST(KRB4_LIBS)
+ fi
  
  dnl ---------------------
  dnl CHECK TERMCAP LIBRARY
*** ./zotnet/mts/client.c.orig  Thu Jul  2 14:54:05 1998
--- ./zotnet/mts/client.c       Thu Jul  2 14:46:51 1998
***************
*** 241,253 ****
  
  #ifdef KPOP
      if (kservice) {   /* "pop" */
        ticket = (KTEXT)malloc( sizeof(KTEXT_ST) );
!       rem = krb_sendauth(0L, sd, ticket, kservice, hp->h_name,
!                          (char *) krb_realmofhost(hp->h_name),
                           (unsigned long)0, &msg_data, &cred, schedule,
                           (struct sockaddr_in *)NULL,
                           (struct sockaddr_in *)NULL,
                           "KPOPV0.1");
        if (rem != KSUCCESS) {
            close(sd);
            strcpy(response, "Post office refused connection: ");
--- 241,260 ----
  
  #ifdef KPOP
      if (kservice) {   /* "pop" */
+       char *instance = strdup(hp->h_name);
+       if (instance == NULL) {
+           close(sd);
+           strcpy(response, "Out of memory.");
+           return OOPS2;
+       }
        ticket = (KTEXT)malloc( sizeof(KTEXT_ST) );
!       rem = krb_sendauth(0L, sd, ticket, "pop", instance,
!                          (char *) krb_realmofhost(instance),
                           (unsigned long)0, &msg_data, &cred, schedule,
                           (struct sockaddr_in *)NULL,
                           (struct sockaddr_in *)NULL,
                           "KPOPV0.1");
+       free(instance);
        if (rem != KSUCCESS) {
            close(sd);
            strcpy(response, "Post office refused connection: ");
*** ./zotnet/mts/Makefile.in.orig       Thu Jul  2 14:54:05 1998
--- ./zotnet/mts/Makefile.in    Thu Jul  2 13:36:13 1998
***************
*** 22,28 ****
  CC         = @CC@
  CFLAGS     = @CFLAGS@
  DEFS       = @DEFS@
! INCLUDES   = -I../.. -I$(srcdir) -I$(top_srcdir)
  CONFIGDEFS = -DNMHETCDIR='"$(etcdir)"' -DMAILSPOOL='"$(mailspool)"' 
-DSENDMAILPATH='"$(sendmailpath)"'
  
  COMPILE  = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
--- 22,30 ----
  CC         = @CC@
  CFLAGS     = @CFLAGS@
  DEFS       = @DEFS@
! KRB4_INCLUDES = @KRB4_INCLUDES@
! HESIOD_INCLUDES = @HESIOD_INCLUDES@
! INCLUDES   = -I../.. -I$(srcdir) -I$(top_srcdir) $(KRB4_INCLUDES) 
$(HESIOD_INCLUDES)
  CONFIGDEFS = -DNMHETCDIR='"$(etcdir)"' -DMAILSPOOL='"$(mailspool)"' 
-DSENDMAILPATH='"$(sendmailpath)"'
  
  COMPILE  = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
*** ./uip/inc.c.orig    Thu Jul  2 14:54:05 1998
--- ./uip/inc.c Thu Jul  2 14:36:33 1998
***************
*** 25,34 ****
  # include <h/popsbr.h>
  #endif
  
- #ifdef KPOP
- # include <krb.h>
- #endif
- 
  #ifdef HESIOD
  # include <hesiod.h>
  #endif
--- 25,30 ----
***************
*** 217,222 ****
--- 213,222 ----
      if ((cp = getenv ("MHPOPDEBUG")) && *cp)
        snoop++;
  #endif /* POP */
+ 
+ #ifdef KPOP
+     rpop = 1;
+ #endif
  
      if ((cp = context_find (invo_name))) {
        ap = brkstring (cp = getcpy (cp), " ", "\n");
*** ./uip/msgchk.c.orig Thu Jul  2 14:54:05 1998
--- ./uip/msgchk.c      Thu Jul  2 14:36:08 1998
***************
*** 121,126 ****
--- 121,129 ----
      if ((cp = getenv ("MHPOPDEBUG")) && *cp)
        snoop++;
  #endif
+ #ifdef KPOP
+     rpop = 1;
+ #endif
  
      if ((cp = context_find (invo_name))) {
        ap = brkstring (cp = getcpy (cp), " ", "\n");
*** ./uip/Makefile.in.orig      Thu Jul  2 14:54:06 1998
--- ./uip/Makefile.in   Thu Jul  2 14:51:01 1998
***************
*** 19,31 ****
  CC       = @CC@
  CFLAGS   = @CFLAGS@
  DEFS     = @DEFS@
! INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)
  LDFLAGS  = @LDFLAGS@
  
  LIBS     = @LIBS@
  MTSLIB   = @MTSLIB@
  LOCALLIBS = ../config/version.o ../config/config.o ../sbr/libmh.a 
../$(MTSLIB) ../zotnet/libzot.a
! LINKLIBS = $(LOCALLIBS) $(LIBS)
  
  TERMLIB = @TERMLIB@
  LEXLIB  = @LEXLIB@
--- 19,34 ----
  CC       = @CC@
  CFLAGS   = @CFLAGS@
  DEFS     = @DEFS@
! HESIOD_INCLUDES = @HESIOD_INCLUDES@
! INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir) $(HESIOD_INCLUDES)
  LDFLAGS  = @LDFLAGS@
  
  LIBS     = @LIBS@
  MTSLIB   = @MTSLIB@
+ KRB4_LIBS = @KRB4_LIBS@
+ HESIOD_LIBS = @HESIOD_LIBS@
  LOCALLIBS = ../config/version.o ../config/config.o ../sbr/libmh.a 
../$(MTSLIB) ../zotnet/libzot.a
! LINKLIBS = $(LOCALLIBS) $(KRB4_LIBS) $(HESIOD_LIBS) $(LIBS)
  
  TERMLIB = @TERMLIB@
  LEXLIB  = @LEXLIB@


<Prev in Thread] Current Thread [Next in Thread>
  • KPOP/Hesiod support in nmh, Dan Winship <=