r3561: Since we have tdb_reopen_all() after all forks, the local_pid logic is not
authorVolker Lendecke <vlendec@samba.org>
Fri, 5 Nov 2004 21:55:21 +0000 (21:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:09 +0000 (10:53 -0500)
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
(This used to be commit 40cad9dcc14ddec0ce74bb9010d13bd82e4d10af)

source3/groupdb/mapping.c
source3/lib/account_pol.c

index d189f447d08967fd128ac10efee58409b00b9f45..50064415f9c7a91b22cd9594315c423364af979b 100644 (file)
@@ -135,11 +135,10 @@ static BOOL default_group_mapping(void)
 
 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) {
@@ -147,8 +146,6 @@ static BOOL init_group_mapping(void)
                return False;
        }
 
-       local_pid = sys_getpid();
-
        /* handle a Samba upgrade */
        tdb_lock_bystring(tdb, vstring, 0);
 
index 8d5b963da28f8f948e43a36c25f41d29ab6aa899..c8507f722d110cf012983bd528d2bf3c59140c95 100644 (file)
@@ -30,11 +30,10 @@ static TDB_CONTEXT *tdb; /* used for driver files */
 
 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 @@ BOOL init_account_policy(void)
                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) {