diff options
author | Sage Weil <sage@inktank.com> | 2012-06-07 13:57:10 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-06-07 13:57:10 -0700 |
commit | 7332e9c717fb627d51efcaa3f31473a2c129e876 (patch) | |
tree | 1abcd11c1fff85d92817c674eaed933ac8e9bb2e /src/mon | |
parent | 809399776141c39a6495ec1d393bbc919b7d1ec1 (diff) | |
download | ceph-7332e9c717fb627d51efcaa3f31473a2c129e876.tar.gz |
mon: use mode 0600 throughout
Fixes: #2526
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/mon')
-rw-r--r-- | src/mon/MonitorStore.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mon/MonitorStore.cc b/src/mon/MonitorStore.cc index 5c6edefb9b9..ea4ac17cee8 100644 --- a/src/mon/MonitorStore.cc +++ b/src/mon/MonitorStore.cc @@ -174,7 +174,7 @@ void MonitorStore::put_int(version_t val, const char *a, const char *b) 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 << "': " @@ -308,7 +308,7 @@ int MonitorStore::write_bl_ss_impl(bufferlist& bl, const char *a, const char *b, 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: " @@ -317,7 +317,7 @@ int MonitorStore::write_bl_ss_impl(bufferlist& bl, const char *a, const char *b, } } 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; @@ -379,7 +379,7 @@ int MonitorStore::put_bl_sn_map(const char *a, 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; |