]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selinux: Chain up tool resolving errors in install_policy.sh
authorTim Schumacher <tim.schumacher1@huawei.com>
Fri, 7 Mar 2025 09:56:43 +0000 (10:56 +0100)
committerPaul Moore <paul@paul-moore.com>
Fri, 7 Mar 2025 19:38:34 +0000 (14:38 -0500)
commit6ae0042f4d3f331e841495eb0a3d51598e593ec2
treecdd38335c3cbf968f98b64087c5beb166c2a6d81
parent2c2b1e059792f610bae4fee8ed517b8ce9c585fb
selinux: Chain up tool resolving errors in install_policy.sh

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@huawei.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
scripts/selinux/install_policy.sh