[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-0pre2-450-g9c48ccb

Karolin Seeger kseeger at samba.org
Thu Apr 10 14:10:09 GMT 2008


The branch, v3-2-stable has been updated
       via  9c48ccb25eb7eb564ce18ea1bda51861488a7538 (commit)
       via  a5ef5ca119a151022435589ac310a798f71fd379 (commit)
      from  f68cca7c801fc52e41dcaaaa75fc07dcc87ad299 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable


- Log -----------------------------------------------------------------
commit 9c48ccb25eb7eb564ce18ea1bda51861488a7538
Author: Michael Adam <obnox at samba.org>
Date:   Thu Apr 10 11:53:53 2008 +0200

    winbindd: only call winbindd_validate_cache when not in offline logon mode.
    
    originally, the cache was cleared before calling validate, but
    this way, we skipt the validation of the database when not in
    offline logon mode.
    
    This is put into a new wrapper function winbindd_cache_validate_and_initialize()
    which is now called in winbindd.c instead calling validate and
    initialize functions separately.
    
    Michael
    (cherry picked from commit 641b5e3fecfce9581536de8daf6d7e6ecbefaf34)

commit a5ef5ca119a151022435589ac310a798f71fd379
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 16:38:14 2008 +0200

    winbindd: fix break out early condition in fill_grent_mem().
    
    if (!&new_glist) would always be skipped, if (new_glist == NULL) is
    what must have been meant...
    
    Michael
    (cherry picked from commit c1b60cdecff2a53f0a75a432a1ad7730eb734908)

-----------------------------------------------------------------------

Summary of changes:
 source/winbindd/winbindd.c       |   23 +++--------------------
 source/winbindd/winbindd_cache.c |   14 ++++++++++++++
 source/winbindd/winbindd_group.c |    2 +-
 3 files changed, 18 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/winbindd/winbindd.c b/source/winbindd/winbindd.c
index 25ceeeb..dbfd397 100644
--- a/source/winbindd/winbindd.c
+++ b/source/winbindd/winbindd.c
@@ -123,19 +123,7 @@ static void flush_caches(void)
 
 	if (!wcache_invalidate_cache()) {
 		DEBUG(0, ("invalidating the cache failed; revalidate the cache\n"));
-		/* Close the cache to be able to valdite the cache */
-		close_winbindd_cache();
-		/*
-		 * Ensure all cache and idmap caches are consistent
-		 * before we initialize the cache again.
-		 */
-		if (winbindd_validate_cache() < 0) {
-			DEBUG(0, ("winbindd cache tdb corrupt and no backup "
-				  "could be restore.\n"));
-		}
-
-		/* Initialize cache again. */
-		if (!initialize_winbindd_cache()) {
+		if (!winbindd_cache_validate_and_initialize()) {
 			exit(1);
 		}
 	}
@@ -1194,14 +1182,9 @@ int main(int argc, char **argv, char **envp)
 
 	/*
 	 * Ensure all cache and idmap caches are consistent
-	 * before we startup.
+	 * and initialized before we startup.
 	 */
-	if (winbindd_validate_cache() < 0) {
-		DEBUG(0, ("corrupted tdb found, trying to restore backup\n"));
-	}
-
-	/* Initialize cache (ensure version is correct). */
-	if (!initialize_winbindd_cache()) {
+	if (!winbindd_cache_validate_and_initialize()) {
 		exit(1);
 	}
 
diff --git a/source/winbindd/winbindd_cache.c b/source/winbindd/winbindd_cache.c
index 0f8bd49..f653172 100644
--- a/source/winbindd/winbindd_cache.c
+++ b/source/winbindd/winbindd_cache.c
@@ -3474,6 +3474,20 @@ int winbindd_validate_cache_nobackup(void)
 	return ret;
 }
 
+bool winbindd_cache_validate_and_initialize(void)
+{
+	close_winbindd_cache();
+
+	if (lp_winbind_offline_logon()) {
+		if (winbindd_validate_cache() < 0) {
+			DEBUG(0, ("winbindd cache tdb corrupt and no backup "
+				  "could be restored.\n"));
+		}
+	}
+
+	return initialize_winbindd_cache();
+}
+
 /*********************************************************************
  ********************************************************************/
 
diff --git a/source/winbindd/winbindd_group.c b/source/winbindd/winbindd_group.c
index 5dbd8c5..d5d3acc 100644
--- a/source/winbindd/winbindd_group.c
+++ b/source/winbindd/winbindd_group.c
@@ -567,7 +567,7 @@ static bool fill_grent_mem(struct winbindd_domain *domain,
 		/* If we have no more groups to expand, break out
 		   early */
 
-		if ( !&new_glist )
+		if (new_glist == NULL)
 			break;
 
 		/* One more round */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list