From d0ddb9f01ad498b50fbd2ce4d265936a632184d3 Mon Sep 17 00:00:00 2001 From: sgunderson Date: Mon, 26 Mar 2001 14:40:03 +0000 Subject: [PATCH] Made xferlog support slightly more standards-compliant and useful. --- cmds.c | 5 +++-- ftpd.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmds.c b/cmds.c index 9d19d72..5bc5bc2 100644 --- a/cmds.c +++ b/cmds.c @@ -329,7 +329,7 @@ int cmd_pass(struct conn * const c) ) { c->auth = 0; } else { - c->auth = 3; + c->auth = 4; } } #endif /* !WANT_NONROOT */ @@ -345,6 +345,7 @@ int cmd_pass(struct conn * const c) chdir(c->curr_dir); dump_file(c, 230, "welcome.msg"); #endif + /* Have a different message for anonymous users? */ numeric(c, 230, "User logged in."); } return 1; @@ -908,7 +909,7 @@ char conn_state[5][27] = { "Waiting for e-mail address", "Waiting for password", "Logged in", - "Waiting for password", /* actually non-existant user */ + "Logged in", /* non-anonymous */ }; char ftran_state[6][42] = { diff --git a/ftpd.c b/ftpd.c index 2a01996..d358781 100644 --- a/ftpd.c +++ b/ftpd.c @@ -847,11 +847,11 @@ void write_xferlog(struct ftran *f) if (xferlog == NULL) return; - strftime(temp, 256, "%a %b %d %H:%M:%S %Y", t); + strftime(temp, 256, "%a %b %d %H:%M:%S %Y", t); #if WANT_UPLOAD - fprintf(xferlog, "%s %u %s %lu %s b _ %c a %s ftp 0 * \n", + fprintf(xferlog, "%s %u %s %lu %s b _ %c %c %s ftp 0 *\n", #else - fprintf(xferlog, "%s %u %s %lu %s b _ o a %s ftp 0 *\n", + fprintf(xferlog, "%s %u %s %lu %s b _ o %c %s ftp 0 *\n", #endif temp, (int)(difftime(now, f->tran_start)), inet_ntoa(f->sin.sin_addr), f->size, @@ -859,7 +859,7 @@ void write_xferlog(struct ftran *f) #if WANT_UPLOAD (f->upload) ? 'i' : 'o', #endif - f->owner->username); + (f->owner->auth == 4) ? 'r' : 'a', f->owner->username); fflush(xferlog); #if 0 -- 2.39.2