case CREATE_PRINCIPAL:
xdr_argument = xdr_cprinc_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) create_principal_1;
+ local = (char *(*)()) create_principal_1_svc;
break;
case DELETE_PRINCIPAL:
xdr_argument = xdr_dprinc_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) delete_principal_1;
+ local = (char *(*)()) delete_principal_1_svc;
break;
case MODIFY_PRINCIPAL:
xdr_argument = xdr_mprinc_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) modify_principal_1;
+ local = (char *(*)()) modify_principal_1_svc;
break;
case RENAME_PRINCIPAL:
xdr_argument = xdr_rprinc_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) rename_principal_1;
+ local = (char *(*)()) rename_principal_1_svc;
break;
case GET_PRINCIPAL:
xdr_argument = xdr_gprinc_arg;
xdr_result = xdr_gprinc_ret;
- local = (char *(*)()) get_principal_1;
+ local = (char *(*)()) get_principal_1_svc;
break;
case GET_PRINCS:
xdr_argument = xdr_gprincs_arg;
xdr_result = xdr_gprincs_ret;
- local = (char *(*)()) get_princs_1;
+ local = (char *(*)()) get_princs_1_svc;
break;
case CHPASS_PRINCIPAL:
xdr_argument = xdr_chpass_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) chpass_principal_1;
+ local = (char *(*)()) chpass_principal_1_svc;
break;
case SETV4KEY_PRINCIPAL:
xdr_argument = xdr_setv4key_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) setv4key_principal_1;
+ local = (char *(*)()) setv4key_principal_1_svc;
break;
case SETKEY_PRINCIPAL:
xdr_argument = xdr_setkey_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) setkey_principal_1;
+ local = (char *(*)()) setkey_principal_1_svc;
break;
case CHRAND_PRINCIPAL:
xdr_argument = xdr_chrand_arg;
xdr_result = xdr_chrand_ret;
- local = (char *(*)()) chrand_principal_1;
+ local = (char *(*)()) chrand_principal_1_svc;
break;
case CREATE_POLICY:
xdr_argument = xdr_cpol_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) create_policy_1;
+ local = (char *(*)()) create_policy_1_svc;
break;
case DELETE_POLICY:
xdr_argument = xdr_dpol_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) delete_policy_1;
+ local = (char *(*)()) delete_policy_1_svc;
break;
case MODIFY_POLICY:
xdr_argument = xdr_mpol_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) modify_policy_1;
+ local = (char *(*)()) modify_policy_1_svc;
break;
case GET_POLICY:
xdr_argument = xdr_gpol_arg;
xdr_result = xdr_gpol_ret;
- local = (char *(*)()) get_policy_1;
+ local = (char *(*)()) get_policy_1_svc;
break;
case GET_POLS:
xdr_argument = xdr_gpols_arg;
xdr_result = xdr_gpols_ret;
- local = (char *(*)()) get_pols_1;
+ local = (char *(*)()) get_pols_1_svc;
break;
case GET_PRIVS:
xdr_argument = xdr_u_int32;
xdr_result = xdr_getprivs_ret;
- local = (char *(*)()) get_privs_1;
+ local = (char *(*)()) get_privs_1_svc;
break;
case INIT:
xdr_argument = xdr_u_int32;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) init_1;
+ local = (char *(*)()) init_1_svc;
break;
case CREATE_PRINCIPAL3:
xdr_argument = xdr_cprinc3_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) create_principal3_1;
+ local = (char *(*)()) create_principal3_1_svc;
break;
case CHPASS_PRINCIPAL3:
xdr_argument = xdr_chpass3_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) chpass_principal3_1;
+ local = (char *(*)()) chpass_principal3_1_svc;
break;
case CHRAND_PRINCIPAL3:
xdr_argument = xdr_chrand3_arg;
xdr_result = xdr_chrand_ret;
- local = (char *(*)()) chrand_principal3_1;
+ local = (char *(*)()) chrand_principal3_1_svc;
break;
case SETKEY_PRINCIPAL3:
xdr_argument = xdr_setkey3_arg;
xdr_result = xdr_generic_ret;
- local = (char *(*)()) setkey_principal3_1;
+ local = (char *(*)()) setkey_principal3_1_svc;
break;
default:
#include <kadm5/server_internal.h>
#include <kadm5/server_acl.h>
#include <syslog.h>
+#include <arpa/inet.h> /* inet_ntoa */
+#include <krb5/adm_proto.h> /* krb5_klog_syslog */
#include "misc.h"
#define xdr_free gssrpc_xdr_free /* XXX kludge */
cmp_gss_names_rel_1(acceptor_name(rqstp->rq_svccred), \
gss_oldchangepw_name)))
-int cmp_gss_names(gss_name_t n1, gss_name_t n2)
+
+static int gss_to_krb5_name(kadm5_server_handle_t handle,
+ gss_name_t gss_name, krb5_principal *princ);
+
+static int gss_name_to_string(gss_name_t gss_name, gss_buffer_desc *str);
+
+static gss_name_t acceptor_name(gss_ctx_id_t context);
+
+static int cmp_gss_names(gss_name_t n1, gss_name_t n2)
{
OM_uint32 emaj, emin;
int equal;
/* Does a comparison of the names and then releases the first entity */
/* For use above in CHANGEPW_SERVICE */
-int cmp_gss_names_rel_1(gss_name_t n1, gss_name_t n2)
+static int cmp_gss_names_rel_1(gss_name_t n1, gss_name_t n2)
{
OM_uint32 min_stat;
int ret;
* server_name, both of which must be freed by the caller. Returns 0
* on success and -1 on failure.
*/
+static
int setup_gss_names(struct svc_req *rqstp,
gss_buffer_desc *client_name,
gss_buffer_desc *server_name)
return 0;
}
-gss_name_t acceptor_name(gss_ctx_id_t context)
+static gss_name_t acceptor_name(gss_ctx_id_t context)
{
OM_uint32 maj_stat, min_stat;
gss_name_t name;
return name;
}
-int cmp_gss_krb5_name(kadm5_server_handle_t handle,
+static int cmp_gss_krb5_name(kadm5_server_handle_t handle,
gss_name_t gss_name, krb5_principal princ)
{
krb5_principal princ2;
- int stat;
+ int status;
if (! gss_to_krb5_name(handle, gss_name, &princ2))
return 0;
- stat = krb5_principal_compare(handle->context, princ, princ2);
+ status = krb5_principal_compare(handle->context, princ, princ2);
krb5_free_principal(handle->context, princ2);
- return stat;
+ return status;
}
-int gss_to_krb5_name(kadm5_server_handle_t handle,
+static int gss_to_krb5_name(kadm5_server_handle_t handle,
gss_name_t gss_name, krb5_principal *princ)
{
- OM_uint32 stat, minor_stat;
+ OM_uint32 status, minor_stat;
gss_buffer_desc gss_str;
gss_OID gss_type;
int success;
- stat = gss_display_name(&minor_stat, gss_name, &gss_str, &gss_type);
- if ((stat != GSS_S_COMPLETE) || (gss_type != gss_nt_krb5_name))
+ status = gss_display_name(&minor_stat, gss_name, &gss_str, &gss_type);
+ if ((status != GSS_S_COMPLETE) || (gss_type != gss_nt_krb5_name))
return 0;
success = (krb5_parse_name(handle->context, gss_str.value, princ) == 0);
gss_release_buffer(&minor_stat, &gss_str);
return success;
}
-int
+
+static int
gss_name_to_string(gss_name_t gss_name, gss_buffer_desc *str)
{
- OM_uint32 stat, minor_stat;
+ OM_uint32 status, minor_stat;
gss_OID gss_type;
- int ret;
- stat = gss_display_name(&minor_stat, gss_name, str, &gss_type);
- if ((stat != GSS_S_COMPLETE) || (gss_type != gss_nt_krb5_name))
+ status = gss_display_name(&minor_stat, gss_name, str, &gss_type);
+ if ((status != GSS_S_COMPLETE) || (gss_type != gss_nt_krb5_name))
return 1;
return 0;
}
generic_ret *
-create_principal_1(cprinc_arg *arg, struct svc_req *rqstp)
+create_principal_1_svc(cprinc_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-create_principal3_1(cprinc3_arg *arg, struct svc_req *rqstp)
+create_principal3_1_svc(cprinc3_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-delete_principal_1(dprinc_arg *arg, struct svc_req *rqstp)
+delete_principal_1_svc(dprinc_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-modify_principal_1(mprinc_arg *arg, struct svc_req *rqstp)
+modify_principal_1_svc(mprinc_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-rename_principal_1(rprinc_arg *arg, struct svc_req *rqstp)
+rename_principal_1_svc(rprinc_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg1,
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
gprinc_ret *
-get_principal_1(gprinc_arg *arg, struct svc_req *rqstp)
+get_principal_1_svc(gprinc_arg *arg, struct svc_req *rqstp)
{
static gprinc_ret ret;
kadm5_principal_ent_t_v1 e;
xdr_free(xdr_gprinc_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
gprincs_ret *
-get_princs_1(gprincs_arg *arg, struct svc_req *rqstp)
+get_princs_1_svc(gprincs_arg *arg, struct svc_req *rqstp)
{
static gprincs_ret ret;
char *prime_arg;
xdr_free(xdr_gprincs_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-chpass_principal_1(chpass_arg *arg, struct svc_req *rqstp)
+chpass_principal_1_svc(chpass_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-chpass_principal3_1(chpass3_arg *arg, struct svc_req *rqstp)
+chpass_principal3_1_svc(chpass3_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-setv4key_principal_1(setv4key_arg *arg, struct svc_req *rqstp)
+setv4key_principal_1_svc(setv4key_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-setkey_principal_1(setkey_arg *arg, struct svc_req *rqstp)
+setkey_principal_1_svc(setkey_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-setkey_principal3_1(setkey3_arg *arg, struct svc_req *rqstp)
+setkey_principal3_1_svc(setkey3_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
chrand_ret *
-chrand_principal_1(chrand_arg *arg, struct svc_req *rqstp)
+chrand_principal_1_svc(chrand_arg *arg, struct svc_req *rqstp)
{
static chrand_ret ret;
krb5_keyblock *k;
xdr_free(xdr_chrand_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
chrand_ret *
-chrand_principal3_1(chrand3_arg *arg, struct svc_req *rqstp)
+chrand_principal3_1_svc(chrand3_arg *arg, struct svc_req *rqstp)
{
static chrand_ret ret;
krb5_keyblock *k;
xdr_free(xdr_chrand_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-create_policy_1(cpol_arg *arg, struct svc_req *rqstp)
+create_policy_1_svc(cpol_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-delete_policy_1(dpol_arg *arg, struct svc_req *rqstp)
+delete_policy_1_svc(dpol_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
generic_ret *
-modify_policy_1(mpol_arg *arg, struct svc_req *rqstp)
+modify_policy_1_svc(mpol_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
gpol_ret *
-get_policy_1(gpol_arg *arg, struct svc_req *rqstp)
+get_policy_1_svc(gpol_arg *arg, struct svc_req *rqstp)
{
static gpol_ret ret;
kadm5_ret_t ret2;
OM_uint32 minor_stat;
kadm5_policy_ent_t e;
kadm5_principal_ent_rec caller_ent;
- krb5_principal caller;
kadm5_server_handle_t handle;
xdr_free(xdr_gpol_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
}
gpols_ret *
-get_pols_1(gpols_arg *arg, struct svc_req *rqstp)
+get_pols_1_svc(gpols_arg *arg, struct svc_req *rqstp)
{
static gpols_ret ret;
char *prime_arg;
xdr_free(xdr_gpols_ret, &ret);
- if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+ if ((ret.code = new_server_handle(arg->api_version, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
return &ret;
}
-getprivs_ret * get_privs_1(krb5_ui_4 *arg, struct svc_req *rqstp)
+getprivs_ret * get_privs_1_svc(krb5_ui_4 *arg, struct svc_req *rqstp)
{
static getprivs_ret ret;
- char *prime_arg;
gss_buffer_desc client_name, service_name;
OM_uint32 minor_stat;
kadm5_server_handle_t handle;
xdr_free(xdr_getprivs_ret, &ret);
- if (ret.code = new_server_handle(*arg, rqstp, &handle))
+ if ((ret.code = new_server_handle(*arg, rqstp, &handle)))
return &ret;
- if (ret.code = check_handle((void *)handle)) {
+ if ((ret.code = check_handle((void *)handle))) {
free_server_handle(handle);
return &ret;
}
return &ret;
}
-generic_ret *init_1(krb5_ui_4 *arg, struct svc_req *rqstp)
+generic_ret *init_1_svc(krb5_ui_4 *arg, struct svc_req *rqstp)
{
static generic_ret ret;
gss_buffer_desc client_name,
xdr_free(xdr_generic_ret, &ret);
- if (ret.code = new_server_handle(*arg, rqstp, &handle))
+ if ((ret.code = new_server_handle(*arg, rqstp, &handle)))
return &ret;
if (! (ret.code = check_handle((void *)handle))) {
ret.api_version = handle->api_version;