From 0a5109dc184d77c4cab09cbf8a2dfb90de9a9143 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Mon, 17 Jan 1994 22:57:58 +0000 Subject: [PATCH] Add error checking to krb5_sname_to_principal git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3361 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/kcmd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; -- 2.26.2