char tfn[1024];
snprintf(tfn, sizeof(tfn), "%s.new", fn);
- int fd = TEMP_FAILURE_RETRY(::open(tfn, O_WRONLY|O_CREAT, 0644));
+ int fd = TEMP_FAILURE_RETRY(::open(tfn, O_WRONLY|O_CREAT, 0600));
if (fd < 0) {
int err = errno;
derr << "MonitorStore::put_int: failed to open '" << tfn << "': "
int err = 0;
int fd;
if (append) {
- fd = ::open(fn, O_WRONLY|O_CREAT|O_APPEND, 0644);
+ fd = ::open(fn, O_WRONLY|O_CREAT|O_APPEND, 0600);
if (fd < 0) {
err = -errno;
derr << "failed to open " << fn << "for append: "
}
} else {
snprintf(tfn, sizeof(tfn), "%s.new", fn);
- fd = ::open(tfn, O_WRONLY|O_CREAT|O_TRUNC, 0644);
+ fd = ::open(tfn, O_WRONLY|O_CREAT|O_TRUNC, 0600);
if (fd < 0) {
err = -errno;
derr << "failed to open " << tfn << ": " << cpp_strerror(err) << dendl;
snprintf(fn, sizeof(fn), "%s/%llu", dfn, (long long unsigned)p->first);
snprintf(tfn, sizeof(tfn), "%s.new", fn);
- int fd = ::open(tfn, O_WRONLY|O_CREAT, 0644);
+ int fd = ::open(tfn, O_WRONLY|O_CREAT, 0600);
if (fd < 0) {
int err = -errno;
derr << "failed to open " << tfn << ": " << cpp_strerror(err) << dendl;