svn commit: samba r3562 - in trunk/source: groupdb lib

vlendec at samba.org vlendec at samba.org
Fri Nov 5 21:55:45 GMT 2004


Author: vlendec
Date: 2004-11-05 21:55:45 +0000 (Fri, 05 Nov 2004)
New Revision: 3562

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

Log:
Since we have tdb_reopen_all() after all forks, the local_pid logic is not
correct anymore. If we actually open the tdb before the fork, we end up
opening the tdb twice. Jerry, jra, this also happens in the locking and
printing subsystems. You might want to check it there (not that it actually
happens right now, but this gave me some confusion lately...).

Volker

Modified:
   trunk/source/groupdb/mapping.c
   trunk/source/lib/account_pol.c


Changeset:
Modified: trunk/source/groupdb/mapping.c
===================================================================
--- trunk/source/groupdb/mapping.c	2004-11-05 21:55:21 UTC (rev 3561)
+++ trunk/source/groupdb/mapping.c	2004-11-05 21:55:45 UTC (rev 3562)
@@ -124,11 +124,10 @@
 
 static BOOL init_group_mapping(void)
 {
-	static pid_t local_pid;
 	const char *vstring = "INFO/version";
 	int32 vers_id;
 	
-	if (tdb && local_pid == sys_getpid())
+	if (tdb)
 		return True;
 	tdb = tdb_open_log(lock_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
 	if (!tdb) {
@@ -136,8 +135,6 @@
 		return False;
 	}
 
-	local_pid = sys_getpid();
-
 	/* handle a Samba upgrade */
 	tdb_lock_bystring(tdb, vstring, 0);
 

Modified: trunk/source/lib/account_pol.c
===================================================================
--- trunk/source/lib/account_pol.c	2004-11-05 21:55:21 UTC (rev 3561)
+++ trunk/source/lib/account_pol.c	2004-11-05 21:55:45 UTC (rev 3562)
@@ -30,11 +30,10 @@
 
 BOOL init_account_policy(void)
 {
-	static pid_t local_pid;
 	const char *vstring = "INFO/version";
 	uint32 version;
 
-	if (tdb && local_pid == sys_getpid())
+	if (tdb)
 		return True;
 	tdb = tdb_open_log(lock_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
 	if (!tdb) {
@@ -42,8 +41,6 @@
 		return False;
 	}
 
-	local_pid = sys_getpid();
-
 	/* handle a Samba upgrade */
 	tdb_lock_bystring(tdb, vstring,0);
 	if (!tdb_fetch_uint32(tdb, vstring, &version) || version != DATABASE_VERSION) {



More information about the samba-cvs mailing list