From 53151468ccc775498e6944242f1822d5a482bc00 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 6 Aug 2008 16:35:43 +1000 Subject: [PATCH] fixed permissions on ctdb databases (cherry picked from commit 123fc3980a83d956bffaa689f3af81bbf81ce1c1) (cherry picked from commit 61274204b63cf077a826671a9e0d807bd17dfec3) --- source/lib/dbwrap_ctdb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/lib/dbwrap_ctdb.c b/source/lib/dbwrap_ctdb.c index a66ea7ceb59..cb4c573eb06 100644 --- a/source/lib/dbwrap_ctdb.c +++ b/source/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))); -- 2.11.4.GIT