From ea0442c3eade49a21977a52f3091b4e32189b382 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Mon, 21 Oct 1996 20:30:38 +0000 Subject: [PATCH] * svr_principal.c (kadm5_modify_principal): fix modify_principal's handling of KADM5_TL_DATA [krb5-admin/20] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9221 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm5/srv/ChangeLog | 5 +++++ src/lib/kadm5/srv/svr_principal.c | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/lib/kadm5/srv/ChangeLog b/src/lib/kadm5/srv/ChangeLog index e60a083c7..7369d4b70 100644 --- a/src/lib/kadm5/srv/ChangeLog +++ b/src/lib/kadm5/srv/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 21 16:28:52 1996 Barry Jaspan + + * svr_principal.c (kadm5_modify_principal): fix modify_principal's + handling of KADM5_TL_DATA [krb5-admin/20] + Fri Oct 18 14:24:12 1996 Barry Jaspan * svr_misc_free.c, server_dict.c, adb_policy.c, adb_free.c: diff --git a/src/lib/kadm5/srv/svr_principal.c b/src/lib/kadm5/srv/svr_principal.c index df9e34925..7339ea1bd 100644 --- a/src/lib/kadm5/srv/svr_principal.c +++ b/src/lib/kadm5/srv/svr_principal.c @@ -497,24 +497,26 @@ kadm5_modify_principal(void *server_handle, } if (mask & KADM5_TL_DATA) { - /* splice entry->tl_data onto the front of kdb.tl_data */ - tl_data_orig = kdb.tl_data; - for (tl_data_tail = entry->tl_data; tl_data_tail->tl_data_next; - tl_data_tail = tl_data_tail->tl_data_next) - ; - tl_data_tail->tl_data_next = kdb.tl_data; + krb5_tl_data *tl; + /* + * Replace kdb.tl_data with what was passed in. The + * KRB5_TL_KADM_DATA will be re-added (based on adb) by + * kdb_put_entry, below. + */ + while (kdb.tl_data) { + tl = kdb.tl_data->tl_data_next; + free(kdb.tl_data->tl_data_contents); + free(kdb.tl_data); + kdb.tl_data = tl; + } + kdb.tl_data = entry->tl_data; + kdb.n_tl_data = entry->n_tl_data; } if ((ret = kdb_put_entry(handle, &kdb, &adb))) goto done; - if (mask & KADM5_TL_DATA) { - /* remove entry->tl_data from the front of kdb.tl_data */ - tl_data_tail->tl_data_next = NULL; - kdb.tl_data = tl_data_orig; - } - ret = KADM5_OK; done: if (have_opol) { -- 2.26.2