summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_become_lmb.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
commit6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch)
tree850c71039563c16a5d563c47e7ba2ab645baf198 /source3/nmbd/nmbd_become_lmb.c
parent6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff)
parent2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff)
downloadsamba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/nmbd/nmbd_become_lmb.c')
-rw-r--r--source3/nmbd/nmbd_become_lmb.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/source3/nmbd/nmbd_become_lmb.c b/source3/nmbd/nmbd_become_lmb.c
index ffd92cf0d8..f94efd0371 100644
--- a/source3/nmbd/nmbd_become_lmb.c
+++ b/source3/nmbd/nmbd_become_lmb.c
@@ -85,10 +85,10 @@ subnet %s.\n", workgroup_name, subrec->subnet_name ));
return;
}
- if((servrec = find_server_in_workgroup( work, global_myname())) == NULL) {
+ if((servrec = find_server_in_workgroup( work, lp_netbios_name())) == NULL) {
DEBUG(0,("reset_workgroup_state: Error - cannot find server %s \
in workgroup %s on subnet %s\n",
- global_myname(), work->work_group, subrec->subnet_name));
+ lp_netbios_name(), work->work_group, subrec->subnet_name));
work->mst_state = lp_local_master() ? MST_POTENTIAL : MST_NONE;
return;
}
@@ -149,7 +149,7 @@ static void unbecome_local_master_success(struct subnet_record *subrec,
if( DEBUGLVL( 0 ) ) {
dbgtext( "*****\n\n" );
- dbgtext( "Samba name server %s ", global_myname() );
+ dbgtext( "Samba name server %s ", lp_netbios_name() );
dbgtext( "has stopped being a local master browser " );
dbgtext( "for workgroup %s ", relname );
dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name );
@@ -185,7 +185,7 @@ Removing from namelist anyway.\n", nmb_namestr(fail_name)));
if( DEBUGLVL( 0 ) ) {
dbgtext( "*****\n\n" );
- dbgtext( "Samba name server %s ", global_myname() );
+ dbgtext( "Samba name server %s ", lp_netbios_name() );
dbgtext( "has stopped being a local master browser " );
dbgtext( "for workgroup %s ", failname );
dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name );
@@ -280,10 +280,10 @@ void unbecome_local_master_browser(struct subnet_record *subrec, struct work_rec
DEBUG(2,("unbecome_local_master_browser: unbecoming local master for workgroup %s \
on subnet %s\n",work->work_group, subrec->subnet_name));
- if(find_server_in_workgroup( work, global_myname()) == NULL) {
+ if(find_server_in_workgroup( work, lp_netbios_name()) == NULL) {
DEBUG(0,("unbecome_local_master_browser: Error - cannot find server %s \
in workgroup %s on subnet %s\n",
- global_myname(), work->work_group, subrec->subnet_name));
+ lp_netbios_name(), work->work_group, subrec->subnet_name));
work->mst_state = lp_local_master() ? MST_POTENTIAL : MST_NONE;
return;
}
@@ -342,10 +342,10 @@ workgroup %s on subnet %s\n", regname, subrec->subnet_name));
return;
}
- if((servrec = find_server_in_workgroup( work, global_myname())) == NULL) {
+ if((servrec = find_server_in_workgroup( work, lp_netbios_name())) == NULL) {
DEBUG(0,("become_local_master_stage2: Error - cannot find server %s \
in workgroup %s on subnet %s\n",
- global_myname(), regname, subrec->subnet_name));
+ lp_netbios_name(), regname, subrec->subnet_name));
work->mst_state = lp_local_master() ? MST_POTENTIAL : MST_NONE;
return;
}
@@ -363,7 +363,7 @@ on subnet %s\n", work->work_group, subrec->subnet_name));
subrec->work_changed = True;
/* Add this name to the workgroup as local master browser. */
- set_workgroup_local_master_browser_name( work, global_myname());
+ set_workgroup_local_master_browser_name( work, lp_netbios_name());
/* Count the number of servers we have on our list. If it's
less than 10 (just a heuristic) request the servers
@@ -396,7 +396,7 @@ on subnet %s\n", work->work_group, subrec->subnet_name));
if( DEBUGLVL( 0 ) ) {
dbgtext( "*****\n\n" );
- dbgtext( "Samba name server %s ", global_myname() );
+ dbgtext( "Samba name server %s ", lp_netbios_name() );
dbgtext( "is now a local master browser " );
dbgtext( "for workgroup %s ", work->work_group );
dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name );
@@ -487,10 +487,10 @@ workgroup %s on subnet %s\n", work_name, subrec->subnet_name));
return;
}
- if(find_server_in_workgroup(work, global_myname()) == NULL) {
+ if(find_server_in_workgroup(work, lp_netbios_name()) == NULL) {
DEBUG(0,("become_local_master_fail1: Error - cannot find server %s \
in workgroup %s on subnet %s\n",
- global_myname(), work->work_group, subrec->subnet_name));
+ lp_netbios_name(), work->work_group, subrec->subnet_name));
return;
}
@@ -527,10 +527,10 @@ void become_local_master_browser(struct subnet_record *subrec, struct work_recor
return;
}
- if(find_server_in_workgroup( work, global_myname()) == NULL) {
+ if(find_server_in_workgroup( work, lp_netbios_name()) == NULL) {
DEBUG(0,("become_local_master_browser: Error - cannot find server %s \
in workgroup %s on subnet %s\n",
- global_myname(), work->work_group, subrec->subnet_name));
+ lp_netbios_name(), work->work_group, subrec->subnet_name));
return;
}
@@ -554,7 +554,7 @@ in workgroup %s on subnet %s\n",
userdata->copy_fn = NULL;
userdata->free_fn = NULL;
userdata->userdata_len = strlen(work->work_group)+1;
- overmalloc_safe_strcpy(userdata->data, work->work_group, size - sizeof(*userdata) - 1);
+ strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
/* Register the special browser group name. */
register_name(subrec, MSBROWSE, 0x01, samba_nb_type|NB_GROUP,