From owner-freebsd-hackers Mon Dec 26 07:57:50 1994 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id HAA27443 for hackers-outgoing; Mon, 26 Dec 1994 07:57:50 -0800 Received: from UUCP-GW.CC.UH.EDU (root@UUCP-GW.CC.UH.EDU [129.7.1.11]) by freefall.cdrom.com (8.6.9/8.6.6) with SMTP id PAA27422 for ; Mon, 26 Dec 1994 15:57:39 GMT Received: from Taronga.COM by UUCP-GW.CC.UH.EDU with UUCP id AA06925 (5.67a/IDA-1.5); Mon, 26 Dec 1994 09:54:14 -0600 Received: by bonkers.taronga.com (smail2.5p) id AA27805; 26 Dec 94 09:34:05 CST (Mon) Received: from localhost (localhost [127.0.0.1]) by bonkers.taronga.com (8.6.8/8.6.6) with SMTP id JAA27802; Mon, 26 Dec 1994 09:34:05 -0600 Message-Id: <199412261534.JAA27802@bonkers.taronga.com> X-Authentication-Warning: bonkers.taronga.com: Host localhost didn't use HELO protocol To: roberto@blaise.ibp.fr (Ollivier ROBERT) Cc: hackers@freebsd.org (Hackers' list FreeBSD) Subject: Re: And some free association about logging In-Reply-To: Your message of "Mon, 26 Dec 94 16:46:18 +0100." <9412261546.AA09954@blaise.ibp.fr> X-Mailer: exmh version 1.4.1 7/21/94 Date: Mon, 26 Dec 1994 09:34:03 -0600 From: Peter da Silva Sender: hackers-owner@freebsd.org Precedence: bulk OK, this is relative to the FTPD in 1.1.5.1. Also, the -L flag is part of incomplete changes. With -L security-logging stuff and connections would be done under LOG_WARN for easier tracking, but I put that on the back burner to dig into syslogd. *** ftpd.c.orig Fri Dec 23 10:19:35 1994 --- ftpd.c Fri Dec 23 11:45:22 1994 *************** *** 208,213 **** --- 208,219 ---- debug = 1; break; + #ifdef SECURITY_LOGGING + case 'L': + logging = 2; + break; + #endif + case 'l': logging = 1; break; *************** *** 550,555 **** --- 556,570 ---- struct stat st; int (*closefunc)(); + #ifdef SECURITY_LOGGING + if (logging) { + if(cmd) + syslog(LOG_INFO, "request %s(%s)", name, cmd); + else + syslog(LOG_INFO, "request %s", name); + } + #endif + if (cmd == 0) { fin = fopen(name, "r"), closefunc = fclose; st.st_size = 0; *************** *** 610,615 **** --- 625,636 ---- int (*closefunc)(); char *gunique(); + #ifdef SECURITY_LOGGING + if (logging) { + syslog(LOG_INFO, "store %s", name); + } + #endif + if (unique && stat(name, &st) == 0 && (name = gunique(name)) == NULL) return; *************** *** 948,953 **** --- 969,980 ---- FILE *fin; int c; + #ifdef SECURITY_LOGGING + if (logging) { + syslog(LOG_INFO, "stat %s", filename); + } + #endif + (void) sprintf(line, "/bin/ls -lgA %s", filename); fin = ftpd_popen(line, "r"); lreply(211, "status of %s:", filename); *************** *** 1091,1096 **** --- 1118,1129 ---- { struct stat st; + #ifdef SECURITY_LOGGING + if (logging) { + syslog(LOG_INFO, "delete %s", name); + } + #endif + if (stat(name, &st) < 0) { perror_reply(550, name); return; *************** *** 1113,1118 **** --- 1146,1156 ---- cwd(path) char *path; { + #ifdef SECURITY_LOGGING + if (logging) { + syslog(LOG_INFO, "chdir %s", path); + } + #endif if (chdir(path) < 0) perror_reply(550, path); else *************** *** 1122,1127 **** --- 1160,1170 ---- makedir(name) char *name; { + #ifdef SECURITY_LOGGING + if (logging) { + syslog(LOG_INFO, "makedir %s", name); + } + #endif if (mkdir(name, 0777) < 0) perror_reply(550, name); else *************** *** 1131,1136 **** --- 1174,1184 ---- removedir(name) char *name; { + #ifdef SECURITY_LOGGING + if (logging) { + syslog(LOG_INFO, "rmdir %s", name); + } + #endif if (rmdir(name) < 0) perror_reply(550, name); else *************** *** 1165,1170 **** --- 1213,1223 ---- renamecmd(from, to) char *from, *to; { + #ifdef SECURITY_LOGGING + if (logging) { + syslog(LOG_INFO, "rename %s to %s", from, to); + } + #endif if (rename(from, to) < 0) perror_reply(550, "rename"); else *************** *** 1345,1350 **** --- 1398,1408 ---- int simple = 0; char *strpbrk(); + #ifdef SECURITY_LOGGING + if (logging) { + syslog(LOG_INFO, "list %s", whichfiles); + } + #endif if (strpbrk(whichfiles, "~{[*?") != NULL) { extern char **ftpglob(), *globerr;