All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Doucha <mdoucha@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/3] Fix shell library secureboot and lockdown helpers
Date: Fri, 22 Sep 2023 09:42:16 +0200	[thread overview]
Message-ID: <20230922074220.12913-3-mdoucha@suse.cz> (raw)
In-Reply-To: <20230922074220.12913-1-mdoucha@suse.cz>

Negative return value from the helper functions means no check could be
performend. Only positive return value indicates that secureboot/lockdown
is active.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/lib/tst_lockdown_enabled.c   | 2 +-
 testcases/lib/tst_secureboot_enabled.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/lib/tst_lockdown_enabled.c b/testcases/lib/tst_lockdown_enabled.c
index 0e40c428c..30abe3e5e 100644
--- a/testcases/lib/tst_lockdown_enabled.c
+++ b/testcases/lib/tst_lockdown_enabled.c
@@ -8,5 +8,5 @@
 
 int main(void)
 {
-	return !tst_lockdown_enabled();
+	return tst_lockdown_enabled() <= 0;
 }
diff --git a/testcases/lib/tst_secureboot_enabled.c b/testcases/lib/tst_secureboot_enabled.c
index 7c26fb118..dadc0413c 100644
--- a/testcases/lib/tst_secureboot_enabled.c
+++ b/testcases/lib/tst_secureboot_enabled.c
@@ -8,5 +8,5 @@
 
 int main(void)
 {
-	return !tst_secureboot_enabled();
+	return tst_secureboot_enabled() <= 0;
 }
-- 
2.42.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2023-09-22  7:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22  7:42 [LTP] [PATCH 1/3] Fix lockdown and secureboot check in init_module tests Martin Doucha
2023-09-22  7:42 ` [LTP] [PATCH 2/3] madvise11: Fix lockdown check Martin Doucha
2023-09-22  7:42 ` Martin Doucha [this message]
2023-09-22  8:57 ` [LTP] [PATCH 1/3] Fix lockdown and secureboot check in init_module tests Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230922074220.12913-3-mdoucha@suse.cz \
    --to=mdoucha@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.