mirror of
https://github.com/samba-team/samba.git
synced 2025-11-07 12:23:51 +03:00
s3 swat: Add XSRF protection to viewconfig page
Signed-off-by: Kai Blin <kai@samba.org>
This commit is contained in:
@@ -678,13 +678,20 @@ static void welcome_page(void)
|
|||||||
static void viewconfig_page(void)
|
static void viewconfig_page(void)
|
||||||
{
|
{
|
||||||
int full_view=0;
|
int full_view=0;
|
||||||
|
const char form_name[] = "viewconfig";
|
||||||
|
|
||||||
|
if (!verify_xsrf_token(form_name)) {
|
||||||
|
goto output_page;
|
||||||
|
}
|
||||||
|
|
||||||
if (cgi_variable("full_view")) {
|
if (cgi_variable("full_view")) {
|
||||||
full_view = 1;
|
full_view = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output_page:
|
||||||
printf("<H2>%s</H2>\n", _("Current Config"));
|
printf("<H2>%s</H2>\n", _("Current Config"));
|
||||||
printf("<form method=post>\n");
|
printf("<form method=post>\n");
|
||||||
|
print_xsrf_token(cgi_user_name(), cgi_user_pass(), form_name);
|
||||||
|
|
||||||
if (full_view) {
|
if (full_view) {
|
||||||
printf("<input type=submit name=\"normal_view\" value=\"%s\">\n", _("Normal View"));
|
printf("<input type=submit name=\"normal_view\" value=\"%s\">\n", _("Normal View"));
|
||||||
|
|||||||
Reference in New Issue
Block a user