mirror of
https://git.openwrt.org/project/luci.git
synced 2025-12-20 08:49:59 +08:00
luci-mod-status: Fix legacy rule detection false positive
Some checks failed
LuCI repo CodeQL Analysis / Analyze JavaScript and JSON (javascript-typescript) (push) Has been cancelled
Some checks failed
LuCI repo CodeQL Analysis / Analyze JavaScript and JSON (javascript-typescript) (push) Has been cancelled
Refine legacy rule detection to avoid false positives generated by the iptables-nft compatibility layer on fw4 systems. The logic now prioritizes `iptables-legacy-save` for accuracy, while retaining `iptables-save` as a fallback to ensure backward compatibility with fw3. Signed-off-by: Tokisaki-Galaxy <starmaster@outlook.sg>
This commit is contained in:
committed by
Paul Donald
parent
805b2db670
commit
63d55a7ec1
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
LUCI_TITLE:=LuCI Status Pages
|
||||
LUCI_DEPENDS:=+luci-base +libiwinfo +rpcd-mod-iwinfo
|
||||
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
PKG_BUILD_DEPENDS:=iwinfo
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
|
||||
@@ -146,8 +146,16 @@ return view.extend({
|
||||
load: function() {
|
||||
return Promise.all([
|
||||
L.resolveDefault(fs.exec_direct('/usr/sbin/nft', [ '--terse', '--json', 'list', 'ruleset' ], 'json'), {}),
|
||||
L.resolveDefault(fs.exec_direct('/usr/sbin/iptables-save'), ''),
|
||||
L.resolveDefault(fs.exec_direct('/usr/sbin/ip6tables-save'), '')
|
||||
fs.stat('/usr/sbin/iptables-legacy-save').then(function(stat) {
|
||||
return L.resolveDefault(fs.exec_direct('/usr/sbin/iptables-legacy-save'), '');
|
||||
}).catch(function(err) {
|
||||
return L.resolveDefault(fs.exec_direct('/usr/sbin/iptables-save'), '');
|
||||
}),
|
||||
fs.stat('/usr/sbin/ip6tables-legacy-save').then(function(stat) {
|
||||
return L.resolveDefault(fs.exec_direct('/usr/sbin/ip6tables-legacy-save'), '');
|
||||
}).catch(function(err) {
|
||||
return L.resolveDefault(fs.exec_direct('/usr/sbin/ip6tables-save'), '');
|
||||
})
|
||||
]);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user