ports/130617: [UPDATE] mail/imap-uw to 2007e

Martin Matuska mm at FreeBSD.org
Fri Jan 16 11:30:03 UTC 2009


>Number:         130617
>Category:       ports
>Synopsis:       [UPDATE] mail/imap-uw to 2007e
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 16 11:30:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 7.1-RELEASE i386/amd64
>Organization:
>Environment:
System: FreeBSD 7.1-RELEASE i386/amd64
>Description:
- update to 2007e
- update non-working patches, use unified diffs
- requires a cclient update, see ports/130255
>How-To-Repeat:
>Fix:
Index: ports/mail/imap-uw/Makefile
===================================================================
RCS file: /home/pcvs/ports/mail/imap-uw/Makefile,v
retrieving revision 1.85
diff -u -r1.85 Makefile
--- ports/mail/imap-uw/Makefile	11 Jan 2009 14:59:03 -0000	1.85
+++ ports/mail/imap-uw/Makefile	16 Jan 2009 11:20:59 -0000
@@ -6,9 +6,7 @@
 #
 
 PORTNAME=	imap
-PORTVERSION=	2006j
-DISTVERSIONSUFFIX=	2
-PORTREVISION=	3
+PORTVERSION=	2007e
 PORTEPOCH=	1
 CATEGORIES=	mail ipv6
 MASTER_SITES=	ftp://ftp.cac.washington.edu/imap/%SUBDIR%/ \
@@ -18,7 +16,6 @@
 MASTER_SITE_SUBDIR=	. old
 PKGNAMESUFFIX=	-uw
 DISTNAME=	imap-${PORTVERSION}
-EXTRACT_SUFX=	.tar.Z
 DISTFILES=	${DISTNAME}${DISTVERSIONSUFFIX}${EXTRACT_SUFX}
 
 MAINTAINER=	anders at FreeBSD.org
@@ -42,10 +39,6 @@
 DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
 WRKSRC=		${WRKDIR}/${DISTNAME}
 
-FORBIDDEN=	multiple vulnerabilities \
-		http://www.vuxml.org/freebsd/a6713190-dfea-11dd-a765-0030843d3802.html \
-		http://www.vuxml.org/freebsd/69a20ce4-dfee-11dd-a765-0030843d3802.html
-
 MAN1=		dmail.1 mailutil.1 tmail.1
 MAN8=		ipopd.8 imapd.8
 
Index: ports/mail/imap-uw/distinfo
===================================================================
RCS file: /home/pcvs/ports/mail/imap-uw/distinfo,v
retrieving revision 1.55
diff -u -r1.55 distinfo
--- ports/mail/imap-uw/distinfo	30 Sep 2007 05:59:04 -0000	1.55
+++ ports/mail/imap-uw/distinfo	16 Jan 2009 11:20:59 -0000
@@ -1,3 +1,3 @@
-MD5 (imap-2006j2.tar.Z) = d7900691c415bcc725c1bf2b15e4fb99
-SHA256 (imap-2006j2.tar.Z) = 5b2ed247fd98f81c7a2d23d0822f602d49b742c19761a9c2dad6753f5f3e806e
-SIZE (imap-2006j2.tar.Z) = 2686745
+MD5 (imap-2007e.tar.gz) = 7903800dc2604000016de070e0c55840
+SHA256 (imap-2007e.tar.gz) = 4b1137b87249782496ec3eeacaf83bbf09312a7d2ae3aead262179041b55565f
+SIZE (imap-2007e.tar.gz) = 1991389
Index: ports/mail/imap-uw/pkg-plist
===================================================================
RCS file: /home/pcvs/ports/mail/imap-uw/pkg-plist,v
retrieving revision 1.16
diff -u -r1.16 pkg-plist
--- ports/mail/imap-uw/pkg-plist	30 Sep 2007 05:59:04 -0000	1.16
+++ ports/mail/imap-uw/pkg-plist	16 Jan 2009 11:20:59 -0000
@@ -36,7 +36,6 @@
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc2088.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc2177.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc2180.txt
-%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc2192.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc2193.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc2195.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc2221.txt
@@ -50,7 +49,6 @@
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc3516.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc3656.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc3691.txt
-%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc4234.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc4314.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc4315.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc4422.txt
@@ -65,6 +63,14 @@
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc4731.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc4752.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/rfc4790.txt
+%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc4959.txt
+%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc4978.txt
+%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc5032.txt
+%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc5051.txt
+%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc5234.txt
+%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc5092.txt
+%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc5161.txt
+%%PORTDOCS%%%%DOCSDIR%%/rfc/rfc5162.txt
 %%PORTDOCS%%%%DOCSDIR%%/rfc/README
 %%PORTDOCS%%@dirrm %%DOCSDIR%%/draft
 %%PORTDOCS%%@dirrm %%DOCSDIR%%/rfc
Index: ports/mail/imap-uw/files/patch-ah
===================================================================
RCS file: /home/pcvs/ports/mail/imap-uw/files/patch-ah,v
retrieving revision 1.15
diff -u -r1.15 patch-ah
--- ports/mail/imap-uw/files/patch-ah	30 Sep 2007 05:59:04 -0000	1.15
+++ ports/mail/imap-uw/files/patch-ah	16 Jan 2009 11:20:59 -0000
@@ -1,173 +1,131 @@
-*** src/ipopd/ipop3d.c.orig	Tue May 22 01:23:47 2007
---- src/ipopd/ipop3d.c	Mon Jul 23 17:46:53 2007
-***************
-*** 36,41 ****
---- 36,46 ----
-  #include <time.h>
-  #include "c-client.h"
-  
-+ #ifdef DRAC_AUTH
-+ #include <netinet/in.h>
-+ #include <arpa/inet.h>
-+ #include <stdlib.h>
-+ #endif /* DRAC_AUTH */
-  
-  #define CRLF PSOUT ("\015\012")	/* primary output terpri */
-  
-***************
-*** 65,70 ****
---- 70,81 ----
-  
-  /* Global storage */
-  
-+ #ifdef DRAC_AUTH
-+ #define DRACTIMEOUT 10*60     /* check every 10 minutes */
-+ time_t lastdrac = 0;          /* time of last drac check */
-+ extern char *getenv ();
-+ #endif /* DRAC_AUTH */
-+ 
-  char *version = "98";		/* edit number of this server */
-  short state = AUTHORIZATION;	/* server state */
-  short critical = NIL;		/* non-zero if in critical code */
-***************
-*** 98,104 ****
-  int mbxopen (char *mailbox);
-  long blat (char *text,long lines,unsigned long size,STRING *st);
-  void rset ();
-! 
-  /* Main program */
-  
-  int main (int argc,char *argv[])
---- 109,161 ----
-  int mbxopen (char *mailbox);
-  long blat (char *text,long lines,unsigned long size,STRING *st);
-  void rset ();
-! #ifdef DRAC_AUTH
-! void drac_auth();
-! #endif /* DRAC_AUTH */
-! 
-! #ifdef DRAC_AUTH
-! /* DRAC Authorization
-!  */
-! void drac_auth ()
-! {
-!   if (time (0) > lastdrac + DRACTIMEOUT)
-!   {
-! 	  FILE *dracconf;
-! 	  char host[100];
-! 	  char *drachost;
-! 	  char *err;
-! 	  char *p;
-! 
-! 	  if ( (dracconf = fopen(ETC_DIR "/dracd.host", "r")) == NULL)
-! 	  {
-! 		syslog (LOG_INFO, "dracd: error opening %s/dracd.host config file",ETC_DIR);
-! 		exit(1);
-! 	  }
-! 
-! 	  fgets(host, 100, dracconf);
-! 	  p = strchr(host, '\n');
-! 	  if(p != NULL)
-! 		*p = '\0';
-! 	  fclose(dracconf);
-! 
-! 	  if( drachost = (host) )
-! 	  {
-! 		  struct sockaddr_in sin;
-! 		  int sinlen = sizeof (struct sockaddr_in);
-! 		  char *client = getpeername (0,(struct sockaddr *) &sin,(void *) &sinlen) ?
-! 			"UNKNOWN" : inet_ntoa (sin.sin_addr);
-! 
-! 		  lastdrac = time(0);
-! 
-! 		  if (dracauth(drachost, inet_addr(client), &err) != 0)
-! 			  syslog (LOG_INFO, err);
-! 		  else
-! 			  syslog (LOG_INFO, "dracd: authorized ip %s", client);
-! 	  }
-!   }
-! }
-! #endif /* DRAC_AUTH */
-! 
-  /* Main program */
-  
-  int main (int argc,char *argv[])
-***************
-*** 111,117 ****
-      (((s = strrchr (argv[0],'/')) || (s = strrchr (argv[0],'\\'))) ?
-       s+1 : argv[0]) : "ipop3d";
-  				/* set service name before linkage */
-!   mail_parameters (NIL,SET_SERVICENAME,(void *) "pop");
-  #include "linkage.c"
-  				/* initialize server */
-    server_init (pgmname,"pop3","pop3s",clkint,kodint,hupint,trmint);
---- 168,174 ----
-      (((s = strrchr (argv[0],'/')) || (s = strrchr (argv[0],'\\'))) ?
-       s+1 : argv[0]) : "ipop3d";
-  				/* set service name before linkage */
-!   mail_parameters (NIL,SET_SERVICENAME,(void *) "pop3");
-  #include "linkage.c"
-  				/* initialize server */
-    server_init (pgmname,"pop3","pop3s",clkint,kodint,hupint,trmint);
-***************
-*** 215,223 ****
-  	      syslog (LOG_INFO,"AUTHENTICATE %s failure host=%.80s",s,
-  		      tcp_clienthost ());
-  	    }
-! 	    else if ((state = mbxopen ("INBOX")) == TRANSACTION)
-  	      syslog (LOG_INFO,"Auth user=%.80s host=%.80s nmsgs=%ld/%ld",
-  		      user,tcp_clienthost (),nmsgs,stream->nmsgs);
-  	    else syslog (LOG_INFO,"Auth user=%.80s host=%.80s no mailbox",
-  			 user,tcp_clienthost ());
-  	  }
---- 272,284 ----
-  	      syslog (LOG_INFO,"AUTHENTICATE %s failure host=%.80s",s,
-  		      tcp_clienthost ());
-  	    }
-! 	    else if ((state = mbxopen ("INBOX")) == TRANSACTION) {
-! 		#ifdef DRAC_AUTH
-! 		drac_auth();
-! 		#endif /* DRAC_AUTH */
-  	      syslog (LOG_INFO,"Auth user=%.80s host=%.80s nmsgs=%ld/%ld",
-  		      user,tcp_clienthost (),nmsgs,stream->nmsgs);
-+ 		}
-  	    else syslog (LOG_INFO,"Auth user=%.80s host=%.80s no mailbox",
-  			 user,tcp_clienthost ());
-  	  }
-***************
-*** 247,255 ****
-  	      PSOUT ("-ERR Missing APOP argument\015\012");
-  	    else if (!(user = apop_login (challenge,s,t,argc,argv)))
-  	      PSOUT ("-ERR Bad APOP\015\012");
-! 	    else if ((state = mbxopen ("INBOX")) == TRANSACTION)
-  	      syslog (LOG_INFO,"APOP user=%.80s host=%.80s nmsgs=%ld/%ld",
-  		      user,tcp_clienthost (),nmsgs,stream->nmsgs);
-  	    else syslog (LOG_INFO,"APOP user=%.80s host=%.80s no mailbox",
-  			 user,tcp_clienthost ());
-  	  }
---- 308,320 ----
-  	      PSOUT ("-ERR Missing APOP argument\015\012");
-  	    else if (!(user = apop_login (challenge,s,t,argc,argv)))
-  	      PSOUT ("-ERR Bad APOP\015\012");
-! 	    else if ((state = mbxopen ("INBOX")) == TRANSACTION) {
-! 		#ifdef DRAC_AUTH
-! 		drac_auth();
-! 		#endif /* DRAC_AUTH */
-  	      syslog (LOG_INFO,"APOP user=%.80s host=%.80s nmsgs=%ld/%ld",
-  		      user,tcp_clienthost (),nmsgs,stream->nmsgs);
-+ 		}
-  	    else syslog (LOG_INFO,"APOP user=%.80s host=%.80s no mailbox",
-  			 user,tcp_clienthost ());
-  	  }
-***************
-*** 609,614 ****
---- 674,682 ----
-  				/* attempt the login */
-      if (server_login (user,pass,t,argc,argv)) {
-        int ret = mbxopen ("INBOX");
-+ 	#ifdef DRAC_AUTH
-+ 	drac_auth();
-+ 	#endif /* DRAC_AUTH */
-        if (ret == TRANSACTION)	/* mailbox opened OK? */
-  	syslog (LOG_INFO,"%sLogin user=%.80s host=%.80s nmsgs=%ld/%ld",
-  		t ? "Admin " : "",user,tcp_clienthost (),nmsgs,stream->nmsgs);
+--- src/ipopd/ipop3d.c.orig	2008-06-04 20:18:34.000000000 +0200
++++ src/ipopd/ipop3d.c	2009-01-16 10:19:50.000000000 +0100
+@@ -34,6 +34,11 @@
+ #include <time.h>
+ #include "c-client.h"
+ 
++#ifdef DRAC_AUTH
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <stdlib.h>
++#endif /* DRAC_AUTH */
+ 
+ #define CRLF PSOUT ("\015\012")	/* primary output terpri */
+ 
+@@ -59,6 +64,12 @@
+ 
+ /* Global storage */
+ 
++#ifdef DRAC_AUTH
++#define DRACTIMEOUT 10*60     /* check every 10 minutes */
++time_t lastdrac = 0;          /* time of last drac check */
++extern char *getenv ();
++#endif /* DRAC_AUTH */
++
+ char *version = "104";		/* edit number of this server */
+ short state = AUTHORIZATION;	/* server state */
+ short critical = NIL;		/* non-zero if in critical code */
+@@ -100,7 +111,53 @@
+ int mbxopen (char *mailbox);
+ long blat (char *text,long lines,unsigned long size,STRING *st);
+ void rset ();
+-
++#ifdef DRAC_AUTH
++void drac_auth();
++#endif /* DRAC_AUTH */
++
++#ifdef DRAC_AUTH
++/* DRAC Authorization
++ */
++void drac_auth ()
++{
++  if (time (0) > lastdrac + DRACTIMEOUT)
++  {
++	  FILE *dracconf;
++	  char host[100];
++	  char *drachost;
++	  char *err;
++	  char *p;
++
++	  if ( (dracconf = fopen(ETC_DIR "/dracd.host", "r")) == NULL)
++	  {
++		syslog (LOG_INFO, "dracd: error opening %s/dracd.host config file",ETC_DIR);
++		exit(1);
++	  }
++
++	  fgets(host, 100, dracconf);
++	  p = strchr(host, '\n');
++	  if(p != NULL)
++		*p = '\0';
++	  fclose(dracconf);
++
++	  if( drachost = (host) )
++	  {
++		  struct sockaddr_in sin;
++		  int sinlen = sizeof (struct sockaddr_in);
++		  char *client = getpeername (0,(struct sockaddr *) &sin,(void *) &sinlen) ?
++			"UNKNOWN" : inet_ntoa (sin.sin_addr);
++
++		  lastdrac = time(0);
++
++		  if (dracauth(drachost, inet_addr(client), &err) != 0)
++			  syslog (LOG_INFO, err);
++		  else
++			  syslog (LOG_INFO, "dracd: authorized ip %s", client);
++	  }
++  }
++}
++#endif /* DRAC_AUTH */
++
+ /* Main program */
+ 
+ int main (int argc,char *argv[])
+@@ -113,7 +170,7 @@
+     (((s = strrchr (argv[0],'/')) || (s = strrchr (argv[0],'\\'))) ?
+      s+1 : argv[0]) : "ipop3d";
+ 				/* set service name before linkage */
+-  mail_parameters (NIL,SET_SERVICENAME,(void *) "pop");
++  mail_parameters (NIL,SET_SERVICENAME,(void *) "pop3");
+ #include "linkage.c"
+ 				/* initialize server */
+   server_init (pgmname,"pop3","pop3s",clkint,kodint,hupint,trmint,NIL);
+@@ -228,9 +285,13 @@
+ 	      syslog (LOG_INFO,"AUTHENTICATE %s failure host=%.80s",s,
+ 		      tcp_clienthost ());
+ 	    }
+-	    else if ((state = mbxopen ("INBOX")) == TRANSACTION)
++	    else if ((state = mbxopen ("INBOX")) == TRANSACTION) {
++		#ifdef DRAC_AUTH
++		drac_auth();
++		#endif /* DRAC_AUTH */
+ 	      syslog (LOG_INFO,"Auth user=%.80s host=%.80s nmsgs=%lu/%lu",
+ 		      user,tcp_clienthost (),nmsgs,stream->nmsgs);
++		}
+ 	    else syslog (LOG_INFO,"Auth user=%.80s host=%.80s no mailbox",
+ 			 user,tcp_clienthost ());
+ 	  }
+@@ -260,9 +321,13 @@
+ 	      PSOUT ("-ERR Missing APOP argument\015\012");
+ 	    else if (!(user = apop_login (challenge,s,t,argc,argv)))
+ 	      PSOUT ("-ERR Bad APOP\015\012");
+-	    else if ((state = mbxopen ("INBOX")) == TRANSACTION)
++	    else if ((state = mbxopen ("INBOX")) == TRANSACTION) {
++		#ifdef DRAC_AUTH
++		drac_auth();
++		#endif /* DRAC_AUTH */
+ 	      syslog (LOG_INFO,"APOP user=%.80s host=%.80s nmsgs=%lu/%lu",
+ 		      user,tcp_clienthost (),nmsgs,stream->nmsgs);
++		}
+ 	    else syslog (LOG_INFO,"APOP user=%.80s host=%.80s no mailbox",
+ 			 user,tcp_clienthost ());
+ 	  }
+@@ -665,6 +730,9 @@
+ 				/* attempt the login */
+     if (server_login (user,pass,t,argc,argv)) {
+       int ret = mbxopen ("INBOX");
++	#ifdef DRAC_AUTH
++	drac_auth();
++	#endif /* DRAC_AUTH */
+       if (ret == TRANSACTION)	/* mailbox opened OK? */
+ 	syslog (LOG_INFO,"%sLogin user=%.80s host=%.80s nmsgs=%lu/%lu",
+ 		t ? "Admin " : "",user,tcp_clienthost (),nmsgs,stream->nmsgs);
Index: ports/mail/imap-uw/files/patch-ai
===================================================================
RCS file: /home/pcvs/ports/mail/imap-uw/files/patch-ai,v
retrieving revision 1.17
diff -u -r1.17 patch-ai
--- ports/mail/imap-uw/files/patch-ai	30 Sep 2007 05:59:04 -0000	1.17
+++ ports/mail/imap-uw/files/patch-ai	16 Jan 2009 11:20:59 -0000
@@ -1,103 +1,89 @@
-*** src/imapd/imapd.c.orig	Wed Jul 11 22:08:16 2007
---- src/imapd/imapd.c	Mon Jul 23 17:48:56 2007
-***************
-*** 38,43 ****
---- 38,48 ----
-  #include "newsrc.h"
-  #include <sys/stat.h>
-  
-+ #ifdef DRAC_AUTH
-+ #include <netinet/in.h>
-+ #include <arpa/inet.h>
-+ #include <stdlib.h>
-+ #endif /* DRAC_AUTH */
-  
-  #define CRLF PSOUT ("\015\012")	/* primary output terpri */
-  
-***************
-*** 203,208 ****
---- 208,219 ----
-  
-  /* Global storage */
-  
-+ #ifdef DRAC_AUTH
-+ #define DRACTIMEOUT 10*60     /* check every 10 minutes */
-+ time_t lastdrac = 0;          /* time of last drac check */
-+ extern char *getenv ();
-+ #endif /* DRAC_AUTH */
-+ 
-  char *version = "389";		/* edit number of this server */
-  char *logout = "Logout";	/* syslogreason for logout */
-  char *goodbye = NIL;		/* bye reason */
-***************
-*** 277,283 ****
-    msg_string_next,		/* get next byte in string structure */
-    msg_string_setpos		/* set position in string structure */
-  };
-! 
-  /* Main program */
-  
-  int main (int argc,char *argv[])
---- 288,337 ----
-    msg_string_next,		/* get next byte in string structure */
-    msg_string_setpos		/* set position in string structure */
-  };
-! 
-! #ifdef DRAC_AUTH
-! /* DRAC Authorization
-!  */
-! void drac_auth ()
-! {
-!   if (time (0) > lastdrac + DRACTIMEOUT)
-!   {
-! 	  FILE *dracconf;
-! 	  char host[100];
-! 	  char *drachost;
-! 	  char *err;
-! 	  char *p;
-! 
-! 	  if ( (dracconf = fopen(ETC_DIR "/dracd.host", "r")) == NULL)
-! 	  {
-! 		syslog (LOG_INFO, "dracd: error opening %s/dracd.host config file",ETC_DIR);
-! 		exit(1);
-! 	  }
-! 
-! 	  fgets(host, 100, dracconf);
-! 	  p = strchr(host, '\n');
-! 	  if(p != NULL)
-! 		*p = '\0';
-! 	  fclose(dracconf);
-! 
-! 	  if( drachost = (host) )
-! 	  {
-! 		  struct sockaddr_in sin;
-! 		  int sinlen = sizeof (struct sockaddr_in);
-! 		  char *client = getpeername (0,(struct sockaddr *) &sin,(void *) &sinlen) ?
-! 			"UNKNOWN" : inet_ntoa (sin.sin_addr);
-! 
-! 		  lastdrac = time(0);
-! 
-! 		  if (dracauth(drachost, inet_addr(client), &err) != 0)
-! 			  syslog (LOG_INFO, err);
-! 		  else
-! 			  syslog (LOG_INFO, "dracd: authorized ip %s", client);
-! 	  }
-!   }
-! }
-! #endif /* DRAC_AUTH */
-! 
-  /* Main program */
-  
-  int main (int argc,char *argv[])
-***************
-*** 1501,1506 ****
---- 1555,1563 ----
-  	      lasterror ());
-        return;
-      }
-+ 	#ifdef DRAC_AUTH
-+ 	drac_auth();
-+ 	#endif /* DRAC_AUTH */
-  				/* change in number of messages? */
-      if (existsquelled || (nmsgs != stream->nmsgs)) {
-        PSOUT ("* ");
+--- src/imapd/imapd.c.orig	2008-11-18 19:46:59.000000000 +0100
++++ src/imapd/imapd.c	2009-01-16 10:23:02.000000000 +0100
+@@ -37,6 +37,11 @@
+ #include "newsrc.h"
+ #include <sys/stat.h>
+ 
++#ifdef DRAC_AUTH
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <stdlib.h>
++#endif /* DRAC_AUTH */
+ 
+ #define CRLF PSOUT ("\015\012")	/* primary output terpri */
+ 
+@@ -207,6 +212,12 @@
+ 
+ /* Global storage */
+ 
++#ifdef DRAC_AUTH
++#define DRACTIMEOUT 10*60     /* check every 10 minutes */
++time_t lastdrac = 0;          /* time of last drac check */
++extern char *getenv ();
++#endif /* DRAC_AUTH */
++
+ char *version = "404";		/* edit number of this server */
+ char *logout = "Logout";	/* syslogreason for logout */
+ char *goodbye = NIL;		/* bye reason */
+@@ -283,7 +294,50 @@
+   msg_string_next,		/* get next byte in string structure */
+   msg_string_setpos		/* set position in string structure */
+ };
+-
++
++#ifdef DRAC_AUTH
++/* DRAC Authorization
++ */
++void drac_auth ()
++{
++  if (time (0) > lastdrac + DRACTIMEOUT)
++  {
++	  FILE *dracconf;
++	  char host[100];
++	  char *drachost;
++	  char *err;
++	  char *p;
++
++	  if ( (dracconf = fopen(ETC_DIR "/dracd.host", "r")) == NULL)
++	  {
++		syslog (LOG_INFO, "dracd: error opening %s/dracd.host config file",ETC_DIR);
++		exit(1);
++	  }
++
++	  fgets(host, 100, dracconf);
++	  p = strchr(host, '\n');
++	  if(p != NULL)
++		*p = '\0';
++	  fclose(dracconf);
++
++	  if( drachost = (host) )
++	  {
++		  struct sockaddr_in sin;
++		  int sinlen = sizeof (struct sockaddr_in);
++		  char *client = getpeername (0,(struct sockaddr *) &sin,(void *) &sinlen) ?
++			"UNKNOWN" : inet_ntoa (sin.sin_addr);
++
++		  lastdrac = time(0);
++
++		  if (dracauth(drachost, inet_addr(client), &err) != 0)
++			  syslog (LOG_INFO, err);
++		  else
++			  syslog (LOG_INFO, "dracd: authorized ip %s", client);
++	  }
++  }
++}
++#endif /* DRAC_AUTH */
++
+ /* Main program */
+ 
+ int main (int argc,char *argv[])
+@@ -1525,6 +1579,9 @@
+ 	      lasterror ());
+       return;
+     }
++	#ifdef DRAC_AUTH
++	drac_auth();
++	#endif /* DRAC_AUTH */
+ 				/* change in number of messages? */
+     if (existsquelled || (nmsgs != stream->nmsgs)) {
+       PSOUT ("* ");
Index: ports/mail/imap-uw/files/patch-src-dmail-Makefile
===================================================================
RCS file: /home/pcvs/ports/mail/imap-uw/files/patch-src-dmail-Makefile,v
retrieving revision 1.1
diff -u -r1.1 patch-src-dmail-Makefile
--- ports/mail/imap-uw/files/patch-src-dmail-Makefile	27 Nov 2002 04:11:23 -0000	1.1
+++ ports/mail/imap-uw/files/patch-src-dmail-Makefile	16 Jan 2009 11:20:59 -0000
@@ -1,6 +1,6 @@
---- src/dmail/Makefile.orig	Wed Nov 27 04:10:53 2002
-+++ src/dmail/Makefile	Wed Nov 27 04:12:31 2002
-@@ -23,17 +23,11 @@
+--- src/dmail/Makefile.orig	2008-06-04 20:18:34.000000000 +0200
++++ src/dmail/Makefile	2009-01-16 10:28:52.000000000 +0100
+@@ -31,20 +31,12 @@
  
  # Get local definitions from c-client directory
  
@@ -10,14 +10,17 @@
 +CFLAGS+=	-DNFSKLUDGE -I$(LOCALBASE)/include/c-client
 +LDFLAGS+=	-L$(LOCALBASE)/lib -lc-client4
  
--dmail: $(CCLIENTLIB) dmail.o
-+dmail: dmail.o
- 	$(CC) $(CFLAGS) -o dmail dmail.o $(LDFLAGS)
+-dmail: $(CCLIENTLIB) dmail.o dquota.o
++dmail: dmail.o dquota.o
+ 	$(CC) $(CFLAGS) -o dmail dmail.o dquota.o $(LDFLAGS)
+ 
+-dmail.o: $C/mail.h $C/misc.h $C/osdep.h dquota.h
 -
--dmail.o: $C/mail.h $C/misc.h $C/osdep.h
+-dquota.o: dquota.h
 -
 -$(CCLIENTLIB):
 -	cd $C;make
- 
+-
  clean:
  	rm -f *.o dmail
+ 
Index: ports/mail/imap-uw/files/patch-src-tmail-Makefile
===================================================================
RCS file: /home/pcvs/ports/mail/imap-uw/files/patch-src-tmail-Makefile,v
retrieving revision 1.1
diff -u -r1.1 patch-src-tmail-Makefile
--- ports/mail/imap-uw/files/patch-src-tmail-Makefile	27 Nov 2002 04:11:23 -0000	1.1
+++ ports/mail/imap-uw/files/patch-src-tmail-Makefile	16 Jan 2009 11:20:59 -0000
@@ -1,6 +1,6 @@
---- src/tmail/Makefile.orig	Wed Nov 27 04:13:15 2002
-+++ src/tmail/Makefile	Wed Nov 27 04:14:09 2002
-@@ -23,17 +23,11 @@
+--- src/tmail/Makefile.orig	2008-06-04 20:18:34.000000000 +0200
++++ src/tmail/Makefile	2009-01-16 10:30:24.000000000 +0100
+@@ -31,20 +31,12 @@
  
  # Get local definitions from c-client directory
  
@@ -10,14 +10,17 @@
 +CFLAGS+=	-DNFSKLUDGE -I$(LOCALBASE)/include/c-client
 +LDFLAGS+=	-L$(LOCALBASE)/lib -lc-client4
  
--tmail: $(CCLIENTLIB) tmail.o
-+tmail: tmail.o
- 	$(CC) $(CFLAGS) -o tmail tmail.o $(LDFLAGS)
+-tmail: $(CCLIENTLIB) tmail.o tquota.o
++tmail: tmail.o tquota.o
+ 	$(CC) $(CFLAGS) -o tmail tmail.o tquota.o $(LDFLAGS)
+ 
+-tmail.o: $C/mail.h $C/misc.h $C/osdep.h tquota.h
 -
--tmail.o: $C/mail.h $C/misc.h $C/osdep.h
+-tquota.o: tquota.h
 -
 -$(CCLIENTLIB):
 -	cd $C;make
- 
+-
  clean:
  	rm -f *.o tmail
+ 
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list