diff options
author | Kai Blin <kai@samba.org> | 2011-07-08 15:03:15 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2011-07-27 19:40:00 +0200 |
commit | 8aee1024450155fd37b776bfa0bbfef063638590 (patch) | |
tree | 41cfd7ad7e1883e330bb6b034526b581ab0bed2d | |
parent | 6af465aa66ac9930fdf6676bdb0e5e1c7914f1fc (diff) | |
download | samba-8aee1024450155fd37b776bfa0bbfef063638590.tar.gz samba-8aee1024450155fd37b776bfa0bbfef063638590.tar.xz samba-8aee1024450155fd37b776bfa0bbfef063638590.zip |
s3 swat: Add XSRF protection to wizard_params page
Signed-off-by: Kai Blin <kai@samba.org>
(cherry picked from commit 94f8482607a175c44436fae456fbda3624629982)
-rw-r--r-- | source/web/swat.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/web/swat.c b/source/web/swat.c index 647126fc280..b7eec4a88aa 100644 --- a/source/web/swat.c +++ b/source/web/swat.c @@ -697,18 +697,25 @@ output_page: static void wizard_params_page(void) { unsigned int parm_filter = FLAG_WIZARD; + const char form_name[] = "wizard_params"; /* Here we first set and commit all the parameters that were selected in the previous screen. */ printf("<H2>%s</H2>\n", _("Wizard Parameter Edit Page")); + if (!verify_xsrf_token(form_name)) { + goto output_page; + } + if (cgi_variable("Commit")) { commit_parameters(GLOBAL_SECTION_SNUM); save_reload(0); } +output_page: printf("<form name=\"swatform\" method=post action=wizard_params>\n"); + print_xsrf_token(cgi_user_name(), cgi_user_pass(), form_name); if (have_write_access) { printf("<input type=submit name=\"Commit\" value=\"Commit Changes\">\n"); |