Project

General

Profile

Bug #73 ยป lighttpd-1.4.3-md5_crypt.diff

-- tribunal - Anonymous, 2005-09-15 19:14

View differences:

lighttpd-1.4.3/src/http_auth.c 2005-09-15 21:08:07.000000000 +0200
}
} else if (p->conf.auth_backend == AUTH_BACKEND_HTPASSWD) {
#ifdef HAVE_CRYPT
char salt[3];
char salt[13];
char *crypted;
int i;
/*
* htpasswd format
*
* user:crypted password
*/
salt[0] = '$';
salt[1] = '1';
salt[2] = '$';
for (i=3; i<=11; i++)
salt[i] = password->ptr[i];
salt[12] = '\0';
salt[0] = password->ptr[0];
salt[1] = password->ptr[1];
salt[2] = '\0';
crypted = crypt(pw, salt);
if (0 == strcmp(password->ptr, crypted)) {
    (1-1/1)