Removed global_myworkgroup, global_myname, global_myscope. Added liberal
[bbaumbach/samba-autobuild/.git] / source / nmbd / nmbd_synclists.c
index 7ba39f0cd4086bb9df1b50a8f72d7180d1912341..30c7d579f18a379d0e022f1fc518db3d32230511 100644 (file)
@@ -1,6 +1,5 @@
 /* 
-   Unix SMB/Netbios implementation.
-   Version 1.9.
+   Unix SMB/CIFS implementation.
    NBT netbios routines and daemon - version 2
    Copyright (C) Andrew Tridgell 1994-1998
    Copyright (C) Luke Kenneth Casson Leighton 1994-1998
@@ -31,8 +30,6 @@
 #include "includes.h"
 #include "smb.h"
 
-extern int DEBUGLEVEL;
-
 struct sync_record {
        struct sync_record *next, *prev;
        fstring workgroup;
@@ -73,7 +70,11 @@ static void sync_child(char *name, int nm_type,
        uint32 local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0;
        struct nmb_name called, calling;
 
-       if (!cli_initialise(&cli) || !cli_connect(&cli, name, &ip)) {
+       /* W2K DMB's return empty browse lists on port 445. Use 139.
+        * Patch from Andy Levine andyl@epicrealm.com.
+        */
+
+       if (!cli_initialise(&cli) || !cli_set_port(&cli, 139) || !cli_connect(&cli, name, &ip)) {
                return;
        }
 
@@ -246,7 +247,7 @@ static void complete_sync(struct sync_record *s)
        unsigned type;
        pstring comment;
        pstring line;
-       char *ptr;
+       const char *ptr;
        int count=0;
 
        f = x_fopen(s->fname,O_RDONLY, 0);