(krb5_sendauth): only look at errno if krb5_net_read actually returns
-1 git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6829 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -90,6 +90,7 @@ krb5_sendauth(krb5_context context,
|
||||
krb5_creds this_cred;
|
||||
krb5_principal this_client = NULL;
|
||||
krb5_creds *creds;
|
||||
ssize_t sret;
|
||||
|
||||
len = strlen(version) + 1;
|
||||
net_len = htonl(len);
|
||||
@@ -103,11 +104,14 @@ krb5_sendauth(krb5_context context,
|
||||
|| krb5_net_write (context, p_fd, appl_version, len) != len)
|
||||
return errno;
|
||||
|
||||
if (krb5_net_read (context, p_fd, &repl, sizeof(repl)) != sizeof(repl))
|
||||
sret = krb5_net_read (context, p_fd, &repl, sizeof(repl));
|
||||
if (sret < 0)
|
||||
return errno;
|
||||
else if (sret != sizeof(repl))
|
||||
return KRB5_SENDAUTH_BADRESPONSE;
|
||||
|
||||
if (repl != 0)
|
||||
return KRB5_SENDAUTH_BADRESPONSE; /* XXX */
|
||||
return KRB5_SENDAUTH_REJECTED;
|
||||
|
||||
if (in_creds == NULL) {
|
||||
if (ccache == NULL) {
|
||||
|
Reference in New Issue
Block a user