}
static void set_ownership_and_perms(std::string_view src_path, std::string_view dest_path, const mode_t mode,
- const int session_uid, const int gid, Directory_Class type)
+ const int session_uid, const int gid, bool copy_perms_from_skel)
{
struct stat info;
int ret = lstat(src_path.data(), &info);
/* Symlinks don't have permissions, and we
* don't want to change the underlying file's. */
if (!S_ISLNK(info.st_mode))
- change_permissions(dest_path, should_copy_perms_from_skel(type) ? info.st_mode : mode);
+ change_permissions(dest_path, copy_perms_from_skel ? info.st_mode : mode);
}
static std::string get_smack_label(std::string_view src_path, smack_label_type type)
break;
}
- set_ownership_and_perms(s_path, d_path, mode, session_uid, gid, dir_type);
+ set_ownership_and_perms(s_path, d_path, mode, session_uid, gid, should_copy_perms_from_skel(dir_type));
copy_smack_attributes(s_path, d_path);
}