Lines Matching defs:handle
221 kadm5_server_handle_t handle = server_handle;
225 krb5_clear_error_message(handle->context);
245 ret = kdb_get_entry(handle, entry->principal, &kdb, &adb);
260 kdb_free_entry(handle, &kdb, &adb);
269 kdb_free_entry(handle, NULL, &adb);
282 if ((ret = kadm5_get_policy(handle->lhandle, entry->policy,
290 if ((ret = passwd_check(handle, password, (mask & KADM5_POLICY),
293 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
301 if ((ret = krb5_timeofday(handle->context, &now))) {
303 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
317 kdb.attributes = handle->params.flags;
320 kdb.attributes = handle->params.flags;
326 kdb.max_life = handle->params.max_life;
331 kdb.max_renewable_life = handle->params.max_rlife;
336 kdb.expiration = handle->params.expiration;
356 if ((ret = kadm5_copy_principal(handle->context,
359 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
363 if ((ret = krb5_dbe_update_last_pwd_change(handle->context, &kdb, now))) {
364 krb5_db_free_principal(handle->context, &kdb, 1);
366 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
376 ret = krb5_dbe_update_tl_data(handle->context, &kdb, tl_data_tail);
379 krb5_db_free_principal(handle->context, &kdb, 1);
381 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
389 if ((ret = krb5_dbe_cpw(handle->context, &handle->master_keyblock,
390 n_ks_tuple?ks_tuple:handle->params.keysalts,
391 n_ks_tuple?n_ks_tuple:handle->params.num_keysalts,
395 krb5_db_free_principal(handle->context, &kdb, 1);
397 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
421 if ((ret = kadm5_modify_policy_internal(handle->lhandle, &polent,
424 krb5_db_free_principal(handle->context, &kdb, 1);
426 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
435 ret = kdb_put_entry(handle, &kdb, &adb);
437 krb5_db_free_principal(handle->context, &kdb, 1);
448 (void) kadm5_modify_policy_internal(handle->lhandle, &polent,
453 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
458 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
471 kadm5_server_handle_t handle = server_handle;
475 krb5_clear_error_message(handle->context);
480 if ((ret = kdb_get_entry(handle, principal, &kdb, &adb)))
484 if ((ret = kadm5_get_policy(handle->lhandle,
488 if ((ret = kadm5_modify_policy_internal(handle->lhandle, &polent,
491 (void) kadm5_free_policy_ent(handle->lhandle, &polent);
492 kdb_free_entry(handle, &kdb, &adb);
496 if ((ret = kadm5_free_policy_ent(handle->lhandle, &polent))) {
497 kdb_free_entry(handle, &kdb, &adb);
502 ret = kdb_delete_entry(handle, principal);
504 kdb_free_entry(handle, &kdb, &adb);
519 kadm5_server_handle_t handle = server_handle;
523 krb5_clear_error_message(handle->context);
546 ret = kdb_get_entry(handle, entry->principal, &kdb, &adb);
556 ret = kadm5_get_policy(handle->lhandle, entry->policy, &npol);
575 ret = kadm5_get_policy(handle->lhandle,
602 ret = krb5_dbe_lookup_last_pwd_change(handle->context, &kdb,
614 ret = kadm5_get_policy(handle->lhandle, adb.policy, &opol);
640 kadm5_modify_policy_internal(handle->lhandle, &opol,
644 kadm5_modify_policy_internal(handle->lhandle, &npol,
674 ret = krb5_dbe_update_tl_data(handle->context, &kdb, tl);
685 ret = kdb_put_entry(handle, &kdb, &adb);
691 ret2 = kadm5_free_policy_ent(handle->lhandle, &opol);
695 ret2 = kadm5_free_policy_ent(handle->lhandle, &npol);
698 kdb_free_entry(handle, &kdb, &adb);
709 kadm5_server_handle_t handle = server_handle;
713 krb5_clear_error_message(handle->context);
718 if ((ret = kdb_get_entry(handle, target, &kdb, &adb)) == 0) {
719 kdb_free_entry(handle, &kdb, &adb);
723 if ((ret = kdb_get_entry(handle, source, &kdb, &adb)))
736 kadm5_free_principal(handle->context, kdb.princ);
737 ret = kadm5_copy_principal(handle->context, target, &kdb.princ);
743 if ((ret = kdb_put_entry(handle, &kdb, &adb)))
746 ret = kdb_delete_entry(handle, source);
749 kdb_free_entry(handle, &kdb, &adb);
763 kadm5_server_handle_t handle = server_handle;
768 krb5_clear_error_message(handle->context);
775 if (handle->api_version == KADM5_API_VERSION_1) {
788 if ((ret = kdb_get_entry(handle, principal, &kdb, &adb)))
804 (ret = krb5_copy_principal(handle->context, principal,
813 (ret = krb5_dbe_lookup_last_pwd_change(handle->context, &kdb,
826 ret = krb5_dbe_lookup_mod_princ_data(handle->context, &kdb,
836 krb5_free_principal(handle->context, entry->principal);
849 if (handle->api_version == KADM5_API_VERSION_2)
859 if (handle->api_version == KADM5_API_VERSION_2) {
901 ret = krb5_copy_key_data_contents(handle->context,
914 if (handle->api_version == KADM5_API_VERSION_1) {
943 krb5_free_principal(handle->context, entry->principal);
944 kdb_free_entry(handle, &kdb, &adb);
1348 kadm5_server_handle_t handle = server_handle;
1357 krb5_clear_error_message(handle->context);
1364 if ((krb5_principal_compare(handle->context,
1368 if ((ret = kdb_get_entry(handle, principal, &kdb, &adb)))
1372 if ((ret = kdb_get_entry(handle, principal, &kdb_save, NULL))) {
1373 kdb_free_entry(handle, &kdb, &adb);
1378 if ((ret = kadm5_get_policy(handle->lhandle, adb.policy, &pol)))
1383 if ((ret = passwd_check(handle, password, adb.aux_attributes &
1387 ret = krb5_dbe_cpw(handle->context, &handle->master_keyblock,
1388 n_ks_tuple?ks_tuple:handle->params.keysalts,
1389 n_ks_tuple?n_ks_tuple:handle->params.num_keysalts,
1397 ret = krb5_timeofday(handle->context, &now);
1404 ret = krb5_dbe_lookup_last_pwd_change(handle->context,
1423 ret = create_history_entry(handle->context,
1424 &handle->master_keyblock, kdb_save.n_key_data,
1429 ret = check_pw_reuse(handle->context,
1430 &handle->master_keyblock,
1443 ret = check_pw_reuse(handle->context,
1444 &handle->master_keyblock,
1451 ret = add_to_history(handle->context, &adb, &pol, &hist);
1467 (krb5_princ_size (handle->context, principal) == 1)) {
1468 krb5_data *princ = krb5_princ_component (handle->context, principal, 0);
1490 ret = kadm5_launch_task (handle->context, path, argv, pwbuf);
1501 ret = krb5_dbe_update_last_pwd_change(handle->context, &kdb, now);
1513 if ((ret = kdb_put_entry(handle, &kdb, &adb)))
1519 free_history_entry(handle->context, &hist);
1520 kdb_free_entry(handle, &kdb, &adb);
1521 kdb_free_entry(handle, &kdb_save, NULL);
1522 krb5_db_free_principal(handle->context, &kdb, 1);
1524 if (have_pol && (ret2 = kadm5_free_policy_ent(handle->lhandle, &pol))
1570 kadm5_server_handle_t handle = server_handle;
1577 krb5_clear_error_message(handle->context);
1582 ((krb5_principal_compare(handle->context,
1586 if ((ret = kdb_get_entry(handle, principal, &kdb, &adb)))
1589 ret = krb5_dbe_crk(handle->context, &handle->master_keyblock,
1590 n_ks_tuple?ks_tuple:handle->params.keysalts,
1591 n_ks_tuple?n_ks_tuple:handle->params.num_keysalts,
1599 ret = krb5_timeofday(handle->context, &now);
1604 if ((ret = kadm5_get_policy(handle->lhandle, adb.policy,
1609 ret = krb5_dbe_lookup_last_pwd_change(handle->context,
1634 ret = check_pw_reuse(handle->context,
1635 &handle->master_keyblock,
1650 ret = krb5_dbe_update_last_pwd_change(handle->context, &kdb, now);
1655 if (handle->api_version == KADM5_API_VERSION_1) {
1657 ret = krb5_dbe_find_enctype(handle->context, &kdb,
1663 ret = decrypt_key_data(handle->context,
1664 &handle->master_keyblock, 1, key_data,
1669 ret = decrypt_key_data(handle->context,
1670 &handle->master_keyblock,
1681 if ((ret = kdb_put_entry(handle, &kdb, &adb)))
1686 kdb_free_entry(handle, &kdb, &adb);
1688 kadm5_free_policy_ent(handle->lhandle, &pol);
1715 kadm5_server_handle_t handle = server_handle;
1722 krb5_clear_error_message(handle->context);
1727 ((krb5_principal_compare(handle->context,
1734 if ((ret = kdb_get_entry(handle, principal, &kdb, &adb)))
1742 cleanup_key_data(handle->context, kdb.n_key_data, kdb.key_data);
1744 kdb.key_data = (krb5_key_data*)krb5_db_alloc(handle->context, NULL, sizeof(krb5_key_data));
1755 ret = krb5_dbekd_encrypt_key_data(handle->context, &master_keyblock,
1766 kdb.key_data->key_data_contents[k] = krb5_db_alloc(handle->context, NULL, tmp_key_data.key_data_length[k]);
1768 cleanup_key_data(handle->context, kdb.n_key_data, kdb.key_data);
1786 ret = krb5_timeofday(handle->context, &now);
1791 if ((ret = kadm5_get_policy(handle->lhandle, adb.policy,
1803 if (ret = krb5_dbe_lookup_last_pwd_change(handle->context,
1822 if (ret = check_pw_reuse(handle->context,
1838 ret = krb5_dbe_update_last_pwd_change(handle->context, &kdb, now);
1842 if ((ret = kdb_put_entry(handle, &kdb, &adb)))
1854 kdb_free_entry(handle, &kdb, &adb);
1856 kadm5_free_policy_ent(handle->lhandle, &pol);
1892 kadm5_server_handle_t handle = server_handle;
1900 krb5_clear_error_message(handle->context);
1905 ((krb5_principal_compare(handle->context,
1911 if ((ret = krb5_c_enctype_compare(handle->context,
1929 if ((ret = kdb_get_entry(handle, principal, &kdb, &adb)))
1941 cleanup_key_data(handle->context, kdb.n_key_data, kdb.key_data);
1946 kdb.key_data = (krb5_key_data*)krb5_db_alloc(handle->context, NULL, (n_keys+n_old_keys)
1968 ret = krb5_dbekd_encrypt_key_data(handle->context,
1969 &handle->master_keyblock,
1982 tptr->key_data_contents[k] = krb5_db_alloc(handle->context, NULL, tmp_key_data.key_data_length[k]);
2013 krb5_db_free(handle->context, old_key_data);
2018 if ((ret = krb5_timeofday(handle->context, &now)))
2022 if ((ret = kadm5_get_policy(handle->lhandle, adb.policy,
2034 if (ret = krb5_dbe_lookup_last_pwd_change(handle->context,
2053 if (ret = check_pw_reuse(handle->context,
2054 &handle->master_keyblock,
2070 if ((ret = krb5_dbe_update_last_pwd_change(handle->context, &kdb, now)))
2073 if ((ret = kdb_put_entry(handle, &kdb, &adb)))
2078 kdb_free_entry(handle, &kdb, &adb);
2080 kadm5_free_policy_ent(handle->lhandle, &pol);
2137 * server_handle (r) kadm5 handle
2166 kadm5_server_handle_t handle = server_handle;
2179 if ((ret = krb5_dbe_find_enctype(handle->context, &dbent, ktype,
2183 if ((ret = krb5_dbekd_decrypt_key_data(handle->context,
2184 &handle->master_keyblock, key_data,
2210 kadm5_server_handle_t handle = server_handle;
2215 ret = krb5_timeofday(handle->context, &now);
2219 ret = kadm5_get_principal(handle->lhandle, principal,
2224 if((ret=kadm5_get_policy(handle->lhandle,
2226 (void) kadm5_free_principal_ent(handle->lhandle, &princ);
2249 (void) kadm5_free_policy_ent(handle->lhandle, &pol);
2250 (void) kadm5_free_principal_ent(handle->lhandle, &princ);
2254 ret = kadm5_free_policy_ent(handle->lhandle, &pol);
2256 (void) kadm5_free_principal_ent(handle->lhandle, &princ);
2261 return kadm5_free_principal_ent(handle->lhandle, &princ);