Restrict zram_writeback permission

Bug: 74582279
Bug: 122659265
Test: Build
Change-Id: Iba610929bc02d7ee5a590f8ec5b440269dbc12f5
This commit is contained in:
Wei Wang 2019-02-01 11:53:58 -08:00
parent 0d78bfbc09
commit aa25756426

View file

@ -1446,7 +1446,7 @@ static bool PrepareZramDevice(const std::string& loop, off64_t size, const std::
}
// Prepare target path
unique_fd target_fd(TEMP_FAILURE_RETRY(open(loop.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0664)));
unique_fd target_fd(TEMP_FAILURE_RETRY(open(loop.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0600)));
if (target_fd.get() == -1) {
PERROR << "Cannot open target path: " << loop;
return false;