From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] tests: shell: don't rely on writable test directory
Date: Tue, 29 Oct 2024 08:14:01 +0100 [thread overview]
Message-ID: <20241029071401.GA16769@breakpoint.cc> (raw)
In-Reply-To: <ZyAeJ0lvifWevOuM@calendula>
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.
I can make that consistent if you prefer.
next prev parent reply other threads:[~2024-10-29 7:14 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 [this message]
2024-10-29 9:48 ` Pablo Neira Ayuso
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=20241029071401.GA16769@breakpoint.cc \
--to=fw@strlen.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox