Prompted by RedHat bugzilla bug #77999, convert the user's username and
authorAndrew Bartlett <abartlet@samba.org>
Sat, 1 Feb 2003 06:17:32 +0000 (06:17 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 1 Feb 2003 06:17:32 +0000 (06:17 +0000)
password from 'display' to 'unix' before we check them.

Andrew Bartlett
(This used to be commit 98a4ebf55cfce9da2c187d89a4f9c7b34e5f999e)

source3/web/cgi.c

index 35f32662833fb28c204105a489a7f699b48d301c..46f33789bfcc2bdbed19c7a85655ea49ec2b80c3 100644 (file)
@@ -297,7 +297,8 @@ handle a http authentication line
   ***************************************************************************/
 static BOOL cgi_handle_authorization(char *line)
 {
-       char *p, *user, *user_pass;
+       char *p;
+       fstring user, user_pass;
        struct passwd *pass = NULL;
 
        if (strncasecmp(line,"Basic ", 6)) {
@@ -314,9 +315,15 @@ static BOOL cgi_handle_authorization(char *line)
                goto err;
        }
        *p = 0;
-       user = line;
-       user_pass = p+1;
-       
+
+       convert_string(CH_DISPLAY, CH_UNIX, 
+                      line, -1, 
+                      user, sizeof(user));
+
+       convert_string(CH_DISPLAY, CH_UNIX, 
+                      p+1, -1, 
+                      user_pass, sizeof(user_pass));
+
        /*
         * Try and get the user from the UNIX password file.
         */