From 2f194322d419350f35a48dff750066894d68eccf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 Nov 2002 23:20:50 +0000 Subject: Removed global_myworkgroup, global_myname, global_myscope. Added liberal dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit f755711df8f74f9b8e8c1a2b0d07d02a931eeb89) --- source3/nmbd/nmbd.c | 102 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 100 deletions(-) (limited to 'source3/nmbd/nmbd.c') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 50730d40f3..5987d70a45 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -27,10 +27,6 @@ int ClientNMB = -1; int ClientDGRAM = -1; int global_nmb_port = -1; -extern pstring global_myname; -extern fstring global_myworkgroup; -extern char **my_netbios_names; - extern BOOL global_in_nmbd; /* are we running as a daemon ? */ @@ -564,98 +560,6 @@ static BOOL open_sockets(BOOL isdaemon, int port) return( True ); } -/**************************************************************************** ** - Initialise connect, service and file structs. - **************************************************************************** */ - -static BOOL init_structs(void) -{ - extern fstring local_machine; - char *p, **ptr; - int namecount; - int n; - int nodup; - char *nbname; - - if (! *global_myname) - { - fstrcpy( global_myname, myhostname() ); - p = strchr_m( global_myname, '.' ); - if (p) - *p = 0; - } - strupper( global_myname ); - - /* Add any NETBIOS name aliases. Ensure that the first entry - is equal to global_myname. - */ - /* Work out the max number of netbios aliases that we have */ - ptr = lp_netbios_aliases(); - namecount = 0; - if (ptr) - for( ; *ptr; namecount++,ptr++ ) - ; - if ( *global_myname ) - namecount++; - - /* Allocate space for the netbios aliases */ - my_netbios_names = (char **)malloc( sizeof(char *) * (namecount+1) ); - if( NULL == my_netbios_names ) - { - DEBUG( 0, ( "init_structs: malloc fail.\n" ) ); - return( False ); - } - - /* Use the global_myname string first */ - namecount=0; - if ( *global_myname ) - my_netbios_names[namecount++] = global_myname; - - ptr = lp_netbios_aliases(); - if (ptr) - { - while ( *ptr ) - { - nbname = strdup(*ptr); - if (nbname == NULL) - { - DEBUG(0,("init_structs: malloc fail when allocating names.\n")); - return False; - } - strupper( nbname ); - /* Look for duplicates */ - nodup=1; - for( n=0; n