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.");