Browse Source

Fix #1883 Nickserv gives error when user attempt to change password to *

tags/v2.9.0-rc1
William Rehwinkel 2 years ago
parent
commit
b929691470
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      irc/nickserv.go

+ 9
- 1
irc/nickserv.go View File

@@ -1146,6 +1146,7 @@ func nsConfirmPassword(server *Server, account, passphrase string) (errorMessage
1146 1146
 func nsPasswdHandler(service *ircService, server *Server, client *Client, command string, params []string, rb *ResponseBuffer) {
1147 1147
 	var target string
1148 1148
 	var newPassword string
1149
+	var checkPassword string
1149 1150
 	var errorMessage string
1150 1151
 
1151 1152
 	var oper *Oper
@@ -1170,9 +1171,16 @@ func nsPasswdHandler(service *ircService, server *Server, client *Client, comman
1170 1171
 		if newPassword == "*" {
1171 1172
 			newPassword = ""
1172 1173
 		}
1174
+
1175
+		// fix #1883 Nickserv gives error when user attempt to change password to *
1176
+		checkPassword = params[2]
1177
+		if checkPassword == "*" {
1178
+			checkPassword = ""
1179
+		}
1180
+
1173 1181
 		if target == "" {
1174 1182
 			errorMessage = `You're not logged into an account`
1175
-		} else if newPassword != params[2] {
1183
+		} else if newPassword != checkPassword {
1176 1184
 			errorMessage = `Passwords do not match`
1177 1185
 		} else {
1178 1186
 			if !nsLoginThrottleCheck(service, client, rb) {

Loading…
Cancel
Save