From 92fd03c5f08055283af55f5a1dffaf84edb7e9ce Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 21 Aug 2010 14:57:16 +0200 Subject: s3: Lift smbd_server_fd() from pass_check() --- source3/web/cgi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source3/web') diff --git a/source3/web/cgi.c b/source3/web/cgi.c index 9c9a365457..794152cd99 100644 --- a/source3/web/cgi.c +++ b/source3/web/cgi.c @@ -339,6 +339,8 @@ static bool cgi_handle_authorization(char *line) char *p; fstring user, user_pass; struct passwd *pass = NULL; + const char *rhost; + char addr[INET6_ADDRSTRLEN]; if (!strnequal(line,"Basic ", 6)) { goto err; @@ -369,11 +371,15 @@ static bool cgi_handle_authorization(char *line) pass = getpwnam_alloc(talloc_autofree_context(), user); + rhost = client_name(1); + if (strequal(rhost,"UNKNOWN")) + rhost = client_addr(1, addr, sizeof(addr)); + /* * Validate the password they have given. */ - if NT_STATUS_IS_OK(pass_check(pass, user, user_pass, false)) { + if NT_STATUS_IS_OK(pass_check(pass, user, rhost, user_pass, false)) { if (pass) { /* * Password was ok. -- cgit