Lines Matching refs:label
47 int mac_smack_read(const char *path, SmackAttr attr, char **label) { in mac_smack_read() argument
50 assert(label); in mac_smack_read()
55 return getxattr_malloc(path, smack_attr_to_string(attr), label); in mac_smack_read()
58 int mac_smack_read_fd(int fd, SmackAttr attr, char **label) { in mac_smack_read_fd() argument
61 assert(label); in mac_smack_read_fd()
66 return fgetxattr_malloc(fd, smack_attr_to_string(attr), label); in mac_smack_read_fd()
69 int mac_smack_apply(const char *path, SmackAttr attr, const char *label) { in mac_smack_apply() argument
78 if (label) in mac_smack_apply()
79 r = lsetxattr(path, smack_attr_to_string(attr), label, strlen(label), 0); in mac_smack_apply()
88 int mac_smack_apply_fd(int fd, SmackAttr attr, const char *label) { in mac_smack_apply_fd() argument
97 if (label) in mac_smack_apply_fd()
98 … r = setxattr(FORMAT_PROC_FD_PATH(fd), smack_attr_to_string(attr), label, strlen(label), 0); in mac_smack_apply_fd()
107 int mac_smack_apply_pid(pid_t pid, const char *label) { in mac_smack_apply_pid() argument
111 assert(label); in mac_smack_apply_pid()
117 r = write_string_file(p, label, WRITE_STRING_FILE_DISABLE_BUFFER); in mac_smack_apply_pid()
125 const char *label; in smack_fix_fd() local
147 label = SMACK_STAR_LABEL; in smack_fix_fd()
149 label = SMACK_FLOOR_LABEL; in smack_fix_fd()
151 label = SMACK_STAR_LABEL; in smack_fix_fd()
155 if (setxattr(FORMAT_PROC_FD_PATH(fd), "security.SMACK64", label, strlen(label), 0) < 0) { in smack_fix_fd()
170 streq(old_label, label)) in smack_fix_fd()
241 _cleanup_free_ char *label = NULL; in mac_smack_copy() local
246 r = mac_smack_read(src, SMACK_ATTR_ACCESS, &label); in mac_smack_copy()
250 r = mac_smack_apply(dest, SMACK_ATTR_ACCESS, label); in mac_smack_copy()
262 int mac_smack_read(const char *path, SmackAttr attr, char **label) { in mac_smack_read() argument
266 int mac_smack_read_fd(int fd, SmackAttr attr, char **label) { in mac_smack_read_fd() argument
270 int mac_smack_apply(const char *path, SmackAttr attr, const char *label) { in mac_smack_apply() argument
274 int mac_smack_apply_fd(int fd, SmackAttr attr, const char *label) { in mac_smack_apply_fd() argument
278 int mac_smack_apply_pid(pid_t pid, const char *label) { in mac_smack_apply_pid() argument