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/responder/ssh/sshsrv_cmd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/responder/ssh') diff --git a/src/responder/ssh/sshsrv_cmd.c b/src/responder/ssh/sshsrv_cmd.c index 3c67fd4e9..a689515a8 100644 --- a/src/responder/ssh/sshsrv_cmd.c +++ b/src/responder/ssh/sshsrv_cmd.c @@ -420,6 +420,7 @@ ssh_host_pubkeys_format_known_host_plain(TALLOC_CTX *mem_ctx, struct sss_ssh_ent *ent) { TALLOC_CTX *tmp_ctx; + errno_t ret; char *name, *pubkey; char *result = NULL; size_t i; @@ -447,9 +448,9 @@ ssh_host_pubkeys_format_known_host_plain(TALLOC_CTX *mem_ctx, } for (i = 0; i < ent->num_pubkeys; i++) { - pubkey = sss_ssh_format_pubkey(tmp_ctx, ent, &ent->pubkeys[i], - SSS_SSH_FORMAT_OPENSSH, ""); - if (!pubkey) { + ret = sss_ssh_format_pubkey(tmp_ctx, ent, &ent->pubkeys[i], + SSS_SSH_FORMAT_OPENSSH, "", &pubkey); + if (ret != EOK) { result = NULL; goto done; } @@ -491,9 +492,9 @@ ssh_host_pubkeys_format_known_host_hashed(TALLOC_CTX *mem_ctx, } for (i = 0; i < ent->num_pubkeys; i++) { - pubkey = sss_ssh_format_pubkey(tmp_ctx, ent, &ent->pubkeys[i], - SSS_SSH_FORMAT_OPENSSH, ""); - if (!pubkey) { + ret = sss_ssh_format_pubkey(tmp_ctx, ent, &ent->pubkeys[i], + SSS_SSH_FORMAT_OPENSSH, "", &pubkey); + if (ret != EOK) { result = NULL; goto done; } -- cgit