Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set file creation to default to respect umask #235

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions util/FileCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int FileCreator::openExistingFile(ThreadCtx &threadCtx,
int res;
{
PerfStatCollector statCollector(threadCtx, PerfStatReport::FILE_OPEN);
res = open(path.c_str(), openFlags, 0644);
res = open(path.c_str(), openFlags, 0666);
}
if (res < 0) {
WPLOG(ERROR) << "failed opening file " << path;
Expand Down Expand Up @@ -263,7 +263,7 @@ int FileCreator::createFile(ThreadCtx &threadCtx, const string &relPathStr) {
int res;
{
PerfStatCollector statCollector(threadCtx, PerfStatReport::FILE_OPEN);
res = open(path.c_str(), openFlags, 0644);
res = open(path.c_str(), openFlags, 0666);
}
if (res < 0) {
if (dir.empty()) {
Expand All @@ -284,7 +284,7 @@ int FileCreator::createFile(ThreadCtx &threadCtx, const string &relPathStr) {
}
{
PerfStatCollector statCollector(threadCtx, PerfStatReport::FILE_OPEN);
res = open(path.c_str(), openFlags, 0644);
res = open(path.c_str(), openFlags, 0666);
}
if (res < 0) {
WPLOG(ERROR) << "failed creating file " << path;
Expand Down
2 changes: 1 addition & 1 deletion util/TransferLogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ ErrorCode TransferLogManager::openLog() {
} else {
// creation of the log path (which can still be a race)
WLOG(INFO) << logPath << " doesn't exist... creating...";
fd_ = ::open(logPath.c_str(), O_CREAT | O_EXCL, 0644);
fd_ = ::open(logPath.c_str(), O_CREAT | O_EXCL, 0666);
if (fd_ < 0) {
WPLOG(WARNING) << "Could not create wdt log (maybe ok if race): "
<< logPath;
Expand Down