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
/**
* 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();
* 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);
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) {
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);