s3 swat: Allow getting the user's HTTP auth password
authorKai Blin <kai@samba.org>
Fri, 8 Jul 2011 10:56:21 +0000 (12:56 +0200)
committerKarolin Seeger <kseeger@samba.org>
Sun, 24 Jul 2011 19:27:09 +0000 (21:27 +0200)
Signed-off-by: Kai Blin <kai@samba.org>
source3/web/cgi.c
source3/web/swat_proto.h

index dd0aadb78680a4d7ad2aa0ce42757591a9908b23..8eef0b3b501151059c2081222bc5b83f2a04fa32 100644 (file)
@@ -42,6 +42,7 @@ static char *query_string;
 static const char *baseurl;
 static char *pathinfo;
 static char *C_user;
+static char *C_pass;
 static bool inetd_server;
 static bool got_request;
 
@@ -388,6 +389,7 @@ static bool cgi_handle_authorization(char *line)
                        
                        /* Save the users name */
                        C_user = SMB_STRDUP(user);
+                       C_pass = SMB_STRDUP(user_pass);
                        TALLOC_FREE(pass);
                        return True;
                }
@@ -422,6 +424,13 @@ char *cgi_user_name(void)
         return(C_user);
 }
 
+/***************************************************************************
+return a ptr to the users password
+  ***************************************************************************/
+char *cgi_user_pass(void)
+{
+        return(C_pass);
+}
 
 /***************************************************************************
 handle a file download
index 0f84e4f4ce46a92123141dbd5a9806159e9559b2..76f9c3c68f1f381604b76c96dd993bb17a2cd957 100644 (file)
@@ -31,6 +31,7 @@ const char *cgi_variable(const char *name);
 const char *cgi_variable_nonull(const char *name);
 bool am_root(void);
 char *cgi_user_name(void);
+char *cgi_user_pass(void);
 void cgi_setup(const char *rootdir, int auth_required);
 const char *cgi_baseurl(void);
 const char *cgi_pathinfo(void);