summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2011-07-08 15:03:44 +0200
committerKarolin Seeger <kseeger@samba.org>2011-07-24 21:27:19 +0200
commitd499c09fc7bf6d86e9694bc8dc60b96c80d94c35 (patch)
treec861d603c2a130a00b13791dfa00c1c0b78b05d1
parent4b64b7e57d729df996d0734444415f12c066b89f (diff)
downloadsamba-d499c09fc7bf6d86e9694bc8dc60b96c80d94c35.tar.gz
s3 swat: Add XSRF protection to wizard page
Signed-off-by: Kai Blin <kai@samba.org>
-rw-r--r--source3/web/swat.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c
index df3216e0103..30bc2964d2f 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -752,6 +752,11 @@ static void wizard_page(void)
int have_home = -1;
int HomeExpo = 0;
int SerType = 0;
+ const char form_name[] = "wizard";
+
+ if (!verify_xsrf_token(form_name)) {
+ goto output_page;
+ }
if (cgi_variable("Rewrite")) {
(void) rewritecfg_file();
@@ -842,10 +847,12 @@ static void wizard_page(void)
winstype = 3;
role = lp_server_role();
-
+
+output_page:
/* Here we go ... */
printf("<H2>%s</H2>\n", _("Samba Configuration Wizard"));
printf("<form method=post action=wizard>\n");
+ print_xsrf_token(cgi_user_name(), cgi_user_pass(), form_name);
if (have_write_access) {
printf("%s\n", _("The \"Rewrite smb.conf file\" button will clear the smb.conf file of all default values and of comments."));