switch to krb5_clear_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23912 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -53,7 +53,7 @@ kadm5_c_chpass_principal(void *server_handle,
|
||||
|
||||
sp = krb5_storage_from_mem(buf, sizeof(buf));
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_store_int32(sp, kadm_chpass);
|
||||
@@ -66,12 +66,12 @@ kadm5_c_chpass_principal(void *server_handle,
|
||||
return ret;
|
||||
sp = krb5_storage_from_data (&reply);
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_data_free (&reply);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_ret_int32(sp, &tmp);
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_storage_free(sp);
|
||||
krb5_data_free (&reply);
|
||||
return tmp;
|
||||
@@ -97,7 +97,7 @@ kadm5_c_chpass_principal_with_key(void *server_handle,
|
||||
|
||||
sp = krb5_storage_from_mem(buf, sizeof(buf));
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_store_int32(sp, kadm_chpass_with_key);
|
||||
@@ -112,12 +112,12 @@ kadm5_c_chpass_principal_with_key(void *server_handle,
|
||||
return ret;
|
||||
sp = krb5_storage_from_data (&reply);
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_data_free (&reply);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_ret_int32(sp, &tmp);
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_storage_free(sp);
|
||||
krb5_data_free (&reply);
|
||||
return tmp;
|
||||
|
@@ -54,7 +54,7 @@ kadm5_c_create_principal(void *server_handle,
|
||||
|
||||
sp = krb5_storage_from_mem(buf, sizeof(buf));
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_store_int32(sp, kadm_create);
|
||||
@@ -68,12 +68,12 @@ kadm5_c_create_principal(void *server_handle,
|
||||
return ret;
|
||||
sp = krb5_storage_from_data (&reply);
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_data_free (&reply);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_ret_int32(sp, &tmp);
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_storage_free(sp);
|
||||
krb5_data_free (&reply);
|
||||
return tmp;
|
||||
|
@@ -51,7 +51,7 @@ kadm5_c_delete_principal(void *server_handle, krb5_principal princ)
|
||||
|
||||
sp = krb5_storage_from_mem(buf, sizeof(buf));
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_store_int32(sp, kadm_delete);
|
||||
@@ -65,12 +65,12 @@ kadm5_c_delete_principal(void *server_handle, krb5_principal princ)
|
||||
return ret;
|
||||
sp = krb5_storage_from_data (&reply);
|
||||
if(sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_data_free (&reply);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_ret_int32(sp, &tmp);
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_storage_free(sp);
|
||||
krb5_data_free (&reply);
|
||||
return tmp;
|
||||
|
@@ -54,7 +54,7 @@ kadm5_c_get_principal(void *server_handle,
|
||||
|
||||
sp = krb5_storage_from_mem(buf, sizeof(buf));
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_store_int32(sp, kadm_get);
|
||||
@@ -69,13 +69,13 @@ kadm5_c_get_principal(void *server_handle,
|
||||
return ret;
|
||||
sp = krb5_storage_from_data (&reply);
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_data_free (&reply);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_ret_int32(sp, &tmp);
|
||||
ret = tmp;
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
if(ret == 0)
|
||||
kadm5_ret_principal_ent(sp, out);
|
||||
krb5_storage_free(sp);
|
||||
|
@@ -246,7 +246,7 @@ kadm5_s_get_principal(void *server_handle,
|
||||
ret = add_tl_data(out, KRB5_TL_PASSWORD, pw, strlen(pw) + 1);
|
||||
free(pw);
|
||||
}
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
|
@@ -424,7 +424,7 @@ kadm_connect(kadm5_client_context *ctx)
|
||||
|
||||
error = getaddrinfo (hostname, portstr, &hints, &ai);
|
||||
if (error) {
|
||||
krb5_clear_error_string(context);
|
||||
krb5_clear_error_message(context);
|
||||
return KADM5_BAD_SERVER_NAME;
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ kadm_connect(kadm5_client_context *ctx)
|
||||
if (s < 0)
|
||||
continue;
|
||||
if (connect (s, a->ai_addr, a->ai_addrlen) < 0) {
|
||||
krb5_clear_error_string(context);
|
||||
krb5_clear_error_message(context);
|
||||
krb5_warn (context, errno, "connect(%s)", hostname);
|
||||
close (s);
|
||||
continue;
|
||||
@@ -442,7 +442,7 @@ kadm_connect(kadm5_client_context *ctx)
|
||||
}
|
||||
if (a == NULL) {
|
||||
freeaddrinfo (ai);
|
||||
krb5_clear_error_string(context);
|
||||
krb5_clear_error_message(context);
|
||||
krb5_warnx (context, "failed to contact %s", hostname);
|
||||
return KADM5_FAILURE;
|
||||
}
|
||||
@@ -466,7 +466,7 @@ kadm_connect(kadm5_client_context *ctx)
|
||||
if (service_name == NULL) {
|
||||
freeaddrinfo (ai);
|
||||
close(s);
|
||||
krb5_clear_error_string(context);
|
||||
krb5_clear_error_message(context);
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
@@ -510,13 +510,13 @@ kadm_connect(kadm5_client_context *ctx)
|
||||
s = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
|
||||
if (s < 0) {
|
||||
freeaddrinfo (ai);
|
||||
krb5_clear_error_string(context);
|
||||
krb5_clear_error_message(context);
|
||||
return errno;
|
||||
}
|
||||
if (connect (s, a->ai_addr, a->ai_addrlen) < 0) {
|
||||
close (s);
|
||||
freeaddrinfo (ai);
|
||||
krb5_clear_error_string(context);
|
||||
krb5_clear_error_message(context);
|
||||
return errno;
|
||||
}
|
||||
ret = krb5_sendauth(context, &ctx->ac, &s,
|
||||
|
@@ -549,7 +549,7 @@ main(int argc, char **argv)
|
||||
|
||||
ret = kadm5_log_init (server_context);
|
||||
if (ret) {
|
||||
krb5_clear_error_string(context);
|
||||
krb5_clear_error_message(context);
|
||||
krb5_err (context, 1, ret, "kadm5_log_init");
|
||||
}
|
||||
|
||||
|
@@ -53,7 +53,7 @@ kadm5_c_modify_principal(void *server_handle,
|
||||
|
||||
sp = krb5_storage_from_mem(buf, sizeof(buf));
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_store_int32(sp, kadm_modify);
|
||||
@@ -68,12 +68,12 @@ kadm5_c_modify_principal(void *server_handle,
|
||||
return ret;
|
||||
sp = krb5_storage_from_data (&reply);
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_data_free (&reply);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_ret_int32(sp, &tmp);
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_storage_free(sp);
|
||||
krb5_data_free (&reply);
|
||||
return tmp;
|
||||
|
@@ -53,7 +53,7 @@ kadm5_c_get_privs(void *server_handle, uint32_t *privs)
|
||||
|
||||
sp = krb5_storage_from_mem(buf, sizeof(buf));
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_store_int32(sp, kadm_get_privs);
|
||||
@@ -66,12 +66,12 @@ kadm5_c_get_privs(void *server_handle, uint32_t *privs)
|
||||
return ret;
|
||||
sp = krb5_storage_from_data(&reply);
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_data_free (&reply);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_ret_int32(sp, &tmp);
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
ret = tmp;
|
||||
if(ret == 0){
|
||||
krb5_ret_uint32(sp, privs);
|
||||
|
@@ -54,7 +54,7 @@ kadm5_c_randkey_principal(void *server_handle,
|
||||
|
||||
sp = krb5_storage_from_mem(buf, sizeof(buf));
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_store_int32(sp, kadm_randkey);
|
||||
@@ -68,11 +68,11 @@ kadm5_c_randkey_principal(void *server_handle,
|
||||
return ret;
|
||||
sp = krb5_storage_from_data(&reply);
|
||||
if (sp == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_data_free (&reply);
|
||||
return ENOMEM;
|
||||
}
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_ret_int32(sp, &tmp);
|
||||
ret = tmp;
|
||||
if(ret == 0){
|
||||
|
@@ -48,7 +48,7 @@ _kadm5_client_send(kadm5_client_context *context, krb5_storage *sp)
|
||||
len = krb5_storage_seek(sp, 0, SEEK_CUR);
|
||||
ret = krb5_data_alloc(&msg, len);
|
||||
if (ret) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ret;
|
||||
}
|
||||
krb5_storage_seek(sp, 0, SEEK_SET);
|
||||
@@ -61,14 +61,14 @@ _kadm5_client_send(kadm5_client_context *context, krb5_storage *sp)
|
||||
|
||||
sock = krb5_storage_from_fd(context->sock);
|
||||
if(sock == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_data_free(&out);
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
ret = krb5_store_data(sock, out);
|
||||
if (ret)
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
krb5_storage_free(sock);
|
||||
krb5_data_free(&out);
|
||||
return ret;
|
||||
@@ -83,12 +83,12 @@ _kadm5_client_recv(kadm5_client_context *context, krb5_data *reply)
|
||||
|
||||
sock = krb5_storage_from_fd(context->sock);
|
||||
if(sock == NULL) {
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
return ENOMEM;
|
||||
}
|
||||
ret = krb5_ret_data(sock, &data);
|
||||
krb5_storage_free(sock);
|
||||
krb5_clear_error_string(context->context);
|
||||
krb5_clear_error_message(context->context);
|
||||
if(ret == KRB5_CC_END)
|
||||
return KADM5_RPC_ERROR;
|
||||
else if(ret)
|
||||
|
Reference in New Issue
Block a user