summaryrefslogtreecommitdiffstats
path: root/source/web/cgi.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-03-12 02:42:39 +0000
committerAndrew Tridgell <tridge@samba.org>1998-03-12 02:42:39 +0000
commit53dc8ea5e315abf9ee8d38ffdb8a3057df0235be (patch)
tree866e08d09c6b9662380389e683da751799ab4650 /source/web/cgi.c
parente826790666a7fb4a39ecdbc8c8084d484a011a62 (diff)
downloadsamba-53dc8ea5e315abf9ee8d38ffdb8a3057df0235be.tar.gz
samba-53dc8ea5e315abf9ee8d38ffdb8a3057df0235be.tar.xz
samba-53dc8ea5e315abf9ee8d38ffdb8a3057df0235be.zip
use password_ok() instead of calling crypt()
Diffstat (limited to 'source/web/cgi.c')
-rw-r--r--source/web/cgi.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/source/web/cgi.c b/source/web/cgi.c
index 2008f9a8d36..6468c92917e 100644
--- a/source/web/cgi.c
+++ b/source/web/cgi.c
@@ -459,8 +459,6 @@ handle a http authentication line
static int cgi_handle_authorization(char *line)
{
char *p, *user, *pass;
- struct passwd *pwd;
- int ret=0;
if (strncasecmp(line,"Basic ", 6)) {
cgi_setup_error("401 Bad Authorization", "",
@@ -478,20 +476,13 @@ static int cgi_handle_authorization(char *line)
pass = p+1;
/* currently only allow connections as root */
- if (strcasecmp(user,"root")) {
+ if (strcmp(user,"root")) {
cgi_setup_error("401 Bad Authorization", "",
"incorrect username/password");
}
-
- pwd = getpwnam(user);
-
- if (!strcmp((char *)crypt(pass, pwd->pw_passwd),pwd->pw_passwd)) {
- ret = 1;
- }
- memset(pass, 0, strlen(pass));
- return ret;
+ return password_ok(user, pass, strlen(pass), NULL);
}