From 693dc7747a09e4b412c983eab15fe601ea38dd39 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Tue, 17 Dec 2013 20:10:25 -0500 Subject: Close session immediately after use to prevent blocking. --- config/snort/snort_rules_flowbits.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'config/snort/snort_rules_flowbits.php') diff --git a/config/snort/snort_rules_flowbits.php b/config/snort/snort_rules_flowbits.php index 2f13d6bc..325276ee 100644 --- a/config/snort/snort_rules_flowbits.php +++ b/config/snort/snort_rules_flowbits.php @@ -1,16 +1,7 @@ . - * All rights reserved. - * - * modified for the pfsense snort package - * Copyright (C) 2009-2010 Robert Zelaya. + * Copyright (C) 2013 Bill Meeks * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,18 +42,23 @@ if (!is_array($config['installedpackages']['snortglobal']['rule'])) { $a_nat = &$config['installedpackages']['snortglobal']['rule']; // Set who called us so we can return to the correct page with -// the RETURN button. We will just trust this User-Agent supplied -// string for now. +// the RETURN button. Save the original referrer and the query +// string in session variables. session_start(); -if(!isset($_SESSION['org_referer'])) - $_SESSION['org_referer'] = $_SERVER['HTTP_REFERER']; -$referrer = $_SESSION['org_referer']; +if (!isset($_SESSION['org_referrer']) || isset($_GET['returl'])) { + $_SESSION['org_referrer'] = urldecode($_GET['returl']); + $_SESSION['org_querystr'] = $_SERVER['QUERY_STRING']; +} +$referrer = $_SESSION['org_referrer']; +$querystr = $_SESSION['org_querystr']; +session_write_close(); if ($_POST['cancel']) { session_start(); - unset($_SESSION['org_referer']); + unset($_SESSION['org_referrer']); + unset($_SESSION['org_querystr']); session_write_close(); - header("Location: {$referrer}"); + header("Location: {$referrer}?{$querystr}"); exit; } @@ -71,7 +67,8 @@ if (isset($_POST['id'])) $id = $_POST['id']; if (is_null($id)) { session_start(); - unset($_SESSION['org_referer']); + unset($_SESSION['org_referrer']); + unset($_SESSION['org_querystr']); session_write_close(); header("Location: /snort/snort_interfaces.php"); exit; -- cgit v1.2.3