diff options
author | Doug Barton <dougb@FreeBSD.org> | 2001-04-25 05:43:33 +0000 |
---|---|---|
committer | Doug Barton <dougb@FreeBSD.org> | 2001-04-25 05:43:33 +0000 |
commit | 79ba115da82388d097ef5d5db6c167e5d063b949 (patch) | |
tree | 86b577dbeb2192714b5deb3eaaa281b2f55c819d /mail/imap-uw/files/patch-ai | |
parent | Update to 0104241750. The maintainer submitted an update for the previous (diff) |
Update to 0104241750. The maintainer submitted an update for the previous
version, however they _just_ updated the version today. The only thing I
did differently from the maintainer's patch was to regen patch-ai.
PR: ports/26808
Submitted by: Anders Nordby <anders@fix.no> (maintainer)
Notes
Notes:
svn path=/head/; revision=41887
Diffstat (limited to 'mail/imap-uw/files/patch-ai')
-rw-r--r-- | mail/imap-uw/files/patch-ai | 152 |
1 files changed, 79 insertions, 73 deletions
diff --git a/mail/imap-uw/files/patch-ai b/mail/imap-uw/files/patch-ai index 0639372fd582..86c043173b17 100644 --- a/mail/imap-uw/files/patch-ai +++ b/mail/imap-uw/files/patch-ai @@ -1,73 +1,79 @@ ---- src/imapd/imapd.c.orig Sat Apr 7 00:27:30 2001 -+++ src/imapd/imapd.c Wed Apr 11 12:00:44 2001 -@@ -29,6 +29,11 @@ - #include "c-client.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 */ - -@@ -173,6 +178,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 = "2001.299"; /* version number of this server */ - time_t alerttime = 0; /* time of last alert */ - time_t sysalerttime = 0; /* time of last system alert */ -@@ -1161,6 +1172,45 @@ - lasterror ()); - return; - } -+ -+#ifdef 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 */ -+ - /* change in number of messages? */ - if (existsquelled || (nmsgs != stream->nmsgs)) { - PSOUT ("* "); +*** src/imapd/imapd.c.orig Mon Apr 23 16:45:41 2001 +--- src/imapd/imapd.c Tue Apr 24 22:14:38 2001 +*************** +*** 29,34 **** +--- 29,39 ---- + #include "c-client.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 */ + +*************** +*** 173,178 **** +--- 178,189 ---- + + /* 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 = "2001.303"; /* version number of this server */ + time_t alerttime = 0; /* time of last alert */ + time_t sysalerttime = 0; /* time of last system alert */ +*************** +*** 1167,1172 **** +--- 1178,1222 ---- + lasterror ()); + return; + } ++ ++ #ifdef 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 */ ++ + /* change in number of messages? */ + if (existsquelled || (nmsgs != stream->nmsgs)) { + PSOUT ("* "); |