[core] Ensure permission when zygote starts (#86)

This commit is contained in:
LoveSy 2021-02-06 18:38:26 +08:00 committed by GitHub
parent 8e73f0822b
commit 7acf4493ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -251,10 +251,11 @@ namespace lspd {
}
fs::permissions(log_path,
fs::perms::owner_all | fs::perms::group_all | fs::perms::others_all);
fs::permissions(modules_log_path,
fs::perms::owner_read | fs::perms::owner_write | fs::perms::group_read |
fs::perms::group_write | fs::perms::others_read |
fs::perms::others_write);
recursive_permissions(log_path,
fs::perms::owner_read | fs::perms::owner_write |
fs::perms::group_read |
fs::perms::group_write | fs::perms::others_read |
fs::perms::others_write, fs::perm_options::add);
} catch (const fs::filesystem_error &e) {
LOGE("init: %s", e.what());
return false;
@ -297,7 +298,8 @@ namespace lspd {
fs::permissions(variant, fs::perms::owner_all | fs::perms::group_all);
path_chown(variant, uid, 1000u);
auto disable_verbose_log = misc_path_ / "disable_verbose_log";
fs::permissions(disable_verbose_log, fs::perms::owner_all | fs::perms::group_all);
fs::permissions(disable_verbose_log,
fs::perms::owner_all | fs::perms::group_all);
path_chown(disable_verbose_log, uid, 1000u);
}