[package] firewall: properly clear hooks in fw_stop() to prevent extensions from...
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 17 May 2010 17:20:37 +0000 (17:20 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 17 May 2010 17:20:37 +0000 (17:20 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21488 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/firewall/files/lib/core.sh

index bf44231..f37b1e6 100644 (file)
@@ -66,6 +66,11 @@ fw_stop() {
 
        uci_revert_state firewall
        config_clear
+
+       local h
+       for h in $FW_HOOKS; do unset $h; done
+
+       unset FW_HOOKS
        unset FW_INITIALIZED
 }
 
@@ -126,8 +131,10 @@ fw_init() {
                . $file
                for hk in $hooks; do
                        for pp in pre post; do
-                               type ${lib}_${pp}_${hk}_cb >/dev/null &&
+                               type ${lib}_${pp}_${hk}_cb >/dev/null && {
                                        append FW_CB_${pp}_${hk} ${lib}
+                                       append FW_HOOKS FW_CB_${pp}_${hk}
+                               }
                        done
                done
        done
This page took 0.023759 seconds and 4 git commands to generate.