Lines Matching full:user
116 semanage_user_t *user; in get_user_nth() local
127 user = records[idx]; in get_user_nth()
133 return user; in get_user_nth()
139 semanage_user_t *user; in get_user_key_nth() local
145 user = get_user_nth(idx); in get_user_key_nth()
147 res = semanage_user_key_extract(sh, user, &key); in get_user_key_nth()
157 semanage_user_t *user; in add_local_user() local
162 user = get_user_nth(user_idx); in add_local_user()
164 CU_ASSERT_FATAL(semanage_user_key_extract(sh, user, &key) >= 0); in add_local_user()
167 CU_ASSERT_FATAL(semanage_user_modify_local(sh, key, user) >= 0); in add_local_user()
184 semanage_user_t *user = NULL; in test_user_compare() local
191 user = get_user_nth(I_FIRST); in test_user_compare()
196 res = semanage_user_compare(user, key1); in test_user_compare()
198 res = semanage_user_compare(user, key2); in test_user_compare()
202 semanage_user_free(user); in test_user_compare()
255 semanage_user_t *user = NULL; in test_user_key_extract() local
260 user = get_user_nth(I_FIRST); in test_user_key_extract()
263 CU_ASSERT(semanage_user_key_extract(sh, user, &key) >= 0); in test_user_key_extract()
267 semanage_user_free(user); in test_user_key_extract()
275 semanage_user_t *user = NULL; in test_user_get_set_name() local
279 CU_ASSERT(semanage_user_create(sh, &user) >= 0); in test_user_get_set_name()
282 CU_ASSERT(semanage_user_set_name(sh, user, "user_u") == 0); in test_user_get_set_name()
283 CU_ASSERT_STRING_EQUAL(semanage_user_get_name(user), "user_u"); in test_user_get_set_name()
286 semanage_user_free(user); in test_user_get_set_name()
293 semanage_user_t *user = NULL; in test_user_get_set_prefix() local
297 CU_ASSERT(semanage_user_create(sh, &user) >= 0); in test_user_get_set_prefix()
300 CU_ASSERT(semanage_user_set_prefix(sh, user, "user") == 0); in test_user_get_set_prefix()
301 CU_ASSERT_STRING_EQUAL(semanage_user_get_prefix(user), "user"); in test_user_get_set_prefix()
304 semanage_user_free(user); in test_user_get_set_prefix()
311 semanage_user_t *user = NULL; in test_user_get_set_mlslevel() local
315 CU_ASSERT(semanage_user_create(sh, &user) >= 0); in test_user_get_set_mlslevel()
318 CU_ASSERT(semanage_user_set_mlslevel(sh, user, "s0") == 0); in test_user_get_set_mlslevel()
319 CU_ASSERT_STRING_EQUAL(semanage_user_get_mlslevel(user), "s0"); in test_user_get_set_mlslevel()
322 semanage_user_free(user); in test_user_get_set_mlslevel()
329 semanage_user_t *user = NULL; in test_user_get_set_mlsrange() local
333 CU_ASSERT(semanage_user_create(sh, &user) >= 0); in test_user_get_set_mlsrange()
336 CU_ASSERT(semanage_user_set_mlsrange(sh, user, "s0-s15") == 0); in test_user_get_set_mlsrange()
337 CU_ASSERT_STRING_EQUAL(semanage_user_get_mlsrange(user), "s0-s15"); in test_user_get_set_mlsrange()
340 semanage_user_free(user); in test_user_get_set_mlsrange()
350 semanage_user_t *user = NULL; in test_user_roles() local
358 CU_ASSERT(semanage_user_create(sh, &user) >= 0); in test_user_roles()
361 CU_ASSERT(semanage_user_get_num_roles(user) == 0); in test_user_roles()
363 CU_ASSERT(semanage_user_add_role(sh, user, "role_r") == 0); in test_user_roles()
364 CU_ASSERT(semanage_user_get_num_roles(user) == 1); in test_user_roles()
366 CU_ASSERT(semanage_user_has_role(user, "role_r")); in test_user_roles()
367 CU_ASSERT(!semanage_user_has_role(user, "my_role_r")); in test_user_roles()
369 CU_ASSERT(semanage_user_add_role(sh, user, "my_role_r") == 0); in test_user_roles()
370 CU_ASSERT(semanage_user_get_num_roles(user) == 2); in test_user_roles()
372 CU_ASSERT(semanage_user_get_roles(sh, user, &roles_arr, in test_user_roles()
378 CU_ASSERT(semanage_user_set_roles(sh, user, new_roles_arr, in test_user_roles()
381 CU_ASSERT(semanage_user_has_role(user, "new_role_r")); in test_user_roles()
382 CU_ASSERT(semanage_user_has_role(user, "new_my_role_r")); in test_user_roles()
384 CU_ASSERT(!semanage_user_has_role(user, "role_r")); in test_user_roles()
385 CU_ASSERT(!semanage_user_has_role(user, "my_role_r")); in test_user_roles()
387 semanage_user_del_role(user, "new_my_role_r"); in test_user_roles()
388 CU_ASSERT(semanage_user_get_num_roles(user) == 1); in test_user_roles()
390 semanage_user_del_role(user, "new_role_r"); in test_user_roles()
391 CU_ASSERT(semanage_user_get_num_roles(user) == 0); in test_user_roles()
394 semanage_user_free(user); in test_user_roles()
401 semanage_user_t *user = NULL; in test_user_create() local
407 CU_ASSERT(semanage_user_create(sh, &user) >= 0); in test_user_create()
408 CU_ASSERT(semanage_user_set_name(sh, user, "user_u") >= 0); in test_user_create()
409 CU_ASSERT(semanage_user_set_prefix(sh, user, "user") >= 0); in test_user_create()
410 CU_ASSERT(semanage_user_set_mlslevel(sh, user, "s0") >= 0); in test_user_create()
411 CU_ASSERT(semanage_user_set_mlsrange(sh, user, "s0-s15") >= 0); in test_user_create()
414 semanage_user_free(user); in test_user_create()
421 semanage_user_t *user = NULL; in test_user_clone() local
426 CU_ASSERT(semanage_user_create(sh, &user) >= 0); in test_user_clone()
427 CU_ASSERT(semanage_user_set_name(sh, user, "user_u") >= 0); in test_user_clone()
428 CU_ASSERT(semanage_user_set_prefix(sh, user, "user") >= 0); in test_user_clone()
429 CU_ASSERT(semanage_user_set_mlslevel(sh, user, "s0") >= 0); in test_user_clone()
430 CU_ASSERT(semanage_user_set_mlsrange(sh, user, "s0-s15") >= 0); in test_user_clone()
433 CU_ASSERT(semanage_user_clone(sh, user, &user_clone) >= 0); in test_user_clone()
434 CU_ASSERT_STRING_EQUAL(semanage_user_get_name(user), "user_u"); in test_user_clone()
435 CU_ASSERT_STRING_EQUAL(semanage_user_get_prefix(user), "user"); in test_user_clone()
436 CU_ASSERT_STRING_EQUAL(semanage_user_get_mlslevel(user), "s0"); in test_user_clone()
437 CU_ASSERT_STRING_EQUAL(semanage_user_get_mlsrange(user), "s0-s15"); in test_user_clone()
440 semanage_user_free(user); in test_user_clone()
448 semanage_user_t *user = NULL; in test_user_query() local
456 CU_ASSERT(semanage_user_query(sh, key, &user) >= 0); in test_user_query()
459 CU_ASSERT_PTR_NOT_NULL(user); in test_user_query()
462 semanage_user_free(user); in test_user_query()
557 semanage_user_t *user; in test_user_modify_del_query_local() local
563 user = get_user_nth(I_FIRST); in test_user_modify_del_query_local()
564 CU_ASSERT(semanage_user_key_extract(sh, user, &key) >= 0); in test_user_modify_del_query_local()
568 CU_ASSERT(semanage_user_modify_local(sh, key, user) >= 0); in test_user_modify_del_query_local()
580 semanage_user_free(user); in test_user_modify_del_query_local()
587 semanage_user_t *user = NULL; in test_user_exists_local() local
607 semanage_user_free(user); in test_user_exists_local()