All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Shyam Saini <mayhs11saini@gmail.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	Netfilter Development Mailing list
	<netfilter-devel@vger.kernel.org>,
	anthonyryan1@gmail.com
Subject: Re: [PATCH nft] parser_bison: restore nft {import,export} ruleset
Date: Thu, 15 Feb 2018 11:51:45 +0100	[thread overview]
Message-ID: <20180215105145.GN4242@orbyte.nwl.cc> (raw)
In-Reply-To: <CAOfkYf5dGcKkW4ErvHS0F_px8V96OLp-NAKv7KSJ2jPysyNA1A@mail.gmail.com>

Hi Shyam,

On Thu, Feb 15, 2018 at 01:25:04AM +0530, Shyam Saini wrote:
> > On Wed, Feb 14, 2018 at 08:16:52PM +0100, Pablo Neira Ayuso wrote:
> >> On Thu, Feb 15, 2018 at 12:34:31AM +0530, Shyam Saini wrote:
> >> > Hi Pablo,
> >> >
> >> > On Thu, Feb 15, 2018 at 12:02 AM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> >> > > Restore original syntax for the yet experimental VM low-level json
> >> > > representation.
> >> > >
> >> > > Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1224
> >> > > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> >> > > ---
> >> > > I asked for this change to make room for the high-level json
> >> > > representation, but we can use -j options for this instead.  Given there
> >> > > are more users for the json representation that I expected, I'm fixing
> >> > > it myself by restoring the former behaviour.
> >> >
> >> > Why would one use "nft export"  without "nft import".
> >> > if someone exports rules in json then they can't use those rules
> >> > given the fact that "nft import" was not available earlier.
> >> >
> >> > Am i missing something?
> >>
> >> With this patch nft import and nft export works as expected, ie.
> >>
> >>         nft export ruleset json > file.json
> >>         nft import ruleset json < file.json
> >>
> >> I'm just restoring 'nft export ruleset json' with this patch, it seems
> >> there are more users of this than I expected, so let's restore this
> >> before 0.8.3 is released, that's my proposal.
> >
> > Oh, probably you got confused because the patch title refers to nft
> > import when it should only refer to nft export ruleset json?
> 
> No, I mean in some previous mail Phil mentioned that it could break user's
> script.
>  I was thinking why one would use "nft export json" alone.
> Earlier we didn't have nft import command.
> 
> So lets say if some user do "nft export json >file.json" then the
> rules in file.json
> are of no use without "nft import json" because we had no way to
> import or use them again.
> 
> Sorry, I missed previous mail and couldn't follow up.

My point was that 'nft export json' might be in use for other things
than restoring nftables rule set later on, e.g. to verify current system
state against a known one. The problem I saw was not so much that 'nft
export json' stopped working but that it returned 0 and hence did not
allow for such scripts to detect a failure in execution. So this might
lead to red lights turning on because a system may seem like it lost all
previously installed nftables rules.

Yes, this case is pretty much constructed, but if something's possible,
there's always at least one guy on the internet doing it. :)

Cheers, Phil

      reply	other threads:[~2018-02-15 10:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 18:32 [PATCH nft] parser_bison: restore nft {import,export} ruleset Pablo Neira Ayuso
2018-02-14 19:04 ` Shyam Saini
2018-02-14 19:16   ` Pablo Neira Ayuso
2018-02-14 19:27     ` Pablo Neira Ayuso
2018-02-14 19:55       ` Shyam Saini
2018-02-15 10:51         ` Phil Sutter [this message]

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=20180215105145.GN4242@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=anthonyryan1@gmail.com \
    --cc=mayhs11saini@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.