Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Peter Hoeg <peter@hoeg.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Running nft --check as non-root
Date: Thu, 11 Aug 2022 18:15:00 +0200	[thread overview]
Message-ID: <20220811161500.GF8667@breakpoint.cc> (raw)
In-Reply-To: <874jyiu661.fsf@hoeg.com>

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.

  reply	other threads:[~2022-08-11 16:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 15:53 Running nft --check as non-root Peter Hoeg
2022-08-11 16:15 ` Florian Westphal [this message]
2022-08-12  5:15   ` Peter Hoeg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220811161500.GF8667@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter@vger.kernel.org \
    --cc=peter@hoeg.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox