@@ -0,0 +1,39 @@
1+diff --git a/src/tss2-tcti/tctildr-dl.c b/src/tss2-tcti/tctildr-dl.c
2+index b364695c..b13be3ef 100644
3+--- a/src/tss2-tcti/tctildr-dl.c
4++++ b/src/tss2-tcti/tctildr-dl.c
5+@@ -85,7 +85,15 @@ handle_from_name(const char *file,
6+ if (handle == NULL) {
7+ return TSS2_TCTI_RC_BAD_REFERENCE;
8+ }
9+- *handle = dlopen(file, RTLD_NOW);
10++ size = snprintf(file_xfrm,
11++ sizeof (file_xfrm),
12++ "@PREFIX@%s",
13++ file);
14++ if (size >= sizeof (file_xfrm)) {
15++ LOG_ERROR("TCTI name truncated in transform.");
16++ return TSS2_TCTI_RC_BAD_VALUE;
17++ }
18++ *handle = dlopen(file_xfrm, RTLD_NOW);
19+ if (*handle != NULL) {
20+ return TSS2_RC_SUCCESS;
21+ } else {
22+@@ -94,7 +102,7 @@ handle_from_name(const char *file,
23+ /* 'name' alone didn't work, try libtss2-tcti-<name>.so.0 */
24+ size = snprintf(file_xfrm,
25+ sizeof (file_xfrm),
26+- TCTI_NAME_TEMPLATE_0,
27++ "@PREFIX@" TCTI_NAME_TEMPLATE_0,
28+ file);
29+ if (size >= sizeof (file_xfrm)) {
30+ LOG_ERROR("TCTI name truncated in transform.");
31+@@ -109,7 +117,7 @@ handle_from_name(const char *file,
32+ /* libtss2-tcti-<name>.so.0 didn't work, try libtss2-tcti-<name>.so */
33+ size = snprintf(file_xfrm,
34+ sizeof (file_xfrm),
35+- TCTI_NAME_TEMPLATE,
36++ "@PREFIX@" TCTI_NAME_TEMPLATE,
37+ file);
38+ if (size >= sizeof (file_xfrm)) {
39+ LOG_ERROR("TCTI name truncated in transform.");