From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Anatole Denis <anatole@rezel.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] erec: Fix input descriptors for included files
Date: Sat, 25 Feb 2017 13:51:11 +0100 [thread overview]
Message-ID: <20170225125111.GA11143@salvia> (raw)
In-Reply-To: <20170221144805.22472-1-anatole@rezel.net>
On Tue, Feb 21, 2017 at 03:48:05PM +0100, Anatole Denis wrote:
> Currently, when creating an error record (erec), the current location in the
> file is duplicated, but not the input_descriptor inside it. Input descriptors
> are added and removed by the parser when including files, and memory references
> in the error record thus become incorrect when a subsequent file is included.
>
> This patch copies the input descriptors recursively to ensure each erec has the
> correct chain of input descriptors at the time of printing.
>
> For example:
> badinclude.nft:
> ```
> include "error.nft"
> include "empty.nft"
> ```
> a.nft:
> ```
> add rule t c obvious syntax error
> ```
> b.nft: (empty file)
>
> Results in the last included file being referenced and quoted for all errors
> $ nft -f badinclude.nft
> In file included from badinclude.nft:2:1-20:
> ./empty.nft:1:34-34: Error: syntax error, unexpected newline
>
> ^
>
> Expected behavior:
> $ nft -f badinclude.nft -I.
> In file included from badinclude.nft:1:1-20:
> ./error.nft:1:34-34: Error: syntax error, unexpected newline
> add rule t c obvious syntax error
> ^
Applied, thanks Anatole.
prev parent reply other threads:[~2017-02-25 13:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 14:48 [PATCH nft] erec: Fix input descriptors for included files Anatole Denis
2017-02-25 12:51 ` Pablo Neira Ayuso [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=20170225125111.GA11143@salvia \
--to=pablo@netfilter.org \
--cc=anatole@rezel.net \
--cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).