Merged Pietern patch for VM key args helper function. Fixed an obvious bug in the redis-cli passwd auth stuff

This commit is contained in:
antirez
2010-03-17 17:14:07 +01:00
2 changed files with 121 additions and 107 deletions

View File

@ -312,21 +312,16 @@ static int cliLogin(int fd)
int retval = 1;
sds cmd;
char type;
if (config.authpw != "")
{
if (config.authpw[0] != '\0') {
cmd = sdsempty();
cmd = sdscatprintf(cmd,"AUTH %s\r\n",config.authpw);
anetWrite(fd,cmd,sdslen(cmd));
anetRead(fd,&type,1);
if (type == '+')
{
retval = 0;
}
int ret2 = cliReadSingleLineReply(fd,1);
if (ret2)
{
close(fd);
}
} else {
retval = 0;
}