stefanberger / swtpm

Libtpms-based TPM emulator with socket, character device, and Linux CUSE interface.
Other
576 stars 143 forks source link

swtpm not found when installed out of PATH #795

Closed BMBurstein closed 1 year ago

BMBurstein commented 1 year ago

If I configure, make and install with --prefix=<some dir not in the PATH>, swtpm_setup fails to find the swtpm executable. It is only looking in the $PATH. The only way is to pass the swtpm executable path to the --tpm switch.

I think that it should find swtpm in the configured install location (either instead of or in addition to the $PATH)

BMBurstein commented 1 year ago

It is worse. I can't even use --tpm for this. If I pass --tpm, it finds swtpm. But then it calls swtpm_localca using the configured prefix (this is good!). The problem is that swtpm_localca then looks for swtpm_cert only in the PATH, which again fails, and there is no way to even pass a corrected path

stefanberger commented 1 year ago

If you have a patch to fix it, let me know. Otherwise it's really not high priority at the moment.

stefanberger commented 1 year ago

There's a PR now: #796

BMBurstein commented 1 year ago

Thank you

stefanberger commented 1 year ago

Thank you

I suppose this means that it works for you.

BMBurstein commented 1 year ago

Thank you

I suppose this means that it works for you.

I didn't test it yet, but thank you for the effort either way

stefanberger commented 1 year ago

From what I can see I will have to revert the patch and users will have to set PATH since otherwise the test will pick up /usr/bin/swtpm_cert for example rather than the one in the path.