[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aa05b93c973149a86385a6cb7f7c1138@paul-moore.com>
Date: Fri, 07 Mar 2025 14:38:33 -0500
From: Paul Moore <paul@...l-moore.com>
To: Tim Schumacher <tim.schumacher1@...wei.com>, Stephen Smalley <stephen.smalley.work@...il.com>, Ondrej Mosnacek <omosnace@...hat.com>, Dominick Grift <dominick.grift@...ensec.nl>
Cc: Tim Schumacher <tim.schumacher1@...wei.com>, Stephen Smalley <sds@...ho.nsa.gov>, <selinux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] selinux: Chain up tool resolving errors in install_policy.sh
On Mar 7, 2025 Tim Schumacher <tim.schumacher1@...wei.com> wrote:
>
> Subshell evaluations are not exempt from errexit, so if a command is
> not available, `which` will fail and exit the script as a whole.
> This causes the helpful error messages to not be printed if they are
> tacked on using a `$?` comparison.
>
> Resolve the issue by using chains of logical operators, which are not
> subject to the effects of errexit.
>
> Fixes: e37c1877ba5b1 ("scripts/selinux: modernize mdp")
> Signed-off-by: Tim Schumacher <tim.schumacher1@...wei.com>
> ---
> scripts/selinux/install_policy.sh | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
Nice catch, merged into selinux/dev, thanks!
--
paul-moore.com
Powered by blists - more mailing lists