diff -uNr ./Makefile ../popa3d-0.4.trzad/Makefile --- ./Makefile Tue Feb 1 04:56:46 2000 +++ ../popa3d-0.4.trzad/Makefile Thu Nov 9 14:30:35 2000 @@ -4,6 +4,7 @@ CFLAGS = -c -Wall -O2 -fomit-frame-pointer LDFLAGS = -s #LDFLAGS = -s -lcrypt +LDFLAGS += -lwhoson PROJ = popa3d OBJS = md5/md5.o \ diff -uNr ./params.h ../popa3d-0.4.trzad/params.h --- ./params.h Tue Feb 1 07:16:24 2000 +++ ../popa3d-0.4.trzad/params.h Wed Nov 8 13:21:06 2000 @@ -8,7 +8,7 @@ /* * Are we going to be a standalone server, or start via an inetd clone? */ -#define POP_STANDALONE 0 +#define POP_STANDALONE 1 #if POP_STANDALONE diff -uNr ./pop_auth.c ../popa3d-0.4.trzad/pop_auth.c --- ./pop_auth.c Thu Mar 25 05:25:55 1999 +++ ../popa3d-0.4.trzad/pop_auth.c Wed Nov 8 13:51:55 2000 @@ -11,6 +11,7 @@ #include "params.h" #include "protocol.h" #include "pop_auth.h" +#include static char *pop_user, *pop_pass; @@ -61,7 +62,7 @@ return 0; } -void log_pop_auth(int result, char *mailbox) +void log_pop_auth(int result, char *mailbox,char *whoson_addr) { if (result == AUTH_NONE) { syslog(SYSLOG_PRIORITY, "Didn't attempt authentication"); @@ -71,4 +72,8 @@ syslog(SYSLOG_PRIORITY, "Authentication %s for %s", result == AUTH_OK ? "passed" : "failed", mailbox ? mailbox : "UNKNOWN"); + if (result == AUTH_OK) { + wso_login(whoson_addr,mailbox,0,0); + return; + } } diff -uNr ./pop_auth.h ../popa3d-0.4.trzad/pop_auth.h --- ./pop_auth.h Thu Mar 25 05:25:55 1999 +++ ../popa3d-0.4.trzad/pop_auth.h Wed Nov 8 13:38:48 2000 @@ -22,6 +22,6 @@ * Logs an authentication attempt for mailbox (or NULL if the requested * mailbox doesn't exist). */ -extern void log_pop_auth(int result, char *mailbox); +extern void log_pop_auth(int result, char *mailbox, char *whoson_addr); #endif diff -uNr ./pop_root.c ../popa3d-0.4.trzad/pop_root.c --- ./pop_root.c Tue Feb 1 07:18:12 2000 +++ ../popa3d-0.4.trzad/pop_root.c Wed Nov 8 13:17:55 2000 @@ -214,7 +214,7 @@ return 0; } -int do_pop_session() +int do_pop_session(char *whoson_addr) { int channel[2]; int result, status; @@ -248,12 +248,12 @@ if (result == AUTH_OK) { if (close(channel[0])) return log_error("close"); - log_pop_auth(result, mailbox); + log_pop_auth(result, mailbox,whoson_addr); return do_pop_trans(mailbox); } if (set_user(&pop_pw)) return 1; - log_pop_auth(result, mailbox); + log_pop_auth(result, mailbox,whoson_addr); #ifdef AUTH_FAILED_MESSAGE if (result == AUTH_FAILED) pop_reply("-ERR %s", AUTH_FAILED_MESSAGE); diff -uNr ./standalone.c ../popa3d-0.4.trzad/standalone.c --- ./standalone.c Tue Feb 1 05:20:16 2000 +++ ../popa3d-0.4.trzad/standalone.c Wed Nov 8 13:32:23 2000 @@ -20,7 +20,6 @@ #include #include #include - /* * These are defined in pop_root.c. */ @@ -70,6 +69,7 @@ int main() { + int true = 1; int sock, new; struct sockaddr_in addr; @@ -179,15 +179,18 @@ break; case 0: + { + char buf[80]; + strncpy(buf, inet_ntoa(addr.sin_addr), 80); syslog(SYSLOG_PRIORITY, "Session from %s", - inet_ntoa(addr.sin_addr)); + buf); if (close(sock)) return log_error("close"); if (dup2(new, 0) < 0) return log_error("dup2"); if (dup2(new, 1) < 0) return log_error("dup2"); if (dup2(new, 2) < 0) return log_error("dup2"); if (close(new)) return log_error("close"); - return do_pop_session(); - + return do_pop_session(buf); + } default: sessions[j].addr = addr.sin_addr; (volatile int)sessions[j].pid = pid;