From 88cbcc0ea3ed13b6c9d5b26cb977bf46f82ba660 Mon Sep 17 00:00:00 2001 From: Juergen Repp Date: Sat, 10 Feb 2024 10:02:31 +0100 Subject: [PATCH] tpm2_util.c: fix check of environment variable. The function tpm2_util_env_yes did check the name of the variable instead of the value. Fixes: #3353 Signed-off-by: Juergen Repp --- lib/tpm2_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tpm2_util.c b/lib/tpm2_util.c index 53865b31d..c489430d1 100644 --- a/lib/tpm2_util.c +++ b/lib/tpm2_util.c @@ -635,9 +635,9 @@ char *tpm2_util_getenv(const char *name) { bool tpm2_util_env_yes(const char *name) { char *value = getenv(name); - return (value && (strcasecmp(name, "yes") == 0 || - strcasecmp(name, "1") == 0 || - strcasecmp(name, "true") == 0)); + return (value && (strcasecmp(value, "yes") == 0 || + strcasecmp(value, "1") == 0 || + strcasecmp(value, "true") == 0)); } /**