Browse Source

firewall: bail out if uci is used in firewall include files

SVN-Revision: 30694
Jo-Philipp Wich 14 năm trước cách đây
mục cha
commit
fe2d387a8c
2 tập tin đã thay đổi với 8 bổ sung2 xóa
  1. 1 1
      package/firewall/Makefile
  2. 7 1
      package/firewall/files/lib/core_init.sh

+ 1 - 1
package/firewall/Makefile

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=firewall
 
 PKG_VERSION:=2
-PKG_RELEASE:=45
+PKG_RELEASE:=46
 
 include $(INCLUDE_DIR)/package.mk
 

+ 7 - 1
package/firewall/files/lib/core_init.sh

@@ -288,7 +288,13 @@ fw_load_include() {
 	local path
 	config_get path ${name} path
 
-	[ -e $path ] && ( . $path )
+	[ -e $path ] && (
+		config() {
+			fw_log error "You cannot use UCI in firewall includes!" >&2
+			exit 1
+		}
+		. $path 
+	)
 }