From ef9f85751b26995093cc9782fe48ddeacc8e2d3f Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Mon, 27 Aug 2012 04:43:23 -0400 Subject: SSH: Return error code in SSH utility functions --- src/sss_client/ssh/sss_ssh_authorizedkeys.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/sss_client') diff --git a/src/sss_client/ssh/sss_ssh_authorizedkeys.c b/src/sss_client/ssh/sss_ssh_authorizedkeys.c index dd9a0628..74b9693f 100644 --- a/src/sss_client/ssh/sss_ssh_authorizedkeys.c +++ b/src/sss_client/ssh/sss_ssh_authorizedkeys.c @@ -109,12 +109,13 @@ int main(int argc, const char **argv) /* print results */ for (i = 0; i < ent->num_pubkeys; i++) { - repr = sss_ssh_format_pubkey(mem_ctx, ent, &ent->pubkeys[i], - SSS_SSH_FORMAT_OPENSSH, NULL); - if (!repr) { - ERROR("Not enough memory\n"); - ret = EXIT_FAILURE; - goto fini; + ret = sss_ssh_format_pubkey(mem_ctx, ent, &ent->pubkeys[i], + SSS_SSH_FORMAT_OPENSSH, NULL, &repr); + if (ret != EOK) { + DEBUG(SSSDBG_OP_FAILURE, + ("sss_ssh_format_pubkey() failed (%d): %s\n", + ret, strerror(ret))); + continue; } printf("%s\n", repr); -- cgit