Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swtpm not found when installed out of PATH #795

Closed
BMBurstein opened this issue Mar 21, 2023 · 7 comments
Closed

swtpm not found when installed out of PATH #795

BMBurstein opened this issue Mar 21, 2023 · 7 comments

Comments

@BMBurstein
Copy link

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
Copy link
Author

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
Copy link
Owner

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

stefanberger added a commit that referenced this issue Apr 3, 2023
To support install paths that are not covered by $PATH, and still allow
swtpm_setup and swtpm_localca to find swtpm and swtpm_cert executables,
implement find_program() to prepend the install path if only the program
name is given and otherwise fall back to g_find_program_in_path().

Resolves: #795
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
@stefanberger
Copy link
Owner

There's a PR now: #796

stefanberger added a commit that referenced this issue Apr 3, 2023
To support install paths that are not covered by $PATH, and still allow
swtpm_setup and swtpm_localca to find swtpm and swtpm_cert executables,
implement find_program() to prepend the install path if only the program
name is given and otherwise fall back to g_find_program_in_path().

Resolves: #795
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
stefanberger added a commit that referenced this issue Apr 5, 2023
To support install paths that are not covered by $PATH, and still allow
swtpm_setup and swtpm_localca to find swtpm and swtpm_cert executables,
implement find_program() to prepend the install path if only the program
name is given and otherwise fall back to g_find_program_in_path().

Update the man page stating that swtpm from the installation directory
(BINDIR) is tried to be used before one is attempted to be found in
the PATH.

Resolves: #795
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
@BMBurstein
Copy link
Author

Thank you

@stefanberger
Copy link
Owner

Thank you

I suppose this means that it works for you.

@BMBurstein
Copy link
Author

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants