svn commit: samba r18939 - in branches: SAMBA_3_0/source/lib/ldb/common SAMBA_3_0/source/lib/ldb/ldb_tdb SAMBA_4_0/source/lib/ldb/ldb_tdb

tridge at samba.org tridge at samba.org
Wed Sep 27 03:34:51 GMT 2006


Author: tridge
Date: 2006-09-27 03:34:50 +0000 (Wed, 27 Sep 2006)
New Revision: 18939

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18939

Log:
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


Modified:
   branches/SAMBA_3_0/source/lib/ldb/common/ldb.c
   branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/ldb/common/ldb.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/common/ldb.c	2006-09-27 03:29:38 UTC (rev 18938)
+++ branches/SAMBA_3_0/source/lib/ldb/common/ldb.c	2006-09-27 03:34:50 UTC (rev 18939)
@@ -819,7 +819,9 @@
 	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,

Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-09-27 03:29:38 UTC (rev 18938)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-09-27 03:34:50 UTC (rev 18939)
@@ -1036,7 +1036,7 @@
 
 	/* 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);

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-09-27 03:29:38 UTC (rev 18938)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-09-27 03:34:50 UTC (rev 18939)
@@ -1036,7 +1036,7 @@
 
 	/* 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);



More information about the samba-cvs mailing list