svn commit: samba r19182 - in branches/SAMBA_3_0/source/lib/ldb: common include ldb_tdb

metze at samba.org metze at samba.org
Mon Oct 9 07:05:09 GMT 2006


Author: metze
Date: 2006-10-09 07:05:08 +0000 (Mon, 09 Oct 2006)
New Revision: 19182

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

Log:
merge from samba4:

add ldb_set_create_perms() function to set the create_perms after
ldb_init() and before ldb_connect()

metze
Modified:
   branches/SAMBA_3_0/source/lib/ldb/common/ldb.c
   branches/SAMBA_3_0/source/lib/ldb/include/ldb.h
   branches/SAMBA_3_0/source/lib/ldb/include/ldb_private.h
   branches/SAMBA_3_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-10-09 06:48:55 UTC (rev 19181)
+++ branches/SAMBA_3_0/source/lib/ldb/common/ldb.c	2006-10-09 07:05:08 UTC (rev 19182)
@@ -52,6 +52,7 @@
 	}
 
 	ldb_set_utf8_default(ldb);
+	ldb_set_create_perms(ldb, 0666);
 
 	return ldb;
 }
@@ -455,6 +456,16 @@
 	return LDB_SUCCESS;
 }
 
+
+/* 
+   set the permissions for new files to be passed to open() in
+   backends that use local files
+ */
+void ldb_set_create_perms(struct ldb_context *ldb, unsigned int perms)
+{
+	ldb->create_perms = perms;
+}
+
 /*
   start an ldb request
   NOTE: the request must be a talloc context.

Modified: branches/SAMBA_3_0/source/lib/ldb/include/ldb.h
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/include/ldb.h	2006-10-09 06:48:55 UTC (rev 19181)
+++ branches/SAMBA_3_0/source/lib/ldb/include/ldb.h	2006-10-09 07:05:08 UTC (rev 19182)
@@ -781,6 +781,7 @@
 
 int ldb_set_timeout(struct ldb_context *ldb, struct ldb_request *req, int timeout);
 int ldb_set_timeout_from_prev_req(struct ldb_context *ldb, struct ldb_request *oldreq, struct ldb_request *newreq);
+void ldb_set_create_perms(struct ldb_context *ldb, unsigned int perms);
 
 /**
   Initialise ldbs' global information

Modified: branches/SAMBA_3_0/source/lib/ldb/include/ldb_private.h
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/include/ldb_private.h	2006-10-09 06:48:55 UTC (rev 19181)
+++ branches/SAMBA_3_0/source/lib/ldb/include/ldb_private.h	2006-10-09 07:05:08 UTC (rev 19182)
@@ -119,6 +119,8 @@
 	int default_timeout;
 
 	unsigned int flags;
+
+	unsigned int create_perms;
 };
 
 #ifndef ARRAY_SIZE

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-10-09 06:48:55 UTC (rev 19181)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-10-09 07:05:08 UTC (rev 19182)
@@ -1042,7 +1042,8 @@
 
 	/* note that we use quite a large default hash size */
 	ltdb->tdb = ltdb_wrap_open(ltdb, path, 10000, 
-				   tdb_flags, open_flags, 0644, ldb);
+				   tdb_flags, open_flags, 
+				   ldb->create_perms, 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