handle return value of krb5_storage_{read,write}
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24011 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -440,9 +440,12 @@ kcm_op_get_first(krb5_context context,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
for (creds = ccache->creds ; creds ; creds = creds->next) {
|
for (creds = ccache->creds ; creds ; creds = creds->next) {
|
||||||
ret = krb5_storage_write(response, &creds->uuid, sizeof(creds->uuid));
|
ssize_t sret;
|
||||||
if (ret)
|
sret = krb5_storage_write(response, &creds->uuid, sizeof(creds->uuid));
|
||||||
|
if (sret != sizeof(creds->uuid)) {
|
||||||
|
ret = ENOMEM;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kcm_release_ccache(context, &ccache);
|
kcm_release_ccache(context, &ccache);
|
||||||
@@ -470,6 +473,7 @@ kcm_op_get_next(krb5_context context,
|
|||||||
char *name;
|
char *name;
|
||||||
struct kcm_creds *c;
|
struct kcm_creds *c;
|
||||||
uuid_t uuid;
|
uuid_t uuid;
|
||||||
|
ssize_t sret;
|
||||||
|
|
||||||
ret = krb5_ret_stringz(request, &name);
|
ret = krb5_ret_stringz(request, &name);
|
||||||
if (ret)
|
if (ret)
|
||||||
@@ -483,9 +487,12 @@ kcm_op_get_next(krb5_context context,
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = krb5_storage_read(request, &uuid, sizeof(uuid));
|
sret = krb5_storage_read(request, &uuid, sizeof(uuid));
|
||||||
if (ret)
|
if (sret != sizeof(uuid)) {
|
||||||
return ret;
|
kcm_release_ccache(context, &ccache);
|
||||||
|
krb5_clear_error_message(context);
|
||||||
|
return KRB5_CC_IO;
|
||||||
|
}
|
||||||
|
|
||||||
c = kcm_ccache_find_cred_uuid(context, ccache, uuid);
|
c = kcm_ccache_find_cred_uuid(context, ccache, uuid);
|
||||||
if (c == NULL) {
|
if (c == NULL) {
|
||||||
|
Reference in New Issue
Block a user