don't rely on the umask being right in ldb creation. Both Samba3 and
authortridge <tridge@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Wed, 27 Sep 2006 03:34:50 +0000 (03:34 +0000)
committertridge <tridge@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Wed, 27 Sep 2006 03:34:50 +0000 (03:34 +0000)
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

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_0@18939 0c0555d6-39d7-0310-84fc-f1cc0bd64818

source/lib/ldb/common/ldb.c
source/lib/ldb/ldb_tdb/ldb_tdb.c

index eca550f0f241e35befb37e60324d186cf889d8b3..00bf5e79babde837b6cea72e52d02e790617d167 100644 (file)
@@ -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,
index 8f676654a6540c635c060f3060f86ffe610170dc..5d4378390359077ff37a635de7a8809f7e89a431 100644 (file)
@@ -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);