mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-01-10 23:43:44 +00:00
swtpm_setup: Use 1st part of SWTPM_EXE/SWTPM_IOCTL to determine executable
Search for the SWTPM_EXE / SWTPM_IOCTL executable using 'type -P' to determine whether it is an executable rather than assuming a full path is given on which we can check -x. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
996ad55fbc
commit
84f350dace
@ -2102,7 +2102,7 @@ main()
|
||||
local flags=0
|
||||
local tpm_state_path=""
|
||||
local config_file="$DEFAULT_CONFIG_FILE"
|
||||
local vmid=""
|
||||
local vmid="" tmp
|
||||
local ret
|
||||
local keyfile pwdfile cipher="aes-128-cbc"
|
||||
local keyfile_fd pwdfile_fd
|
||||
@ -2251,7 +2251,8 @@ main()
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -x "$(echo $SWTPM | cut -d " " -f1)" ]; then
|
||||
tmp="$(echo $SWTPM | cut -d" " -f1)"
|
||||
if [ ! -x "$(type -P $tmp)" ]; then
|
||||
logerr "TPM at $SWTPM is not an executable."
|
||||
exit 1
|
||||
fi
|
||||
@ -2273,7 +2274,8 @@ main()
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -x "$(echo $SWTPM_IOCTL | cut -d " " -f1)" ]; then
|
||||
tmp="$(echo $SWTPM_IOCTL | cut -d" " -f1)"
|
||||
if [ ! -x "$(type -P $tmp)" ]; then
|
||||
logerr "swtpm_ioctl at $SWTPM_IOCTL is not an executable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user