summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-08-06 16:35:43 +1000
committerMichael Adam <obnox@samba.org>2008-08-06 10:51:04 +0200
commitf8534d5c78bf98a54e918aa62f5cea812483f17a (patch)
treea2eaaf11905169f01939982f498318634f3021e1 /source3/lib
parent8fed76b73e3576ef2279c0ff6c8bc393010443e0 (diff)
downloadsamba-f8534d5c78bf98a54e918aa62f5cea812483f17a.tar.gz
samba-f8534d5c78bf98a54e918aa62f5cea812483f17a.tar.bz2
samba-f8534d5c78bf98a54e918aa62f5cea812483f17a.zip
fixed permissions on ctdb databases
(This used to be commit 123fc3980a83d956bffaa689f3af81bbf81ce1c1)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap_ctdb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index a66ea7ceb5..cb4c573eb0 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -488,6 +488,11 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
/* only pass through specific flags */
tdb_flags &= TDB_SEQNUM;
+ /* honor permissions if user has specified O_CREAT */
+ if (open_flags & O_CREAT) {
+ chmod(db_path, mode);
+ }
+
db_ctdb->wtdb = tdb_wrap_open(db_ctdb, db_path, hash_size, tdb_flags, O_RDWR, 0);
if (db_ctdb->wtdb == NULL) {
DEBUG(0, ("Could not open tdb %s: %s\n", db_path, strerror(errno)));