ssh token: Fix return code when adding multiple tokens

token_add returns ID of the added token so we can't use it as a
return code for the binary.
This commit is contained in:
Vojtech Trefny
2021-06-22 16:01:19 +02:00
parent 35793c24f0
commit 3dc7dff2b2

View File

@@ -396,12 +396,16 @@ int main(int argc, char *argv[])
} }
} }
return token_add(arguments.device, ret = token_add(arguments.device,
arguments.ssh_server, arguments.ssh_server,
arguments.ssh_user, arguments.ssh_user,
arguments.ssh_path, arguments.ssh_path,
arguments.ssh_keypath, arguments.ssh_keypath,
arguments.keyslot); arguments.keyslot);
if (ret < 0)
return EXIT_FAILURE;
else
return EXIT_SUCCESS;
} else { } else {
printf("Only 'add' action is currently supported by this plugin.\n"); printf("Only 'add' action is currently supported by this plugin.\n");
return EXIT_FAILURE; return EXIT_FAILURE;