From 15ab043da60b6aedaaa855eac071ed600badbc45 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Fri, 1 Nov 1996 18:25:48 +0000 Subject: [PATCH] * svr_principal.c (kadm5_modify_principal): update for new tl_data semantics [krb5-admin/140] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9272 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm5/srv/ChangeLog | 5 +++++ src/lib/kadm5/srv/svr_principal.c | 37 ++++++++++++++----------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/lib/kadm5/srv/ChangeLog b/src/lib/kadm5/srv/ChangeLog index 7369d4b70..0faa215fc 100644 --- a/src/lib/kadm5/srv/ChangeLog +++ b/src/lib/kadm5/srv/ChangeLog @@ -1,3 +1,8 @@ +Fri Nov 1 13:18:40 1996 Barry Jaspan + + * svr_principal.c (kadm5_modify_principal): update for new tl_data + semantics [krb5-admin/140] + Mon Oct 21 16:28:52 1996 Barry Jaspan * svr_principal.c (kadm5_modify_principal): fix modify_principal's diff --git a/src/lib/kadm5/srv/svr_principal.c b/src/lib/kadm5/srv/svr_principal.c index 7339ea1bd..380cf1f74 100644 --- a/src/lib/kadm5/srv/svr_principal.c +++ b/src/lib/kadm5/srv/svr_principal.c @@ -377,6 +377,14 @@ kadm5_modify_principal(void *server_handle, return KADM5_BAD_MASK; if(entry == (kadm5_principal_ent_t) NULL) return EINVAL; + if (mask & KADM5_TL_DATA) { + tl_data_orig = entry->tl_data; + while (tl_data_orig) { + if (tl_data_orig->tl_data_type < 256) + return KADM5_BAD_TL_TYPE; + tl_data_orig = tl_data_orig->tl_data_next; + } + } if (ret = kdb_get_entry(handle, entry->principal, &kdb, &adb)) return(ret); @@ -693,33 +701,22 @@ kadm5_get_principal(void *server_handle, krb5_principal principal, if (mask & KADM5_TL_DATA) { krb5_tl_data td, *tl, *tl2; - entry->n_tl_data = kdb.n_tl_data; entry->tl_data = NULL; tl = kdb.tl_data; while (tl) { - if ((tl2 = dup_tl_data(tl)) == NULL) { - ret = ENOMEM; - goto done; + if (tl->tl_data_type > 255) { + if ((tl2 = dup_tl_data(tl)) == NULL) { + ret = ENOMEM; + goto done; + } + tl2->tl_data_next = entry->tl_data; + entry->tl_data = tl2; + entry->n_tl_data++; } - tl2->tl_data_next = entry->tl_data; - entry->tl_data = tl2; - + tl = tl->tl_data_next; } - - if (kdb.e_length) { - td.tl_data_type = KRB5_TL_KADM5_E_DATA; - td.tl_data_length = kdb.e_length; - td.tl_data_contents = kdb.e_data; - - if ((tl = dup_tl_data(&td)) == NULL) { - ret = ENOMEM; - goto done; - } - tl->tl_data_next = entry->tl_data; - entry->tl_data = tl; - } } if (mask & KADM5_KEY_DATA) { entry->n_key_data = kdb.n_key_data; -- 2.26.2