From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] tests: shell: don't rely on writable test directory
Date: Tue, 29 Oct 2024 10:48:40 +0100 [thread overview]
Message-ID: <ZyCveExccCSaK4sA@calendula> (raw)
In-Reply-To: <20241029071401.GA16769@breakpoint.cc>
On Tue, Oct 29, 2024 at 08:14:01AM +0100, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Tue, Oct 22, 2024 at 04:09:54PM +0200, Florian Westphal wrote:
> > > tmpfile1=$(mktemp -p .)
> > > -if [ ! -w $tmpfile1 ] ; then
> > > +if [ ! -w "$tmpfile1" ] ; then
> > > echo "Failed to create tmp file" >&2
> > > - exit 0
> > > + exit 77
> > > fi
> > >
> > > +trap "rm -rf $tmpfile1 $tmpfile2" EXIT # cleanup if aborted
> > > +set -e
> > > +
> > > tmpfile2=$(mktemp -p .)
> > > -if [ ! -w $tmpfile2 ] ; then
> > > +if [ ! -w "$tmpfile2" ] ; then
> > > echo "Failed to create tmp file" >&2
> > > exit 0
> >
> > this does not return 77, see below...
>
> I only changed first invocation, if pwd is ro, that will
> have failed already.
Right.
> I can make that consistent if you prefer.
Sure, go ahead and push this out if it helps you with virtme-ng
Thanks!
prev parent reply other threads:[~2024-10-29 9:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 14:09 [PATCH nft] tests: shell: don't rely on writable test directory Florian Westphal
2024-10-28 23:28 ` Pablo Neira Ayuso
2024-10-29 7:14 ` Florian Westphal
2024-10-29 9:48 ` 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=ZyCveExccCSaK4sA@calendula \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--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 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.