Move client/filename logging so that it happens even on a file not found

This commit is contained in:
hpa 2001-07-10 22:05:21 +00:00
parent fc5f978d68
commit 3fa5d9d604

View file

@ -475,6 +475,16 @@ tftp(struct tftphdr *tp, int size)
nak(EACCES); /* File denied by mapping rule */
exit(0);
}
if ( verbosity >= 1 ) {
if ( filename == origfilename || !strcmp(filename, origfilename) )
syslog(LOG_NOTICE, "%s from %s filename %s\n",
tp->th_opcode == WRQ ? "WRQ" : "RRQ",
inet_ntoa(from.sin_addr), filename);
else
syslog(LOG_NOTICE, "%s from %s filename %s remapped to %s\n",
tp->th_opcode == WRQ ? "WRQ" : "RRQ",
inet_ntoa(from.sin_addr), origfilename, filename);
}
ecode = (*pf->f_validate)(filename, tp->th_opcode, pf);
if (ecode) {
nak(ecode);
@ -494,17 +504,6 @@ tftp(struct tftphdr *tp, int size)
exit(0);
}
if ( verbosity >= 1 ) {
if ( filename == origfilename || !strcmp(filename, origfilename) )
syslog(LOG_NOTICE, "%s from %s filename %s\n",
tp->th_opcode == WRQ ? "WRQ" : "RRQ",
inet_ntoa(from.sin_addr), filename);
else
syslog(LOG_NOTICE, "%s from %s filename %s remapped to %s\n",
tp->th_opcode == WRQ ? "WRQ" : "RRQ",
inet_ntoa(from.sin_addr), origfilename, filename);
}
if ( ap != (ackbuf+2) ) {
if ( tp->th_opcode == WRQ )
(*pf->f_recv)(pf, ackbuf, ap-ackbuf);