added option "enhanced browsing"
authorAndrew Tridgell <tridge@samba.org>
Wed, 21 Mar 2001 04:12:36 +0000 (04:12 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 21 Mar 2001 04:12:36 +0000 (04:12 +0000)
this allows users to disable the cross-subnet browse extensions that I
added to Samba a couple of years ago. This may be useful for getting
rid of empty workgroups.

source/include/proto.h
source/nmbd/nmbd.c
source/param/loadparm.c

index c53ad6971a7331094575c2f65e51750698569a7f..355526c79907858e568e6ec27812fa7b312e8413 100644 (file)
@@ -1643,6 +1643,7 @@ BOOL lp_restrict_anonymous(void);
 BOOL lp_lanman_auth(void);
 BOOL lp_host_msdfs(void);
 BOOL lp_kernel_oplocks(void);
+BOOL lp_enhanced_browsing(void);
 int lp_os_level(void);
 int lp_max_ttl(void);
 int lp_max_wins_ttl(void);
index 32d66d39fd528f9846a6abd7062cc4ad4b0afe8f..5e8e7e1ec661019c0b15e3083e77b84961d1108f 100644 (file)
@@ -460,7 +460,9 @@ static void process(void)
      * This will only work to a Samba WINS server.
      * (nmbd_browsesync.c)
      */
-    collect_all_workgroup_names_from_wins_server(t);
+    if (lp_enhanced_browsing()) {
+           collect_all_workgroup_names_from_wins_server(t);
+    }
 
     /*
      * Go through the response record queue and time out or re-transmit
@@ -477,7 +479,9 @@ static void process(void)
     /*
      * regularly sync with any other DMBs we know about 
      */
-    sync_all_dmbs(t);
+    if (lp_enhanced_browsing()) {
+           sync_all_dmbs(t);
+    }
 
     /*
      * clear the unexpected packet queue 
index 64393b4082de81f291ad6d0c8ea3a338ed543ad6..ccc967234b5981aea8f2181a116f5103163b451f 100644 (file)
@@ -194,6 +194,7 @@ typedef struct
        int iTotalPrintJobs;
        int syslog;
        int os_level;
+       int enhanced_browsing;
        int max_ttl;
        int max_wins_ttl;
        int min_wins_ttl;
@@ -908,6 +909,7 @@ static struct parm_struct parm_table[] = {
        {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0},
        {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT},
        {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0},
+       {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL},
 
        {"WINS Options", P_SEP, P_SEPARATOR},
        {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0},
@@ -1280,6 +1282,7 @@ static void init_globals(void)
        Globals.map_to_guest = 0;       /* By Default, "Never" */
        Globals.min_passwd_length = MINPASSWDLENGTH;    /* By Default, 5. */
        Globals.oplock_break_wait_time = 0;     /* By Default, 0 msecs. */
+       Globals.enhanced_browsing = True; 
 
 #ifdef WITH_LDAP
        /* default values for ldap */
@@ -1537,6 +1540,7 @@ FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous)
 FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth)
 FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs)
 FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks)
+FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing)
 FN_GLOBAL_INTEGER(lp_os_level, &Globals.os_level)
 FN_GLOBAL_INTEGER(lp_max_ttl, &Globals.max_ttl)
 FN_GLOBAL_INTEGER(lp_max_wins_ttl, &Globals.max_wins_ttl)