Re: [PATCH] selinux: Chain up tool resolving errors in install_policy.sh

From: Paul Moore
Date: Fri Mar 07 2025 - 14:40:37 EST


On Mar 7, 2025 Tim Schumacher <tim.schumacher1@xxxxxxxxxx> 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@xxxxxxxxxx>
> ---
> scripts/selinux/install_policy.sh | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)

Nice catch, merged into selinux/dev, thanks!

--
paul-moore.com