Date: Mon, 26 Dec 1994 09:34:03 -0600 From: Peter da Silva <peter@bonkers.taronga.com> To: roberto@blaise.ibp.fr (Ollivier ROBERT) Cc: hackers@freebsd.org (Hackers' list FreeBSD) Subject: Re: And some free association about logging Message-ID: <199412261534.JAA27802@bonkers.taronga.com> In-Reply-To: Your message of "Mon, 26 Dec 94 16:46:18 %2B0100." <9412261546.AA09954@blaise.ibp.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199412261534.JAA27802>
