fw4: fix cosmetic issue with per-ruleset and per-table include paths
authorJo-Philipp Wich <jo@mein.io>
Thu, 1 Sep 2022 09:33:48 +0000 (11:33 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 1 Sep 2022 09:33:48 +0000 (11:33 +0200)
Avoid adding a double slash to the file path, even though it is harmless.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/ucode/fw4.uc

index dcb13ad6cb00135529605e79388e1bf9fc48ee1c..766290ef5727c2489abd1f9f69a4fe36769c253f 100644 (file)
@@ -740,7 +740,7 @@ return {
                if (this.default_option("auto_includes")) {
                        for (let position in [ 'ruleset-pre', 'ruleset-post', 'table-pre', 'table-post', 'chain-pre', 'chain-post' ])
                                for (let chain in (position in [ 'chain-pre', 'chain-post' ]) ? fs.lsdir(`/usr/share/nftables.d/${position}`) : [ null ])
-                                       for (let path in fs.glob(`/usr/share/nftables.d/${position}/${chain ?? ''}/*.nft`))
+                                       for (let path in fs.glob(`/usr/share/nftables.d/${position}${chain ? `/${chain}` : ''}/*.nft`))
                                                if (fs.access(path))
                                                        this.parse_include({ type: 'nftables', position, chain, path });
                }