Lines Matching full:path
32 #include "path-util.h"
138 int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
144 assert(path);
150 r = lstat(path, &st);
154 r = selabel_lookup_raw(label_hnd, &fcon, path, st.st_mode);
161 r = lsetfilecon(path, fcon);
177 log_enforcing("Unable to fix SELinux security context of %s: %m", path);
186 int mac_selinux_apply(const char *path, const char *label) {
189 assert(path);
195 if (setfilecon(path, (security_context_t) label) < 0) {
196 log_enforcing("Failed to set SELinux security context %s on path %s: %m", label, path);
323 int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
329 assert(path);
334 if (path_is_absolute(path))
335 r = selabel_lookup_raw(label_hnd, &filecon, path, mode);
339 newpath = path_make_absolute_cwd(path);
355 log_enforcing("Failed to set SELinux security context %s for %s: %m", filecon, path);
410 int mac_selinux_mkdir(const char *path, mode_t mode) {
418 assert(path);
423 if (path_is_absolute(path))
424 r = selabel_lookup_raw(label_hnd, &fcon, path, S_IFDIR);
428 newpath = path_make_absolute_cwd(path);
439 log_enforcing("Failed to set SELinux security context %s for %s: %m", fcon, path);
447 r = mkdir(path, mode);
457 return mkdir(path, mode) < 0 ? -errno : 0;
467 char *path;
490 path = strndupa(un->sun_path, addrlen - offsetof(struct sockaddr_un, sun_path));
492 if (path_is_absolute(path))
493 r = selabel_lookup_raw(label_hnd, &fcon, path, S_IFSOCK);
497 newpath = path_make_absolute_cwd(path);
508 log_enforcing("Failed to set SELinux security context %s for %s: %m", fcon, path);