]> 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:31:57 +0000 (14:31 +0200)
commited68a544b931cc4b3ebf529b426cf4e66760354e
tree122065e62e4c3fbb366b0c614d0c90b79715a936
parent24045932e7e0892060e66e99814487faa087fc48
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