This is like ACLCheckUserCredentials(), however if the user/pass * are correct, the connection is put in authenticated state and the * connection user reference is populated. * * The return value is C_OK or C_ERR with the same meaning as * ACLCheckUserCredentials(). */
| 1117 | * The return value is C_OK or C_ERR with the same meaning as |
| 1118 | * ACLCheckUserCredentials(). */ |
| 1119 | int ACLAuthenticateUser(client *c, robj *username, robj *password) { |
| 1120 | if (ACLCheckUserCredentials(username,password) == C_OK) { |
| 1121 | c->authenticated = 1; |
| 1122 | c->user = ACLGetUserByName((sds)ptrFromObj(username),sdslen((sds)ptrFromObj(username))); |
| 1123 | moduleNotifyUserChanged(c); |
| 1124 | return C_OK; |
| 1125 | } else { |
| 1126 | addACLLogEntry(c,ACL_DENIED_AUTH,0,szFromObj(username)); |
| 1127 | return C_ERR; |
| 1128 | } |
| 1129 | } |
| 1130 | |
| 1131 | /* For ACL purposes, every user has a bitmap with the commands that such |
| 1132 | * user is allowed to execute. In order to populate the bitmap, every command |
no test coverage detected