freebsd-ports/mail/imap-uw/files/patch-ai
Anders Nordby 5e24c5be98 Update cclient & imap-uw ports to imap-2001a.
Fix typos in imap-uw's pkg-req.ssl.

Submitted by:	dougb (parts of this)
2001-12-08 16:36:01 +00:00

73 lines
2 KiB
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- src/imapd/imapd.c.orig Sat Dec 8 14:25:00 2001
+++ src/imapd/imapd.c Sat Dec 8 14:28:55 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.315"; /* version number of this server */
time_t alerttime = 0; /* time of last alert */
time_t sysalerttime = 0; /* time of last system alert */
@@ -1226,6 +1237,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 ("* ");