From: Theodore Tso Date: Mon, 17 Jan 1994 22:57:58 +0000 (+0000) Subject: Add error checking to krb5_sname_to_principal X-Git-Tag: krb5-1.0-beta3~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0a5109dc184d77c4cab09cbf8a2dfb90de9a9143;p=krb5.git Add error checking to krb5_sname_to_principal git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3361 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/kcmd.c b/src/appl/bsd/kcmd.c index 542a35857..807009a6c 100644 --- a/src/appl/bsd/kcmd.c +++ b/src/appl/bsd/kcmd.c @@ -139,8 +139,14 @@ kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, service, realm, fprintf(stderr,"kcmd: no memory\n"); return(-1); } - krb5_sname_to_principal(host_save,service,KRB5_NT_SRV_HST, - &ret_cred->server); + status = krb5_sname_to_principal(host_save,service,KRB5_NT_SRV_HST, + &ret_cred->server); + if (status) { + fprintf(stderr, "kcmd: krb5_sname_to_principal failed: %s\n", + error_message(status)); + return(-1); + } + if (realm && *realm) { char *copyrealm; krb5_data rdata;