Lines 92-99
Link Here
|
92 |
|
92 |
|
93 |
static unsigned char have_dead_child = FALSE; |
93 |
static unsigned char have_dead_child = FALSE; |
94 |
|
94 |
|
95 |
static char sbuf[PR_TUNABLE_BUFFER_SIZE] = {'\0'}; |
|
|
96 |
|
97 |
#define PR_DEFAULT_CMD_BUFSZ 512 |
95 |
#define PR_DEFAULT_CMD_BUFSZ 512 |
98 |
|
96 |
|
99 |
/* From mod_auth_unix.c */ |
97 |
/* From mod_auth_unix.c */ |
Lines 108-114
Link Here
|
108 |
static int syntax_check = 0; |
106 |
static int syntax_check = 0; |
109 |
|
107 |
|
110 |
static const char *protocol_name = "FTP"; |
108 |
static const char *protocol_name = "FTP"; |
|
|
109 |
|
110 |
/* This protocol_name_lc variable is used only by WtmpLog logging. Newer |
111 |
* BSD variants require a name of "ftp" while other, non-BSD variants |
112 |
* prefer "ftpd". |
113 |
*/ |
114 |
#if (defined(BSD) && (BSD >= 199103)) |
111 |
static const char *protocol_name_lc = "ftp"; |
115 |
static const char *protocol_name_lc = "ftp"; |
|
|
116 |
#else |
117 |
static const char *protocol_name_lc = "ftpd"; |
118 |
#endif |
112 |
|
119 |
|
113 |
/* Command handling */ |
120 |
/* Command handling */ |
114 |
static void cmd_loop(server_rec *, conn_t *); |
121 |
static void cmd_loop(server_rec *, conn_t *); |
Lines 185-190
Link Here
|
185 |
} |
192 |
} |
186 |
|
193 |
|
187 |
static void end_login_noexit(void) { |
194 |
static void end_login_noexit(void) { |
|
|
195 |
char wtmp_buf[PR_TUNABLE_BUFFER_SIZE]; |
188 |
|
196 |
|
189 |
/* Clear the scoreboard entry. */ |
197 |
/* Clear the scoreboard entry. */ |
190 |
if (ServerType == SERVER_STANDALONE) { |
198 |
if (ServerType == SERVER_STANDALONE) { |
Lines 206-225
Link Here
|
206 |
strerror(errno)); |
214 |
strerror(errno)); |
207 |
} |
215 |
} |
208 |
|
216 |
|
|
|
217 |
if (session.wtmp_log) { |
218 |
memset(wtmp_buf, '\0', sizeof(wtmp_buf)); |
219 |
} |
220 |
|
209 |
/* If session.user is set, we have a valid login */ |
221 |
/* If session.user is set, we have a valid login */ |
210 |
if (session.user) { |
222 |
if (session.user) { |
211 |
#if (defined(BSD) && (BSD >= 199103)) |
223 |
#if (defined(BSD) && (BSD >= 199103)) |
212 |
snprintf(sbuf, sizeof(sbuf), "%s%ld", protocol_name_lc, |
224 |
snprintf(wtmp_buf, sizeof(wtmp_buf), "%s%ld", protocol_name_lc, |
213 |
(long) (session.pid ? session.pid : getpid())); |
225 |
(long) (session.pid ? session.pid : getpid())); |
214 |
#else |
226 |
#else |
215 |
snprintf(sbuf, sizeof(sbuf), "%s%d", protocol_name_lc, |
227 |
snprintf(wtmp_buf, sizeof(wtmp_buf), "%s%d", protocol_name_lc, |
216 |
(int) (session.pid ? session.pid : getpid())); |
228 |
(int) (session.pid ? session.pid : getpid())); |
217 |
#endif |
229 |
#endif |
218 |
sbuf[sizeof(sbuf) - 1] = '\0'; |
230 |
wtmp_buf[sizeof(wtmp_buf) - 1] = '\0'; |
219 |
|
231 |
|
220 |
if (session.wtmp_log) |
232 |
if (session.wtmp_log) { |
221 |
log_wtmp(sbuf, "", pr_netaddr_get_sess_remote_name(), |
233 |
log_wtmp(wtmp_buf, "", pr_netaddr_get_sess_remote_name(), |
222 |
pr_netaddr_get_sess_remote_addr()); |
234 |
pr_netaddr_get_sess_remote_addr()); |
|
|
235 |
} |
223 |
} |
236 |
} |
224 |
|
237 |
|
225 |
/* These are necessary in order that cleanups associated with these pools |
238 |
/* These are necessary in order that cleanups associated with these pools |
Lines 573-579
Link Here
|
573 |
} |
586 |
} |
574 |
|
587 |
|
575 |
protocol_name_lc = lc; |
588 |
protocol_name_lc = lc; |
576 |
|
|
|
577 |
return 0; |
589 |
return 0; |
578 |
} |
590 |
} |
579 |
|
591 |
|