From b7521dc7566fbd8bfb8a09f391ce0cd8c7f18e14 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Fri, 8 Jul 2011 12:56:21 +0200 Subject: [PATCH] s3 swat: Allow getting the user's HTTP auth password Signed-off-by: Kai Blin --- source3/web/cgi.c | 9 +++++++++ source3/web/swat_proto.h | 1 + 2 files changed, 10 insertions(+) diff --git a/source3/web/cgi.c b/source3/web/cgi.c index cc31eef97e5..4bd24b72f17 100644 --- a/source3/web/cgi.c +++ b/source3/web/cgi.c @@ -46,6 +46,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; @@ -401,6 +402,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; } @@ -435,6 +437,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 diff --git a/source3/web/swat_proto.h b/source3/web/swat_proto.h index 0f84e4f4ce4..76f9c3c68f1 100644 --- a/source3/web/swat_proto.h +++ b/source3/web/swat_proto.h @@ -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); -- 2.11.4.GIT