From: Kai Blin Date: Fri, 8 Jul 2011 13:02:53 +0000 (+0200) Subject: s3 swat: Add XSRF protection to viewconfig page X-Git-Tag: talloc-2.0.6~403 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=00d255fc1d91f2baae9294c838012b9b2cb6dfbc;p=samba.git s3 swat: Add XSRF protection to viewconfig page Signed-off-by: Kai Blin --- diff --git a/source3/web/swat.c b/source3/web/swat.c index 353b7faf590..93661457000 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -678,13 +678,20 @@ static void welcome_page(void) static void viewconfig_page(void) { int full_view=0; + const char form_name[] = "viewconfig"; + + if (!verify_xsrf_token(form_name)) { + goto output_page; + } if (cgi_variable("full_view")) { full_view = 1; } +output_page: printf("

%s

\n", _("Current Config")); printf("
\n"); + print_xsrf_token(cgi_user_name(), cgi_user_pass(), form_name); if (full_view) { printf("\n", _("Normal View"));