Ticket refs #15759: CMWP authentication with blank credentials

This commit is contained in:
Omar Kallel 2018-09-18 10:32:10 +01:00
parent 12d58fcfa7
commit 9f300a44bd
2 changed files with 17 additions and 1 deletions

View file

@ -678,6 +678,14 @@ int get_global_config(struct config *conf)
conf->cpe_userid = value;
value = NULL;
}
else
{
if (conf->cpe_userid!=NULL)
{
free(conf->cpe_userid);
}
conf->cpe_userid = strdup("");
}
}
else
{
@ -694,6 +702,14 @@ int get_global_config(struct config *conf)
conf->cpe_passwd = value;
value = NULL;
}
else
{
if (conf->cpe_passwd!=NULL)
{
free(conf->cpe_passwd);
}
conf->cpe_passwd = strdup("");
}
}
else
{

View file

@ -371,7 +371,7 @@ int http_digest_auth_check(const char *http_method, const char *url,
char un[MAX_USERNAME_LENGTH];
len = lookup_sub_value(un, sizeof(un), header, "username");
if ((0 == len) || (0 != strcmp(username, un)))
if (0 != strcmp(username, un))
return MHD_NO;
left -= strlen("username") + len;
}