Commit d3ee99f7 authored by Philip Pronin's avatar Philip Pronin Committed by Dave Watson

use 0666 as the default permissions for new files

Summary: Seems like there is no real need to restrict permissions by default?

Test Plan: fbconfig -r folly/test && fbmake runtests_opt

@override-unit-failures

Reviewed By: tudorb@fb.com

FB internal diff: D1205527
parent 44c12101
......@@ -43,7 +43,7 @@ class File {
/**
* Open and create a file object. Throws on error.
*/
explicit File(const char* name, int flags = O_RDONLY, mode_t mode = 0644);
explicit File(const char* name, int flags = O_RDONLY, mode_t mode = 0666);
~File();
......
......@@ -37,7 +37,7 @@ namespace folly {
* until all data is written. Note that *Full wrappers weaken the thread
* semantics of underlying system calls.
*/
int openNoInt(const char* name, int flags, mode_t mode=0644);
int openNoInt(const char* name, int flags, mode_t mode = 0666);
int closeNoInt(int fd);
int dupNoInt(int fd);
int dup2NoInt(int oldfd, int newfd);
......
......@@ -51,7 +51,7 @@ TemporaryFile::TemporaryFile(StringPiece namePrefix,
closeOnDestruction_(closeOnDestruction),
fd_(-1),
path_(generateUniquePath(std::move(dir), namePrefix)) {
fd_ = open(path_.c_str(), O_RDWR | O_CREAT | O_EXCL, 0644);
fd_ = open(path_.c_str(), O_RDWR | O_CREAT | O_EXCL, 0666);
checkUnixError(fd_, "open failed");
if (scope_ == Scope::UNLINK_IMMEDIATELY) {
......
......@@ -81,7 +81,7 @@ void testTemporaryDirectory(TemporaryDirectory::Scope scope) {
EXPECT_TRUE(fs::is_directory(path));
fs::path fp = path / "bar";
int fd = open(fp.c_str(), O_RDWR | O_CREAT | O_TRUNC, 0644);
int fd = open(fp.c_str(), O_RDWR | O_CREAT | O_TRUNC, 0666);
EXPECT_NE(fd, -1);
close(fd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment