diff options
author | Barry Jaspan <bjaspan@mit.edu> | 1996-11-01 18:25:48 +0000 |
---|---|---|
committer | Barry Jaspan <bjaspan@mit.edu> | 1996-11-01 18:25:48 +0000 |
commit | 15ab043da60b6aedaaa855eac071ed600badbc45 (patch) | |
tree | 52e561c09c0e72acc228fe070862702d7358f4e2 /src/lib/kadm5/srv | |
parent | abadaf73403d579f3d351bebe4157b15054360b1 (diff) | |
download | krb5-15ab043da60b6aedaaa855eac071ed600badbc45.tar.gz krb5-15ab043da60b6aedaaa855eac071ed600badbc45.tar.xz krb5-15ab043da60b6aedaaa855eac071ed600badbc45.zip |
* 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
Diffstat (limited to 'src/lib/kadm5/srv')
-rw-r--r-- | src/lib/kadm5/srv/ChangeLog | 5 | ||||
-rw-r--r-- | 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 7369d4b700..0faa215fcb 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 <bjaspan@mit.edu> + + * svr_principal.c (kadm5_modify_principal): update for new tl_data + semantics [krb5-admin/140] + Mon Oct 21 16:28:52 1996 Barry Jaspan <bjaspan@mit.edu> * 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 7339ea1bdb..380cf1f749 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; |