3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

review fixes

This commit is contained in:
Shivaram Lingamneni 2019-02-25 22:56:08 -05:00
parent b0f89062fa
commit d13f58acf0

View File

@ -205,11 +205,11 @@ func (client *Client) doIdentLookup(conn net.Conn) {
func (client *Client) isAuthorized(config *Config) bool {
saslSent := client.account != ""
// PASS requirement
if !((config.Server.passwordBytes == nil) || client.sentPassCommand || (config.Accounts.SkipServerPassword && saslSent)) {
if (config.Server.passwordBytes != nil) && !client.sentPassCommand && !(config.Accounts.SkipServerPassword && saslSent) {
return false
}
// Tor connections may be required to authenticate with SASL
if config.Server.TorListeners.RequireSasl && !saslSent {
if client.isTor && config.Server.TorListeners.RequireSasl && !saslSent {
return false
}
// finally, enforce require-sasl