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