summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-27 03:34:50 +0000
committerAndrew Tridgell <tridge@samba.org>2006-09-27 03:34:50 +0000
commitb83ffaf38462e52bf6547f07539e945573d3dbb0 (patch)
tree4711ee647769bd59cb967882d72848d024a2d351
parent4faaf5cd75745d01194238926868492b5d8fb6d4 (diff)
downloadsamba-b83ffaf38462e52bf6547f07539e945573d3dbb0.tar.gz
samba-b83ffaf38462e52bf6547f07539e945573d3dbb0.tar.xz
samba-b83ffaf38462e52bf6547f07539e945573d3dbb0.zip
r18939: don't rely on the umask being right in ldb creation. Both Samba3 and
Samba4 smbd force the umask to 0, which meant we ended up with ldb being world writable. This isn't really an ideal fix, as it means ldb no longer honors umask (as it should do, like all good libraries). Unfortunately the 'proper' fix is too complex for now this also merges a tiny code style fix from s4 to s3
-rw-r--r--source/lib/ldb/common/ldb.c4
-rw-r--r--source/lib/ldb/ldb_tdb/ldb_tdb.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/source/lib/ldb/common/ldb.c b/source/lib/ldb/common/ldb.c
index eca550f0f24..00bf5e79bab 100644
--- a/source/lib/ldb/common/ldb.c
+++ b/source/lib/ldb/common/ldb.c
@@ -819,7 +819,9 @@ int ldb_modify(struct ldb_context *ldb,
int ret;
ret = ldb_msg_sanity_check(ldb, message);
- if (ret != LDB_SUCCESS) return ret;
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
ret = ldb_build_mod_req(&req, ldb, ldb,
message,
diff --git a/source/lib/ldb/ldb_tdb/ldb_tdb.c b/source/lib/ldb/ldb_tdb/ldb_tdb.c
index 8f676654a65..5d437839035 100644
--- a/source/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -1036,7 +1036,7 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
/* note that we use quite a large default hash size */
ltdb->tdb = ltdb_wrap_open(ltdb, path, 10000,
- tdb_flags, open_flags, 0666, ldb);
+ tdb_flags, open_flags, 0644, ldb);
if (!ltdb->tdb) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "Unable to open tdb '%s'\n", path);
talloc_free(ltdb);