The branch, v3-2-test has been updated
       via  737e470e02d1233fda51e903f27955e45427e95a (commit)
       via  8b2cc36ffcb3bccb760ec7cb0a22558eab56070d (commit)
       via  a39807044879ad9df7614e010db6ea16b51000a0 (commit)
       via  ce943aeb581027daf813528481b44177d391b61d (commit)
       via  b942ff6b7f0be4898e05525558b354533dea312b (commit)
       via  32bfd131e33d06be9dfaef02b57f5401d2bc7639 (commit)
       via  05eda1252572f310499b28123d0f9e4211b7d54c (commit)
       via  0a619d4dc476c945130fe47126d98cd47b39c34d (commit)
       via  288495ec1a9b0c37bb3f98043f8f8dd946072bac (commit)
       via  4ac52a5a1dfe8f4f22e960db2e4ca99f9e262427 (commit)
      from  1de05f1a87fcea598021ca485d3ed87005a3be68 (commit)

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


- Log -----------------------------------------------------------------
commit 737e470e02d1233fda51e903f27955e45427e95a
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Wed Mar 12 02:12:11 2008 +0100

    init_srv_share_info_ctr: fix counting of services.
    
    The number of services was recorded too early leading to
    registry shares not showing up in browse lists.
    
    Guenther - please check.
    
    Michael

commit 8b2cc36ffcb3bccb760ec7cb0a22558eab56070d
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Wed Mar 12 02:10:35 2008 +0100

    init_srv_share_info_ctr: Add debug messages.
    
    Michael

commit a39807044879ad9df7614e010db6ea16b51000a0
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Wed Mar 12 02:07:37 2008 +0100

    Add a debug message.
    
    Michael

commit ce943aeb581027daf813528481b44177d391b61d
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Wed Mar 12 01:03:26 2008 +0100

    loadparm: add a debug message.
    
    Michael

commit b942ff6b7f0be4898e05525558b354533dea312b
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Wed Mar 12 00:56:33 2008 +0100

    loadparm: remove services read from smb.conf when starting over for config 
backend registry.
    
    Michael

commit 32bfd131e33d06be9dfaef02b57f5401d2bc7639
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Wed Mar 12 00:54:48 2008 +0100

    loadparm: add convenience wrapper lp_kill_all_services()
    
    Michael

commit 05eda1252572f310499b28123d0f9e4211b7d54c
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Wed Mar 12 00:43:19 2008 +0100

    loadparm: add a comment
    
    Michael

commit 0a619d4dc476c945130fe47126d98cd47b39c34d
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Wed Mar 12 00:42:06 2008 +0100

    loadparm: fix a comment typo.
    
    Michael

commit 288495ec1a9b0c37bb3f98043f8f8dd946072bac
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Tue Mar 11 12:41:20 2008 +0100

    loadparm: add utility function to check for config backend file.
    
    Michael

commit 4ac52a5a1dfe8f4f22e960db2e4ca99f9e262427
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Tue Mar 11 12:36:18 2008 +0100

    loadparm: use a function to check for the registry config backend.
    
    Michael

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

Summary of changes:
 source/param/loadparm.c           |   30 +++++++++++++++++++++++++-----
 source/rpc_server/srv_srvsvc_nt.c |    6 +++++-
 source/smbd/service.c             |    1 +
 source/web/swat.c                 |    2 +-
 4 files changed, 32 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index aaeafac..e144c03 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -6586,6 +6586,14 @@ bool lp_config_backend_is_registry(void)
        return (lp_config_backend() == CONFIG_BACKEND_REGISTRY);
 }
 
+/**
+ * Utility function to check if the config backend is FILE.
+ */
+bool lp_config_backend_is_file(void)
+{
+       return (lp_config_backend() == CONFIG_BACKEND_FILE);
+}
+
 /*******************************************************************
  Check if a config file has changed date.
 ********************************************************************/
@@ -6596,7 +6604,7 @@ bool lp_file_list_changed(void)
 
        DEBUG(6, ("lp_file_list_changed()\n"));
 
-       if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) {
+       if (lp_config_backend_is_registry()) {
                uint64_t conf_cur_seqnum;
                if (conf_ctx == NULL) {
                        WERROR werr;
@@ -7736,6 +7744,14 @@ void lp_killunused(bool (*snumused) (int))
        }
 }
 
+/**
+ * Kill all except autoloaded and usershare services - convenience wrapper
+ */
+void lp_kill_all_services(void)
+{
+       lp_killunused(NULL);
+}
+
 /***************************************************************************
  Unload a service.
 ***************************************************************************/
@@ -8666,7 +8682,7 @@ bool lp_load(const char *pszFname,
                Globals.param_opt = NULL;
        }
 
-       if (lp_config_backend() == CONFIG_BACKEND_FILE) {
+       if (lp_config_backend_is_file()) {
                n2 = alloc_sub_basic(get_current_username(),
                                        current_user_info.domain,
                                        pszFname);
@@ -8689,20 +8705,24 @@ bool lp_load(const char *pszFname,
                        }
                }
 
-               if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) {
+               if (lp_config_backend_is_registry()) {
+                       /* config backend changed to registry in config file */
                        /*
                         * We need to use this extra global variable here to
-                        * survive restart: init_globals usese this as a default
+                        * survive restart: init_globals uses this as a default
                         * for ConfigBackend. Otherwise, init_globals would
                         *  send us into an endless loop here.
                         */
                        config_backend = CONFIG_BACKEND_REGISTRY;
                        /* start over */
+                       DEBUG(1, ("lp_load: changing to config backend "
+                                 "registry\n"));
                        init_globals(false);
+                       lp_kill_all_services();
                        return lp_load(pszFname, global_only, save_defaults,
                                       add_ipc, initialize_globals);
                }
-       } else if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) {
+       } else if (lp_config_backend_is_registry()) {
                bRetval = process_registry_globals(do_parameter);
        } else {
                DEBUG(0, ("Illegal config  backend given: %d\n",
diff --git a/source/rpc_server/srv_srvsvc_nt.c 
b/source/rpc_server/srv_srvsvc_nt.c
index 6421efd..56d3159 100644
--- a/source/rpc_server/srv_srvsvc_nt.c
+++ b/source/rpc_server/srv_srvsvc_nt.c
@@ -498,14 +498,18 @@ static WERROR init_srv_share_info_ctr(pipes_struct *p,
 
        /* Ensure all the usershares are loaded. */
        become_root();
-       num_services = load_usershare_shares();
+       load_usershare_shares();
        load_registry_shares();
+       num_services = lp_numservices();
        unbecome_root();
 
        /* Count the number of entries. */
        for (snum = 0; snum < num_services; snum++) {
                if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || 
!is_hidden_share(snum)) ) {
+                       DEBUG(10, ("counting service %s\n", 
lp_servicename(snum)));
                        num_entries++;
+               } else {
+                       DEBUG(10, ("NOT counting service %s\n", 
lp_servicename(snum)));
                }
        }
 
diff --git a/source/smbd/service.c b/source/smbd/service.c
index 8b73f68..33b2cb2 100644
--- a/source/smbd/service.c
+++ b/source/smbd/service.c
@@ -295,6 +295,7 @@ void load_registry_shares(void)
        WERROR err;
        int i;
 
+       DEBUG(8, ("load_registry_shares()\n"));
        if (!lp_registry_shares()) {
                return;
        }
diff --git a/source/web/swat.c b/source/web/swat.c
index 2cf0eab..bb418db 100644
--- a/source/web/swat.c
+++ b/source/web/swat.c
@@ -475,7 +475,7 @@ static int save_reload(int snum)
                lp_dump_one(f, False, snum);
        fclose(f);
 
-       lp_killunused(NULL);
+       lp_kill_all_services();
 
        if (!load_config(False)) {
                 printf(_("Can't reload %s"), get_dyn_CONFIGFILE());


-- 
Samba Shared Repository

Reply via email to