* svr_principal.c (kadm5_modify_principal): update for new tl_data
authorBarry Jaspan <bjaspan@mit.edu>
Fri, 1 Nov 1996 18:25:48 +0000 (18:25 +0000)
committerBarry Jaspan <bjaspan@mit.edu>
Fri, 1 Nov 1996 18:25:48 +0000 (18:25 +0000)
  semantics [krb5-admin/140]

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9272 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm5/srv/ChangeLog
src/lib/kadm5/srv/svr_principal.c

index 7369d4b70023f99c94f220bd0394c0bf77e5e3d6..0faa215fcb688c547c6dd29bd5794fda4e44804f 100644 (file)
@@ -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
index 7339ea1bdba1d117b1115e4a5cc0f5dc76a30a7b..380cf1f7490c9b00cde46ad168181e694064a6dd 100644 (file)
@@ -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;