diff options
author | Kai Blin <kai@samba.org> | 2011-07-08 15:04:12 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2011-07-26 20:48:03 +0200 |
commit | ac070b0e400bfe74c77331308e10db6da4e53ab9 (patch) | |
tree | b072692fa8f2627e00140e20b1b740a56f0e97b9 | |
parent | b7af3ce33f4d640d83e3afbe3da487b6782df976 (diff) | |
download | samba-ac070b0e400bfe74c77331308e10db6da4e53ab9.tar.gz |
s3 swat: Add XSRF protection to globals page
Signed-off-by: Kai Blin <kai@samba.org>
(cherry picked from commit 6ea5fac27f2fef35ea12c24250948e00245aacee)
-rw-r--r-- | source3/web/swat.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c index 88efe8e6754..2c99f57829f 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -921,9 +921,14 @@ static void globals_page(void) { unsigned int parm_filter = FLAG_BASIC; int mode = 0; + const char form_name[] = "globals"; printf("<H2>%s</H2>\n", _("Global Parameters")); + if (!verify_xsrf_token(form_name)) { + goto output_page; + } + if (cgi_variable("Commit")) { commit_parameters(GLOBAL_SECTION_SNUM); save_reload(0); @@ -936,7 +941,9 @@ static void globals_page(void) if ( cgi_variable("AdvMode")) mode = 1; +output_page: printf("<form name=\"swatform\" method=post action=globals>\n"); + print_xsrf_token(cgi_user_name(), cgi_user_pass(), form_name); ViewModeBoxes( mode ); switch ( mode ) { |