swtpm_setup: Avoid calling getpwnam() if change_user == false

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2019-07-05 16:50:16 +00:00 committed by Stefan Berger
parent 51f3860dfe
commit a794d0fe48

View File

@ -218,7 +218,7 @@ int main(int argc, char *argv[])
* In case of TPM 1.2 we allow running this program as 'tss'
* (E_USER_ID).
*/
if (!use_tpm2) {
if (!use_tpm2 && change_user) {
passwd = getpwnam(E_USER_ID);
if (!passwd) {
fprintf(stderr, "Could not get account data of user %s.\n", E_USER_ID);