aboutsummaryrefslogtreecommitdiffstats
path: root/config/quagga_ospfd
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-07-02 19:30:12 -0400
committerjim-p <jimp@pfsense.org>2012-07-02 19:30:12 -0400
commit46416258bf85d6adac5b31da9af01f43eb3ca35d (patch)
tree0a93c138eb1e574ca91db28f34a49bfb2fd2fb8d /config/quagga_ospfd
parent8004b79d329f26574c10e20251db436917d33614 (diff)
downloadpfsense-packages-46416258bf85d6adac5b31da9af01f43eb3ca35d.tar.gz
pfsense-packages-46416258bf85d6adac5b31da9af01f43eb3ca35d.tar.bz2
pfsense-packages-46416258bf85d6adac5b31da9af01f43eb3ca35d.zip
Reject a password containing a single quote (it does weird things in the pkg code), also do not try to query the zebra or ospfd daemon if they are not running.
Diffstat (limited to 'config/quagga_ospfd')
-rw-r--r--config/quagga_ospfd/quagga_ospfd.inc2
-rw-r--r--config/quagga_ospfd/quaggactl10
2 files changed, 11 insertions, 1 deletions
diff --git a/config/quagga_ospfd/quagga_ospfd.inc b/config/quagga_ospfd/quagga_ospfd.inc
index 71dfc886..b5a63bd0 100644
--- a/config/quagga_ospfd/quagga_ospfd.inc
+++ b/config/quagga_ospfd/quagga_ospfd.inc
@@ -299,6 +299,8 @@ function quagga_ospfd_validate_interface() {
function quagga_ospfd_validate_input() {
global $config, $g, $input_errors;
+ if ($_POST['password'] <> "" && (strpos($_POST['password'], "'") !== false))
+ $input_errors[] = "Password cannot contain a single quote (')";
if (!empty($_POST['routerid']) && !is_ipaddr($_POST['routerid']))
$input_errors[] = "Router ID must be an address.";
if (!is_ipaddr($_POST['area']))
diff --git a/config/quagga_ospfd/quaggactl b/config/quagga_ospfd/quaggactl
index f370b425..6db7232e 100644
--- a/config/quagga_ospfd/quaggactl
+++ b/config/quagga_ospfd/quaggactl
@@ -28,6 +28,10 @@ restart)
$RC_SCRIPT restart
;;
zebra)
+ if [ "`pgrep zebra`" = "" ]; then
+ echo "zebra does not appear to be running"
+ exit 1
+ fi
case $2 in
cpu*)
daemon_command ${ZEBRA_PORT} ${ZEBRA_PASSWORD} "show thread cpu"
@@ -43,7 +47,11 @@ zebra)
daemon_command ${ZEBRA_PORT} ${ZEBRA_PASSWORD} "show ip route"
;;
esac ;;
-ospf)
+ospf*)
+ if [ "`pgrep ospfd`" = "" ]; then
+ echo "ospfd does not appear to be running"
+ exit 1
+ fi
case $2 in
cpu*)
daemon_command ${OSPF_PORT} ${OSPF_PASSWORD} "show thread cpu"