From 2f668bd7c28bd5cfc9106bde3478130b95de30e1 Mon Sep 17 00:00:00 2001 From: Michael Theall Date: Sun, 26 Apr 2020 20:44:35 -0500 Subject: [PATCH] Hide user/pass arguments in log --- source/ftpSession.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/ftpSession.cpp b/source/ftpSession.cpp index 3700f25..62b75bc 100644 --- a/source/ftpSession.cpp +++ b/source/ftpSession.cpp @@ -1424,7 +1424,10 @@ void FtpSession::readCommand (int const events_) *delim = '\0'; decodePath (buffer, delim - buffer); - command ("%s\n", buffer); + if (::strncasecmp ("USER ", buffer, 5) == 0 || ::strncasecmp ("PASS ", buffer, 5) == 0) + command ("%.*s ******\n", 5, buffer); + else + command ("%s\n", buffer); char const *const command = buffer;