Description of problem: Configuration scripts provided as /etc/nftables/*.nft are now equipped with shebang and could be executed directly, if they had 0700 mode. Current mode is 0600 which was requested by previous bug 1685238 to strip Group and Other privileges. eXecute bit is continuously lacking. Version-Release number of selected component (if applicable): nftables-0.9.0-14.el8.x86_64 How reproducible: always Steps to Reproduce: /etc/nftables/netdev-ingress.nft bash: /etc/nftables/netdev-ingress.nft: Permission denied Expected results: /etc/nftables/*.nft have 0700 mode Additional info: official documentation refers to the configuration files as to scripts, which also IMO implies that they should be directly executable
Hi Tomas, Upstream doesn't set executable bit on them either. Do you think there's an actual benefit to users by doing that? IMO, these are really just config files for nftables.service. Cheers, Phil
Hello Phil, I wanted to bring this up for a review. (In reply to Phil Sutter from comment #1) > Upstream doesn't set executable bit on them either. Do you think there's an > actual benefit to users by doing that? IMO, these are really just config > files for nftables.service. I think the benefit is quite low when looking back. The shebang in the script does not imply it must be executable. Also it is currently aligned with documentation which suggests adding executable bit manually if needed [1]. On a different note related to this issue the nft documentation should be changed unless the shebang line is not required. from man:nft(8) in nftables-0.9.2-4.el8.x86_64: >nft scripts must start #!/usr/sbin/nft -f [1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/getting-started-with-nftables_configuring-and-managing-networking#running-nftables-scripts_writing-and-executing-nftables-scripts Tomas
(In reply to Tomas Dolezal from comment #2) > On a different note related to this issue the nft documentation should be > changed unless the shebang line is not required. > from man:nft(8) in nftables-0.9.2-4.el8.x86_64: > >nft scripts must start #!/usr/sbin/nft -f correction: unless the line is really required. now it is possible to `nft -f script.nft` without the above as first line.
Fix sent upstream: https://lore.kernel.org/netfilter-devel/20191105131439.31826-1-phil@nwl.cc/ This removes the incorrect statement from nft.8.
Manpage change implicitly backported by rebase to 0.9.3.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2020:1774