From 07370612bdec864938c73c8f9f505fe8829f0d24 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Tue, 19 Jul 2011 14:18:54 -0500 Subject: [PATCH] Remove policy name checking against krb5.conf code. --- lib/kadm5/modify_s.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/lib/kadm5/modify_s.c b/lib/kadm5/modify_s.c index 305cbc946..8d5787d5f 100644 --- a/lib/kadm5/modify_s.c +++ b/lib/kadm5/modify_s.c @@ -35,35 +35,6 @@ RCSID("$Id$"); -static int -check_policy_exists(kadm5_server_context *context, const char *pol_name) -{ - char **pols; - char **pol; - char *pend; - size_t len; - - pols = krb5_config_get_strings(context->context, "kadmin", - "policies", NULL); - if (pols == NULL) { - if (strcmp(pol_name, "default") == 0) - return 1; - return 0; - } - - for (pol = pols; *pol != NULL; pol++) { - pend = strchr(pol, ':'); - if (pend == NULL) - len = strlen(*pol); - else - len = pend - *pol; - if (strncmp(pol_name, *pol, len) == 0 && pol_name[len] == '\0') - return 1; - } - - return 0; -} - static kadm5_ret_t modify_principal(void *server_handle, kadm5_principal_ent_t princ, @@ -76,9 +47,8 @@ modify_principal(void *server_handle, if((mask & forbidden_mask)) return KADM5_BAD_MASK; - if((mask & KADM5_POLICY)) { - if (!check_policy_exists(context, princ->policy)) - return KADM5_UNK_POLICY; + if((mask & KADM5_POLICY) && strcmp(princ->policy, "default")) + return KADM5_UNK_POLICY; } memset(&ent, 0, sizeof(ent));