* Running nft --check as non-root
@ 2022-08-11 15:53 Peter Hoeg
2022-08-11 16:15 ` Florian Westphal
0 siblings, 1 reply; 3+ messages in thread
From: Peter Hoeg @ 2022-08-11 15:53 UTC (permalink / raw)
To: netfilter
Hey all,
as part of deploying nftables rules on NixOS, I want to check the syntax before actually trying to deploy them.
Now, nft --check --file works fine when run as root but the builder used does not have root permissions (or access to sudo or anything like that). Is there any particular reason why nft --check needs to run as root or any way to make it work as !root?
$ nft --check --file foo; echo $?
1
$ sudo nft --check --file foo; echo $?
0
Thanks in advance,
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Running nft --check as non-root
2022-08-11 15:53 Running nft --check as non-root Peter Hoeg
@ 2022-08-11 16:15 ` Florian Westphal
2022-08-12 5:15 ` Peter Hoeg
0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2022-08-11 16:15 UTC (permalink / raw)
To: Peter Hoeg; +Cc: netfilter
Peter Hoeg <peter@hoeg.com> wrote:
> as part of deploying nftables rules on NixOS, I want to check the syntax before actually trying to deploy them.
>
> Now, nft --check --file works fine when run as root but the builder used does not have root permissions (or access to sudo or anything like that). Is there any particular reason why nft --check needs to run as root or any way to make it work as !root?
Yes, this not a syntax check. The ruleset is passed to the kernel.
The only difference is the lack of the final 'commit' instruction to
activate the ruleset, this makes the kernel abort/unwind the entire
transaction.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-12 5:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-11 15:53 Running nft --check as non-root Peter Hoeg
2022-08-11 16:15 ` Florian Westphal
2022-08-12 5:15 ` Peter Hoeg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox