aboutsummaryrefslogtreecommitdiff
path: root/networking/httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/httpd.c')
-rw-r--r--networking/httpd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 78c6f4d1d..352a97d3c 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1721,7 +1721,6 @@ static int checkPerm(const char *path, const char *request)
1721 } 1721 }
1722 1722
1723 if (ENABLE_FEATURE_HTTPD_AUTH_MD5) { 1723 if (ENABLE_FEATURE_HTTPD_AUTH_MD5) {
1724 char *cipher;
1725 char *pp; 1724 char *pp;
1726 1725
1727 if (strncmp(p, request, u - request) != 0) { 1726 if (strncmp(p, request, u - request) != 0) {
@@ -1732,9 +1731,10 @@ static int checkPerm(const char *path, const char *request)
1732 if (pp && pp[1] == '$' && pp[2] == '1' 1731 if (pp && pp[1] == '$' && pp[2] == '1'
1733 && pp[3] == '$' && pp[4] 1732 && pp[3] == '$' && pp[4]
1734 ) { 1733 ) {
1735 pp++; 1734 char *encrypted = pw_encrypt(u+1, ++pp, 1);
1736 cipher = pw_encrypt(u+1, pp, 1); 1735 int r = strcmp(encrypted, pp);
1737 if (strcmp(cipher, pp) == 0) 1736 free(encrypted);
1737 if (r == 0)
1738 goto set_remoteuser_var; /* Ok */ 1738 goto set_remoteuser_var; /* Ok */
1739 /* unauthorized */ 1739 /* unauthorized */
1740 continue; 1740 continue;