forked from mirrors/tftp-hpa-google
Move client/filename logging so that it happens even on a file not found
This commit is contained in:
parent
fc5f978d68
commit
3fa5d9d604
1 changed files with 10 additions and 11 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue