• Home
  • Raw
  • Download

Lines Matching refs:handle

21 static char *semanage_user_roles(semanage_handle_t * handle, const char *sename) {  in semanage_user_roles()  argument
29 if (semanage_user_key_create(handle, sename, &key) >= 0) { in semanage_user_roles()
30 if (semanage_user_query(handle, key, &user) >= 0) { in semanage_user_roles()
31 if (semanage_user_get_roles(handle, in semanage_user_roles()
58 static int semanage_seuser_audit(semanage_handle_t * handle, in semanage_seuser_audit() argument
78 proles = semanage_user_roles(handle, psename); in semanage_seuser_audit()
84 roles = semanage_user_roles(handle, sename); in semanage_seuser_audit()
123 int semanage_seuser_modify_local(semanage_handle_t * handle, in semanage_seuser_modify_local() argument
128 void *callback = (void *) handle->msg_callback; in semanage_seuser_modify_local()
129 dbase_config_t *dconfig = semanage_seuser_dbase_local(handle); in semanage_seuser_modify_local()
139 rc = semanage_seuser_clone(handle, data, &new); in semanage_seuser_modify_local()
144 if (!mls_range && semanage_mls_enabled(handle)) { in semanage_seuser_modify_local()
147 rc = semanage_user_key_create(handle, sename, &ukey); in semanage_seuser_modify_local()
151 rc = semanage_user_query(handle, ukey, &u); in semanage_seuser_modify_local()
155 rc = semanage_seuser_set_mlsrange(handle, new, mls_range); in semanage_seuser_modify_local()
162 handle->msg_callback = NULL; in semanage_seuser_modify_local()
163 (void) semanage_seuser_query(handle, key, &previous); in semanage_seuser_modify_local()
164 handle->msg_callback = callback; in semanage_seuser_modify_local()
165 rc = dbase_modify(handle, dconfig, key, new); in semanage_seuser_modify_local()
166 if (semanage_seuser_audit(handle, new, previous, AUDIT_ROLE_ASSIGN, rc == 0) < 0) in semanage_seuser_modify_local()
175 int semanage_seuser_del_local(semanage_handle_t * handle, in semanage_seuser_del_local() argument
180 dbase_config_t *dconfig = semanage_seuser_dbase_local(handle); in semanage_seuser_del_local()
181 rc = dbase_del(handle, dconfig, key); in semanage_seuser_del_local()
182 semanage_seuser_query(handle, key, &seuser); in semanage_seuser_del_local()
183 if (semanage_seuser_audit(handle, NULL, seuser, AUDIT_ROLE_REMOVE, rc == 0) < 0) in semanage_seuser_del_local()
190 int semanage_seuser_query_local(semanage_handle_t * handle, in semanage_seuser_query_local() argument
195 dbase_config_t *dconfig = semanage_seuser_dbase_local(handle); in semanage_seuser_query_local()
196 return dbase_query(handle, dconfig, key, response); in semanage_seuser_query_local()
199 int semanage_seuser_exists_local(semanage_handle_t * handle, in semanage_seuser_exists_local() argument
204 dbase_config_t *dconfig = semanage_seuser_dbase_local(handle); in semanage_seuser_exists_local()
205 return dbase_exists(handle, dconfig, key, response); in semanage_seuser_exists_local()
208 int semanage_seuser_count_local(semanage_handle_t * handle, in semanage_seuser_count_local() argument
212 dbase_config_t *dconfig = semanage_seuser_dbase_local(handle); in semanage_seuser_count_local()
213 return dbase_count(handle, dconfig, response); in semanage_seuser_count_local()
216 int semanage_seuser_iterate_local(semanage_handle_t * handle, in semanage_seuser_iterate_local() argument
222 dbase_config_t *dconfig = semanage_seuser_dbase_local(handle); in semanage_seuser_iterate_local()
223 return dbase_iterate(handle, dconfig, handler, handler_arg); in semanage_seuser_iterate_local()
227 int semanage_seuser_list_local(semanage_handle_t * handle, in semanage_seuser_list_local() argument
232 dbase_config_t *dconfig = semanage_seuser_dbase_local(handle); in semanage_seuser_list_local()
233 return dbase_list(handle, dconfig, records, count); in semanage_seuser_list_local()
237 semanage_handle_t *handle; member
250 semanage_handle_t *handle = arg->handle; in validate_handler() local
260 if (semanage_user_key_create(handle, sename, &key) < 0) in validate_handler()
262 if (semanage_user_exists(handle, key, &exists) < 0) in validate_handler()
265 ERR(handle, "selinux user %s does not exist", sename); in validate_handler()
273 if (semanage_user_query(handle, key, &user) < 0) in validate_handler()
277 if (sepol_mls_check(handle->sepolh, policydb, mls_range) < 0) in validate_handler()
279 if (sepol_mls_contains(handle->sepolh, policydb, in validate_handler()
284 ERR(handle, "MLS range %s for Unix user %s " in validate_handler()
291 ERR(handle, "MLS is disabled, but MLS range %s " in validate_handler()
301 ERR(handle, "could not check if seuser mapping for %s is valid", name); in validate_handler()
308 ERR(handle, "seuser mapping [%s -> (%s, %s)] is invalid", in validate_handler()
311 ERR(handle, "seuser mapping [%s -> %s] is invalid", in validate_handler()
322 int semanage_seuser_validate_local(semanage_handle_t * handle, in semanage_seuser_validate_local() argument
327 arg.handle = handle; in semanage_seuser_validate_local()
329 return semanage_seuser_iterate_local(handle, validate_handler, &arg); in semanage_seuser_validate_local()