Lines Matching refs:label
323 int mac_selinux_apply(const char *path, const char *label) { in mac_selinux_apply() argument
331 assert(label); in mac_selinux_apply()
333 if (setfilecon(path, label) < 0) in mac_selinux_apply()
334 …og_enforcing_errno(errno, "Failed to set SELinux security context %s on path %s: %m", label, path); in mac_selinux_apply()
339 int mac_selinux_apply_fd(int fd, const char *path, const char *label) { in mac_selinux_apply_fd() argument
347 assert(label); in mac_selinux_apply_fd()
349 if (setfilecon(FORMAT_PROC_FD_PATH(fd), label) < 0) in mac_selinux_apply_fd()
350 …rcing_errno(errno, "Failed to set SELinux security context %s on path %s: %m", label, strna(path)); in mac_selinux_apply_fd()
355 int mac_selinux_get_create_label_from_exe(const char *exe, char **label) { in mac_selinux_get_create_label_from_exe() argument
362 assert(label); in mac_selinux_get_create_label_from_exe()
379 return RET_NERRNO(security_compute_create_raw(mycon, fcon, sclass, label)); in mac_selinux_get_create_label_from_exe()
385 int mac_selinux_get_our_label(char **label) { in mac_selinux_get_our_label() argument
387 assert(label); in mac_selinux_get_our_label()
392 return RET_NERRNO(getcon_raw(label)); in mac_selinux_get_our_label()
398 …selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **label) { in mac_selinux_get_child_mls_label() argument
408 assert(label); in mac_selinux_get_child_mls_label()
454 return RET_NERRNO(security_compute_create_raw(mycon, fcon, sclass, label)); in mac_selinux_get_child_mls_label()
460 char* mac_selinux_free(char *label) { in mac_selinux_free() argument
463 freecon(label); in mac_selinux_free()
465 assert(!label); in mac_selinux_free()
535 int mac_selinux_create_file_prepare_label(const char *path, const char *label) { in mac_selinux_create_file_prepare_label() argument
538 if (!label) in mac_selinux_create_file_prepare_label()
544 if (setfscreatecon_raw(label) < 0) in mac_selinux_create_file_prepare_label()
545 …o(errno, "Failed to set specified SELinux security context '%s' for '%s': %m", label, strna(path)); in mac_selinux_create_file_prepare_label()
562 int mac_selinux_create_socket_prepare(const char *label) { in mac_selinux_create_socket_prepare() argument
565 assert(label); in mac_selinux_create_socket_prepare()
570 if (setsockcreatecon(label) < 0) in mac_selinux_create_socket_prepare()
571 …urn log_enforcing_errno(errno, "Failed to set SELinux security context %s for sockets: %m", label); in mac_selinux_create_socket_prepare()