From a28bff79fb04adf4d5008c39f709e238e97a45d2 Mon Sep 17 00:00:00 2001 From: Eveldee Date: Mon, 22 Jul 2019 11:19:42 +0200 Subject: [PATCH] Fix BypassGuestPassword Was bypassing all users passwords and not only Guest --- DearFTP/Connection/Commands/UserCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DearFTP/Connection/Commands/UserCommand.cs b/DearFTP/Connection/Commands/UserCommand.cs index ff3af45..8ecd2b4 100644 --- a/DearFTP/Connection/Commands/UserCommand.cs +++ b/DearFTP/Connection/Commands/UserCommand.cs @@ -16,10 +16,10 @@ namespace DearFTP.Connection.Commands { var configuration = FtpServer.Instance.Configuration; var user = configuration.Users.FirstOrDefault(x => x.Name == argument); + string guest = configuration.Server.Guest; if (user == null) { - string guest = configuration.Server.Guest; if (string.IsNullOrWhiteSpace(guest)) { @@ -31,7 +31,7 @@ namespace DearFTP.Connection.Commands user = configuration.Users.First(x => x.Name == guest); } - if (!string.IsNullOrWhiteSpace(user.Password) && !(session.RemoteIP.IsInternal() && configuration.Server.BypassGuestPassword)) + if (!string.IsNullOrWhiteSpace(user.Password) && !(session.RemoteIP.IsInternal() && configuration.Server.BypassGuestPassword && user.Name == guest)) { stream.Send(ResponseCode.NeedPassword, "Please specify the password.");