summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2011-07-08 12:56:21 +0200
committerKarolin Seeger <kseeger@samba.org>2011-07-24 20:43:01 +0200
commitb610e0cee563465c6b970647b215f8ae4d0c6599 (patch)
treee227f99d2ac336e673cf767720b57cc8443b5dc9
parentd401ccaedaec09ad6900ec24ecaf205bed3e3ac1 (diff)
downloadsamba-b610e0cee563465c6b970647b215f8ae4d0c6599.tar.gz
samba-b610e0cee563465c6b970647b215f8ae4d0c6599.tar.xz
samba-b610e0cee563465c6b970647b215f8ae4d0c6599.zip
s3 swat: Allow getting the user's HTTP auth password
Signed-off-by: Kai Blin <kai@samba.org>
-rw-r--r--source/web/cgi.c9
-rw-r--r--source/web/swat_proto.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/source/web/cgi.c b/source/web/cgi.c
index 72aa11c33bf..ccdc3a73e4d 100644
--- a/source/web/cgi.c
+++ b/source/web/cgi.c
@@ -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
diff --git a/source/web/swat_proto.h b/source/web/swat_proto.h
index 0f84e4f4ce4..76f9c3c68f1 100644
--- a/source/web/swat_proto.h
+++ b/source/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);