Lines Matching full:handle
65 * Initialize a handle using the global context. The caller must destroy this
66 * handle before initializing another one. If the client name begins with '$',
68 * client is null, return a null handle.
73 void *handle; in get_handle() local
88 KADM5_STRUCT_VERSION, api, NULL, &handle)); in get_handle()
89 return handle; in get_handle()
93 free_handle(void *handle) in free_handle() argument
95 if (handle != NULL) in free_handle()
96 check(kadm5_destroy(handle)); in free_handle()
111 void *handle = get_handle("admin"); in create_simple_policy() local
116 check(kadm5_create_policy(handle, &ent, KADM5_POLICY)); in create_simple_policy()
117 free_handle(handle); in create_simple_policy()
123 void *handle = get_handle("admin"); in delete_policy() local
125 check(kadm5_delete_policy(handle, name)); in delete_policy()
126 free_handle(handle); in delete_policy()
133 void *handle = get_handle("admin"); in compare_policy() local
135 check(kadm5_get_policy(handle, x->policy, &g)); in compare_policy()
155 check(kadm5_free_policy_ent(handle, &g)); in compare_policy()
156 free_handle(handle); in compare_policy()
162 void *handle = get_handle("admin"); in create_simple_princ() local
171 check(kadm5_create_principal(handle, &ent, mask, "pw")); in create_simple_princ()
172 free_handle(handle); in create_simple_princ()
178 void *handle = get_handle("admin"); in delete_princ() local
180 check(kadm5_delete_principal(handle, princ)); in delete_princ()
181 free_handle(handle); in delete_princ()
199 void *handle = get_handle("admin"); in compare_princ() local
203 check(kadm5_get_principal(handle, x->principal, &g, in compare_princ()
225 kadm5_get_policy(handle, g.policy, &pol) == 0) { in compare_princ()
233 check(kadm5_free_policy_ent(handle, &pol)); in compare_princ()
242 check(kadm5_free_principal_ent(handle, &g)); in compare_princ()
243 free_handle(handle); in compare_princ()
266 void *handle = get_handle(user); in cpw_test_fail() local
268 check_fail(kadm5_chpass_principal(handle, princ, pass), code); in cpw_test_fail()
269 free_handle(handle); in cpw_test_fail()
284 void *handle; in test_chpass() local
290 handle = get_handle("admin"); in test_chpass()
291 check(kadm5_chpass_principal(handle, princ, "newpassword")); in test_chpass()
292 check(kadm5_get_principal(handle, princ, &ent, KADM5_KEY_DATA)); in test_chpass()
295 check(kadm5_free_principal_ent(handle, &ent)); in test_chpass()
296 free_handle(handle); in test_chpass()
309 /* Fails with null handle or principal name. */ in test_chpass()
322 void *handle = get_handle(user); in cpol_test_fail() local
324 check_fail(kadm5_create_policy(handle, ent, mask | KADM5_POLICY), code); in cpol_test_fail()
325 free_handle(handle); in cpol_test_fail()
339 void *handle; in test_create_policy() local
349 handle = get_handle("admin"); in test_create_policy()
350 check_fail(kadm5_create_policy(handle, &ent, 0), KADM5_BAD_MASK); in test_create_policy()
351 free_handle(handle); in test_create_policy()
417 /* Fails with null handle or policy ent. */ in test_create_policy()
426 void *handle = get_handle(user); in cprinc_test_fail() local
428 check_fail(kadm5_create_principal(handle, ent, mask | KADM5_PRINCIPAL, in cprinc_test_fail()
430 free_handle(handle); in cprinc_test_fail()
445 void *handle; in test_create_principal() local
464 handle = get_handle("admin"); in test_create_principal()
465 check_fail(kadm5_create_principal(handle, &ent, 0, "pw"), KADM5_BAD_MASK); in test_create_principal()
466 free_handle(handle); in test_create_principal()
514 /* Fails with null handle or principal ent. */ in test_create_principal()
525 void *handle = get_handle(user); in dpol_test_fail() local
527 check_fail(kadm5_delete_policy(handle, name), code); in dpol_test_fail()
528 free_handle(handle); in dpol_test_fail()
567 /* Fails with null handle or principal ent. */ in test_delete_policy()
577 void *handle = get_handle(user); in dprinc_test_fail() local
579 check_fail(kadm5_delete_principal(handle, princ), code); in dprinc_test_fail()
580 free_handle(handle); in dprinc_test_fail()
611 /* Fails with null handle or principal ent. */ in test_delete_principal()
621 void *handle = get_handle(user); in gpol_test_succeed() local
624 check(kadm5_get_policy(handle, name, &ent)); in gpol_test_succeed()
626 check(kadm5_free_policy_ent(handle, &ent)); in gpol_test_succeed()
627 free_handle(handle); in gpol_test_succeed()
633 void *handle = get_handle(user); in gpol_test_fail() local
636 check_fail(kadm5_get_policy(handle, name, &ent), code); in gpol_test_fail()
637 free_handle(handle); in gpol_test_fail()
646 /* Fails with empty or null policy name or a null handle. */ in test_get_policy()
665 void *handle = get_handle(user); in gprinc_test_succeed() local
668 check(kadm5_get_principal(handle, princ, &ent, in gprinc_test_succeed()
671 check(kadm5_free_principal_ent(handle, &ent)); in gprinc_test_succeed()
672 free_handle(handle); in gprinc_test_succeed()
678 void *handle = get_handle(user); in gprinc_test_fail() local
681 check_fail(kadm5_get_principal(handle, princ, &ent, in gprinc_test_fail()
683 free_handle(handle); in gprinc_test_fail()
689 void *handle; in test_get_principal() local
718 handle = get_handle("admin"); in test_get_principal()
719 check(kadm5_get_principal(handle, princ, &ent, in test_get_principal()
724 check(kadm5_free_principal_ent(handle, &ent)); in test_get_principal()
727 check(kadm5_get_principal(handle, princ, &ent, in test_get_principal()
732 check(kadm5_free_principal_ent(handle, &ent)); in test_get_principal()
733 free_handle(handle); in test_get_principal()
735 /* Fails with null handle or principal. */ in test_get_principal()
754 void *handle; in test_init_destroy() local
765 /* Destroy fails with no server handle. */ in test_init_destroy()
770 0x65432101, api, NULL, &handle), in test_init_destroy()
773 1, api, NULL, &handle), KADM5_BAD_STRUCT_VERSION); in test_init_destroy()
777 KADM5_STRUCT_VERSION_MASK, api, NULL, &handle), in test_init_destroy()
781 &handle), KADM5_NEW_STRUCT_VERSION); in test_init_destroy()
785 KADM5_STRUCT_VERSION, 0x65432100, NULL, &handle), in test_init_destroy()
788 KADM5_STRUCT_VERSION, 4, NULL, &handle), in test_init_destroy()
794 &handle); in test_init_destroy()
799 &handle); in test_init_destroy()
805 api, KADM5_STRUCT_VERSION, NULL, &handle), in test_init_destroy()
808 /* Hardcoded default max lifetime is used when no handle or krb5.conf in test_init_destroy()
810 handle = get_handle("admin"); in test_init_destroy()
811 check(kadm5_create_principal(handle, &ent, KADM5_PRINCIPAL, "pw")); in test_init_destroy()
812 check(kadm5_get_principal(handle, princ, &gent, in test_init_destroy()
815 check(kadm5_delete_principal(handle, princ)); in test_init_destroy()
816 check(kadm5_free_principal_ent(handle, &gent)); in test_init_destroy()
817 free_handle(handle); in test_init_destroy()
825 KADM5_STRUCT_VERSION, api, NULL, &handle); in test_init_destroy()
832 KADM5_STRUCT_VERSION, api, NULL, &handle); in test_init_destroy()
839 KADM5_STRUCT_VERSION, api, NULL, &handle); in test_init_destroy()
847 ¶ms, KADM5_STRUCT_VERSION, api, NULL, &handle)); in test_init_destroy()
848 check(kadm5_destroy(handle)); in test_init_destroy()
854 NULL, &handle)); in test_init_destroy()
855 check(kadm5_destroy(handle)); in test_init_destroy()
866 ¶ms, KADM5_STRUCT_VERSION, api, NULL, &handle)); in test_init_destroy()
867 check(kadm5_destroy(handle)); in test_init_destroy()
873 &handle), KADM5_RPC_ERROR); in test_init_destroy()
880 &handle), KADM5_CANT_RESOLVE); in test_init_destroy()
886 &handle), KRB5_FCC_NOFILE); in test_init_destroy()
892 &handle)); in test_init_destroy()
893 check(kadm5_destroy(handle)); in test_init_destroy()
899 KADM5_STRUCT_VERSION, api, NULL, &handle)); in test_init_destroy()
900 check(kadm5_destroy(handle)); in test_init_destroy()
907 &handle), KRB5_CC_NOTFOUND); in test_init_destroy()
911 KADM5_STRUCT_VERSION, api, NULL, &handle), in test_init_destroy()
916 KADM5_STRUCT_VERSION, api, NULL, &handle), in test_init_destroy()
921 KADM5_STRUCT_VERSION, api, NULL, &handle), in test_init_destroy()
926 NULL, KADM5_STRUCT_VERSION, api, NULL, &handle), in test_init_destroy()
931 NULL, KADM5_STRUCT_VERSION, api, NULL, &handle), in test_init_destroy()
936 NULL, KADM5_STRUCT_VERSION, api, NULL, &handle), in test_init_destroy()
942 api, NULL, &handle), in test_init_destroy()
948 api, NULL, &handle), KRB5_REALM_UNKNOWN); in test_init_destroy()
953 api, NULL, &handle), KRB5_REALM_UNKNOWN); in test_init_destroy()
962 &handle), KRB5_KDB_CANTREAD_STORED); in test_init_destroy()
972 ¶ms, KADM5_STRUCT_VERSION, api, NULL, &handle)); in test_init_destroy()
973 check(kadm5_create_principal(handle, &ent, KADM5_PRINCIPAL, "pw")); in test_init_destroy()
974 check(kadm5_get_principal(handle, princ, &gent, in test_init_destroy()
981 check(kadm5_delete_principal(handle, princ)); in test_init_destroy()
982 check(kadm5_free_principal_ent(handle, &gent)); in test_init_destroy()
983 check(kadm5_destroy(handle)); in test_init_destroy()
987 KADM5_STRUCT_VERSION, api, NULL, &handle)); in test_init_destroy()
988 check(kadm5_destroy(handle)); in test_init_destroy()
992 KADM5_STRUCT_VERSION, api, NULL, &handle)); in test_init_destroy()
993 check(kadm5_destroy(handle)); in test_init_destroy()
997 KADM5_STRUCT_VERSION, api, NULL, &handle)); in test_init_destroy()
998 check(kadm5_destroy(handle)); in test_init_destroy()
1008 void *handle = get_handle(user); in mpol_test_fail() local
1010 check_fail(kadm5_modify_policy(handle, ent, mask), code); in mpol_test_fail()
1011 free_handle(handle); in mpol_test_fail()
1015 mpol_test_compare(void *handle, kadm5_policy_ent_t ent, uint32_t mask) in mpol_test_compare() argument
1017 mpol_test_fail(handle, ent, mask, 0); in mpol_test_compare()
1089 /* Fails with null handle or policy ent. */ in test_modify_policy()
1098 void *handle = get_handle(user); in mprinc_test_fail() local
1100 check_fail(kadm5_modify_principal(handle, ent, mask), code); in mprinc_test_fail()
1101 free_handle(handle); in mprinc_test_fail()
1114 void *handle; in test_modify_principal() local
1195 handle = get_handle("admin"); in test_modify_principal()
1198 check(kadm5_modify_principal(handle, &ent, in test_modify_principal()
1201 check(kadm5_get_principal(handle, princ, &ent, in test_modify_principal()
1209 check(kadm5_free_principal_ent(handle, &ent)); in test_modify_principal()
1210 free_handle(handle); in test_modify_principal()
1212 /* Fails with null handle or principal ent. */ in test_modify_principal()
1223 void *handle = get_handle(user); in rnd_test_fail() local
1225 check_fail(kadm5_randkey_principal(handle, princ, NULL, NULL), code); in rnd_test_fail()
1226 free_handle(handle); in rnd_test_fail()
1238 void *handle; in test_randkey() local
1249 handle = get_handle("admin"); in test_randkey()
1250 check(kadm5_randkey_principal(handle, princ, &keys, &n_keys)); in test_randkey()
1251 check(kadm5_get_principal(handle, princ, &ent, KADM5_KEY_DATA)); in test_randkey()
1258 check(kadm5_free_principal_ent(handle, &ent)); in test_randkey()
1259 free_handle(handle); in test_randkey()
1282 handle = get_handle("$admin"); in test_randkey()
1283 check(kadm5_randkey_principal(handle, admin_princ, NULL, NULL)); in test_randkey()
1284 check(kadm5_chpass_principal(handle, admin_princ, ADMIN_PASSWORD)); in test_randkey()
1285 free_handle(handle); in test_randkey()
1287 /* Fails with null handle or principal name. */ in test_randkey()