Button to create dump
authorJamie Cameron <jcameron@webmin.com>
Mon, 22 Jun 2009 13:36:41 +0000 (13:36 +0000)
committerJamie Cameron <jcameron@webmin.com>
Mon, 22 Jun 2009 13:36:41 +0000 (13:36 +0000)
shorewall/CHANGELOG
shorewall/dump.cgi [new file with mode: 0644]
shorewall/index.cgi
shorewall/lang/en

index 0428885..2a239e4 100644 (file)
@@ -37,3 +37,5 @@ Comments can now be created and edited in the rules table (and a few others), wh
 Added logging so that changes made using the module show up in the Webmin Actions Log module.
 ---- Changes since 1.390 ----
 Blacklist rules can now match any host.
+---- Changes since 1.480 ----
+Added a button to create a shorewall dump, thanks to a patch by Paul Gear.
diff --git a/shorewall/dump.cgi b/shorewall/dump.cgi
new file mode 100644 (file)
index 0000000..7f2e524
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/local/bin/perl
+# dump.cgi
+# Show a shorewall dump
+
+require './shorewall-lib.pl';
+&ui_print_header(undef, $text{'dump_title'}, "");
+print "<font size=-1><pre>";
+open(DUMP, "$config{'shorewall'} dump 2>&1 |");
+while(<DUMP>) {
+       print &html_escape($_);
+       }
+close(DUMP);
+print "</pre></font>\n";
+&ui_print_footer("", $text{'index_return'});
+
index 8e8ee0c..73e8728 100755 (executable)
@@ -38,7 +38,7 @@ else {
                # chain in the filter table
                print &ui_hr();
                print "<table width=100%>\n";
-               system("iptables -t filter -L shorewall -n >/dev/null 2>&1");
+               system("$config{'shorewall'} status 2>&1");
                if ($?) {
                  # Down .. offer to start
                  # unless no permissions
@@ -90,6 +90,12 @@ else {
                print "<tr> <td><input type=submit ",
                      "value='$text{'index_check'}'></td>\n";
                print "<td>$text{'index_checkdesc'}</td> </tr>\n";
+               print "</form>\n";
+               print "<form action=dump.cgi>\n";
+               print "<tr> <td><input type=submit ",
+                 "value='$text{'index_dump'}'></td>\n";
+               print "<td>$text{'index_dumpdesc'}</td> </tr>\n";
+               print "</form>\n";
                print "</table>\n";
                }
        }
index 4fc89c8..09f19a6 100644 (file)
@@ -15,6 +15,8 @@ index_stop=Stop Firewall
 index_stopdesc=Click this button to shut down Shorewall with the <tt>shorewall stop</tt> command. This will block access from all hosts except those in the When Stopped table.
 index_status=Show Status
 index_statusdesc=Click this button to view Shorewall's tables and rules from the <tt>shorewall status</tt> command.
+index_dump=Show Dump
+index_dumpdesc=Click this button to view Shorewall tracing information from the <tt>shorewall dump</tt> command.
 index_check=Check Firewall
 index_checkdesc=Click this button to have Shorewall validate your firewall configuration with the <tt>shorewall check</tt> command.
 
@@ -36,6 +38,7 @@ start_err=Failed to start firewall
 clear_err=Failed to clear firewall
 stop_err=Failed to shut down firewall
 status_title=Firewall Status
+dump_title=Firewall Dump
 check_title=Check Firewall
 check_ok=.. your firewall configuration looks OK.
 check_failed=.. an error was found in your firewall configuration!