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
(This used to be commit
dd8ec8725f168f4286bbfc00d69cd56089ba3543)
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,
/* 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);