Blame options-fix-broken-T-option-when-passing-additional-.patch

Javier Martinez Canillas fcd447
From 2565cf6c5cc7a0af7f426b7c9b03ac2f7c76005a Mon Sep 17 00:00:00 2001
Javier Martinez Canillas fcd447
From: Javier Martinez Canillas <javierm@redhat.com>
Javier Martinez Canillas fcd447
Date: Mon, 7 Jan 2019 11:31:50 +0100
Javier Martinez Canillas fcd447
Subject: [PATCH] options: fix broken -T option when passing additional
Javier Martinez Canillas fcd447
 arguments
Javier Martinez Canillas fcd447
Javier Martinez Canillas fcd447
The commit 175e47711c7 ("lib/tpm2_options: restore TCTI configuration
Javier Martinez Canillas fcd447
environment variables") restored how the TCTI configuration was setup
Javier Martinez Canillas fcd447
for the 3.X releases, but this broke the -T,--tcti option since was
Javier Martinez Canillas fcd447
ignored.
Javier Martinez Canillas fcd447
Javier Martinez Canillas fcd447
Commit 554a13f45c0 ("options: fix broken -T option") partially fixed
Javier Martinez Canillas fcd447
this, but only when additional TCTI arguments were not used.
Javier Martinez Canillas fcd447
Javier Martinez Canillas fcd447
For example when specifying the -T device:/dev/tpmrm0 TCTI option:
Javier Martinez Canillas fcd447
Javier Martinez Canillas fcd447
$ tpm2_pcrlist -T device:/dev/tpmrm0
Javier Martinez Canillas fcd447
...
Javier Martinez Canillas fcd447
ERROR: Could not dlopen library: "device:/dev/tpmrm0"
Javier Martinez Canillas fcd447
ERROR: Could not load tcti, got: "device:/dev/tpmrm0"
Javier Martinez Canillas fcd447
Javier Martinez Canillas fcd447
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Javier Martinez Canillas fcd447
---
Javier Martinez Canillas fcd447
 lib/tpm2_options.c | 2 +-
Javier Martinez Canillas fcd447
 1 file changed, 1 insertion(+), 1 deletion(-)
Javier Martinez Canillas fcd447
Javier Martinez Canillas fcd447
diff --git a/lib/tpm2_options.c b/lib/tpm2_options.c
Javier Martinez Canillas fcd447
index 006c46e4944..1d1093aa74d 100644
Javier Martinez Canillas fcd447
--- a/lib/tpm2_options.c
Javier Martinez Canillas fcd447
+++ b/lib/tpm2_options.c
Javier Martinez Canillas fcd447
@@ -291,7 +291,7 @@ static tcti_conf tcti_get_config(const char *optstr) {
Javier Martinez Canillas fcd447
             }
Javier Martinez Canillas fcd447
         }
Javier Martinez Canillas fcd447
     } else {
Javier Martinez Canillas fcd447
-        conf.name = strdup(optstr);
Javier Martinez Canillas fcd447
+        parse_env_tcti(optstr, &conf;;
Javier Martinez Canillas fcd447
     }
Javier Martinez Canillas fcd447
 
Javier Martinez Canillas fcd447
     if (!conf.name) {
Javier Martinez Canillas fcd447
-- 
Javier Martinez Canillas fcd447
2.19.2
Javier Martinez Canillas fcd447