Skip to content
Snippets Groups Projects
Commit 121fd2fe authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add some log lines for SFTP logins, non-filebase file transfers

Q for Deuce: record_transfer() is being called multiple times for non-filebase
file transfers, resulting in duplicate log messages. This doesn't happen for
filebase file transfer (downloads, anyway).
parent ec6e6170
No related branches found
No related tags found
No related merge requests found
Pipeline #6046 passed
......@@ -444,6 +444,9 @@ bool sbbs_t::answer()
SAFECOPY(useron.comp, client_name);
useron.logons++;
putuserdat(&cfg,&useron);
snprintf(str, sizeof(str), "(%04u) %-25s %s Logon"
,useron.number, useron.alias, client.protocol);
logline("++", str);
}
else {
lprintf(LOG_NOTICE, "%04d Trying to create new user over sftp, disconnecting.", client_socket);
......
......@@ -1177,8 +1177,12 @@ copy_path_from_dir(char *p, const char *fp)
static void
record_transfer(sbbs_t *sbbs, sftp_filedescriptor_t desc, bool upload)
{
if (desc->dir == -1)
if (desc->dir == -1) {
char str[MAX_PATH + 1];
snprintf(str, sizeof str, "%s (%" PRId64 " bytes)", desc->local_path, flength(desc->local_path));
sbbs->logline(upload ? "U+" : "D-", str);
return;
}
char *nptr = strrchr(desc->local_path, '/');
if (nptr != nullptr) {
file_t file{};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment