[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-390-g1831042

Michael Adam obnox at samba.org
Sat Mar 22 01:37:45 GMT 2008


The branch, v3-2-test has been updated
       via  1831042bdcbfe569ae39177058dfe1d914416513 (commit)
       via  5aa3141bff35a85dd97e9fd339e19b0fe3a73afc (commit)
       via  f33095e44ba22f4451a5deeffdd4f9ed3f99ed85 (commit)
       via  81993db828bf11b13d7ee1f43483968dc6241bcc (commit)
       via  73b325fe7a9d7fd67ac9b99144a3776f5a1a9e15 (commit)
       via  f4d87fdbf266a36fbb50dae863ee0784165c2fe1 (commit)
      from  03e72e13076e3215eb8ae51cfb4e7cd3d3683d3e (commit)

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


- Log -----------------------------------------------------------------
commit 1831042bdcbfe569ae39177058dfe1d914416513
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 02:05:53 2008 +0100

    registry: add reg_init_basic() - init registry with only the db backend.
    
    Michael

commit 5aa3141bff35a85dd97e9fd339e19b0fe3a73afc
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 01:54:18 2008 +0100

    registry: close registry in exit path in registry_init_smbconf().
    
    Michael

commit f33095e44ba22f4451a5deeffdd4f9ed3f99ed85
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 01:53:44 2008 +0100

    registry: some whitespace cleanup in init_registry().
    
    Michael

commit 81993db828bf11b13d7ee1f43483968dc6241bcc
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 01:52:03 2008 +0100

    registry: remove unneeded talloc stackframe variable.
    
    Michael

commit 73b325fe7a9d7fd67ac9b99144a3776f5a1a9e15
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 01:49:21 2008 +0100

    registry: close regdb in error path (and use it) in init_registry().
    
    Michael

commit f4d87fdbf266a36fbb50dae863ee0784165c2fe1
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 23:50:49 2008 +0100

    registry: fix registry_init_smbconf() to close the registry at the end.
    
    Michael

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

Summary of changes:
 source/lib/smbconf/smbconf_reg.c                   |    2 -
 .../reg_init_basic.c}                              |   45 ++++++++-----------
 source/registry/reg_init_full.c                    |   26 +++++------
 source/registry/reg_init_smbconf.c                 |    1 +
 4 files changed, 32 insertions(+), 42 deletions(-)
 copy source/{lib/ldap_debug_handler.c => registry/reg_init_basic.c} (50%)


Changeset truncated at 500 lines:

diff --git a/source/lib/smbconf/smbconf_reg.c b/source/lib/smbconf/smbconf_reg.c
index 1f113c8..77e6233 100644
--- a/source/lib/smbconf/smbconf_reg.c
+++ b/source/lib/smbconf/smbconf_reg.c
@@ -418,8 +418,6 @@ static WERROR smbconf_reg_init(struct smbconf_ctx *ctx, const char *path)
 		werr = WERR_REG_IO_FAILURE;
 		goto done;
 	}
-	/* we know registry_init_smbconf() leaves registry open */
-	regdb_close();
 
 done:
 	return werr;
diff --git a/source/lib/ldap_debug_handler.c b/source/registry/reg_init_basic.c
similarity index 50%
copy from source/lib/ldap_debug_handler.c
copy to source/registry/reg_init_basic.c
index 2181ff0..13f3c93 100644
--- a/source/lib/ldap_debug_handler.c
+++ b/source/registry/reg_init_basic.c
@@ -1,6 +1,6 @@
 /*
  * Unix SMB/CIFS implementation.
- * Intercept libldap debug output.
+ * Registry helper routines
  * Copyright (C) Michael Adam 2008
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -19,34 +19,27 @@
 
 #include "includes.h"
 
-#if HAVE_LDAP
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_REGISTRY
 
-static void samba_ldap_log_print_fn(LDAP_CONST char *data)
+bool registry_init_basic(void)
 {
-	DEBUG(lp_ldap_debug_threshold(), ("[LDAP] %s", data));
-}
-
-#endif
-
-void init_ldap_debugging(void)
-{
-#if defined(HAVE_LDAP) && defined(HAVE_LBER_LOG_PRINT_FN)
-	int ret;
-	int ldap_debug_level = lp_ldap_debug_level();
-
-	ret = ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &ldap_debug_level);
-	if (ret != LDAP_OPT_SUCCESS) {
-		DEBUG(10, ("Error setting LDAP debug level.\n"));
+	int saved_errno = 0;
+
+	DEBUG(10, ("registry_init_basic called\n"));
+
+	if (!regdb_init()) {
+		saved_errno = errno;
+		DEBUG(1, ("Can't open the registry"));
+		if (saved_errno) {
+			DEBUGADD(1, (": %s", strerror(saved_errno)));
+		}
+		DEBUGADD(1, (".\n"));
+		return false;
 	}
+	regdb_close();
 
-	if (ldap_debug_level == 0) {
-		return;
-	}
+	reghook_cache_init();
 
-	ret = ber_set_option(NULL, LBER_OPT_LOG_PRINT_FN,
-			     (void *)samba_ldap_log_print_fn);
-	if (ret != LBER_OPT_SUCCESS) {
-		DEBUG(10, ("Error setting LBER log print function.\n"));
-	}
-#endif /* HAVE_LDAP && HAVE_LBER_LOG_PRINT_FN */
+	return true;
 }
diff --git a/source/registry/reg_init_full.c b/source/registry/reg_init_full.c
index 5c59c6b..ad245cb 100644
--- a/source/registry/reg_init_full.c
+++ b/source/registry/reg_init_full.c
@@ -61,30 +61,30 @@ REGISTRY_HOOK reg_hooks[] = {
  Open the registry database and initialize the REGISTRY_HOOK cache
  with all available backens.
  ***********************************************************************/
- 
+
 bool init_registry( void )
 {
 	int i;
 	bool ret = false;
-	TALLOC_CTX *frame = talloc_stackframe();
-	
-	
+
 	if ( !regdb_init() ) {
-		DEBUG(0,("init_registry: failed to initialize the registry tdb!\n"));
+		DEBUG(0, ("init_registry: failed to initialize the registry "
+			  "tdb!\n"));
 		goto fail;
 	}
 
 	/* setup the necessary keys and values */
 
 	if ( !init_registry_data() ) {
-		DEBUG(0,("regdb_init: Failed to initialize data in registry!\n"));
-		return false;
+		DEBUG(0, ("regdb_init: Failed to initialize data in "
+			  "registry!\n"));
+		goto fail;
 	}
 
 	/* build the cache tree of registry hooks */
-	
+
 	reghook_cache_init();
-	
+
 	for ( i=0; reg_hooks[i].keyname; i++ ) {
 		if ( !reghook_cache_add(&reg_hooks[i]) )
 			goto fail;
@@ -99,12 +99,10 @@ bool init_registry( void )
 	eventlog_init_keys();
 	perfcount_init_keys();
 
-	/* close and let each smbd open up as necessary */
+	ret = true;
 
+fail:
+	/* close and let each smbd open up as necessary */
 	regdb_close();
-
-	ret = true;
- fail:
-	TALLOC_FREE(frame);
 	return ret;
 }
diff --git a/source/registry/reg_init_smbconf.c b/source/registry/reg_init_smbconf.c
index 1b17852..f76cc2f 100644
--- a/source/registry/reg_init_smbconf.c
+++ b/source/registry/reg_init_smbconf.c
@@ -98,5 +98,6 @@ bool registry_init_smbconf(void)
 	ret = true;
 
 done:
+	regdb_close();
 	return ret;
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list