diff options
Diffstat (limited to 'source3/nmbd/nmbd_incomingdgrams.c')
-rw-r--r-- | source3/nmbd/nmbd_incomingdgrams.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/source3/nmbd/nmbd_incomingdgrams.c b/source3/nmbd/nmbd_incomingdgrams.c index 261200b4c5..cd6954fc62 100644 --- a/source3/nmbd/nmbd_incomingdgrams.c +++ b/source3/nmbd/nmbd_incomingdgrams.c @@ -23,8 +23,6 @@ #include "includes.h" -extern pstring global_myname; -extern fstring global_myworkgroup; extern BOOL found_lm_clients; #if 0 @@ -104,7 +102,7 @@ void process_host_announce(struct subnet_record *subrec, struct packet_struct *p char *comment = buf+31; struct work_record *work; struct server_record *servrec; - char *work_name; + const char *work_name; char *source_name = dgram->source_name.name; START_PROFILE(host_announce); @@ -141,8 +139,8 @@ void process_host_announce(struct subnet_record *subrec, struct packet_struct *p * to be our primary workgroup name. */ - if(strequal(work_name, global_myname)) - work_name = global_myworkgroup; + if(strequal(work_name, global_myname())) + work_name = lp_workgroup(); /* * We are being very agressive here in adding a workgroup @@ -396,10 +394,10 @@ master - ignoring master announce.\n")); goto done; } - if((work = find_workgroup_on_subnet(subrec, global_myworkgroup)) == NULL) + if((work = find_workgroup_on_subnet(subrec, lp_workgroup())) == NULL) { DEBUG(0,("process_master_browser_announce: Cannot find workgroup %s on subnet %s\n", - global_myworkgroup, subrec->subnet_name)); + lp_workgroup(), subrec->subnet_name)); goto done; } @@ -439,7 +437,7 @@ void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct char *announce_name = buf+9; struct work_record *work; struct server_record *servrec; - char *work_name; + const char *work_name; char *source_name = dgram->source_name.name; pstring comment; char *s = buf+9; @@ -489,8 +487,8 @@ originate from OS/2 Warp client. Ignoring packet.\n")); * not needed in the LanMan announce code, but it won't hurt. */ - if(strequal(work_name, global_myname)) - work_name = global_myworkgroup; + if(strequal(work_name, global_myname())) + work_name = lp_workgroup(); /* * We are being very agressive here in adding a workgroup @@ -580,7 +578,7 @@ static void send_backup_list_response(struct subnet_record *subrec, /* We always return at least one name - our own. */ count = 1; - StrnCpy(p,global_myname,15); + StrnCpy(p,global_myname(),15); strupper(p); p = skip_string(p,1); @@ -605,7 +603,7 @@ static void send_backup_list_response(struct subnet_record *subrec, if(count >= (unsigned int)max_number_requested) break; - if(strnequal(servrec->serv.name, global_myname,15)) + if(strnequal(servrec->serv.name, global_myname(),15)) continue; if(!(servrec->serv.type & SV_TYPE_BACKUP_BROWSER)) @@ -629,7 +627,7 @@ static void send_backup_list_response(struct subnet_record *subrec, send_mailslot(True, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf), - global_myname, 0, + global_myname(), 0, send_to_name->name,0, sendto_ip, subrec->myip, port); } @@ -664,7 +662,7 @@ void process_get_backup_list_request(struct subnet_record *subrec, for the requested workgroup. That means it must be our workgroup. */ - if(strequal(workgroup_name, global_myworkgroup) == False) + if(strequal(workgroup_name, lp_workgroup()) == False) { DEBUG(7,("process_get_backup_list_request: Ignoring announce request for workgroup %s.\n", workgroup_name)); @@ -801,7 +799,7 @@ void process_announce_request(struct subnet_record *subrec, struct packet_struct nmb_namestr(&dgram->dest_name))); /* We only send announcement requests on our workgroup. */ - if(strequal(workgroup_name, global_myworkgroup) == False) + if(strequal(workgroup_name, lp_workgroup()) == False) { DEBUG(7,("process_announce_request: Ignoring announce request for workgroup %s.\n", workgroup_name)); @@ -840,7 +838,7 @@ void process_lm_announce_request(struct subnet_record *subrec, struct packet_str nmb_namestr(&dgram->dest_name))); /* We only send announcement requests on our workgroup. */ - if(strequal(workgroup_name, global_myworkgroup) == False) + if(strequal(workgroup_name, lp_workgroup()) == False) { DEBUG(7,("process_lm_announce_request: Ignoring announce request for workgroup %s.\n", workgroup_name)); |