]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:11 +0000 (14:39 +0200)
commit96b4f2e97408198d6ce7de52f245dc6cb59662f2
treedde2e17846436fa5ae13cbf27394690b75747b3f
parent864750968d71c2a2659515e51d8800762931a29b
selinux: Chain up tool resolving errors in install_policy.sh

[ Upstream commit 6ae0042f4d3f331e841495eb0a3d51598e593ec2 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/selinux/install_policy.sh