summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_workgroupdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nmbd/nmbd_workgroupdb.c')
-rw-r--r--source3/nmbd/nmbd_workgroupdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/nmbd/nmbd_workgroupdb.c b/source3/nmbd/nmbd_workgroupdb.c
index 5ce10e64d4..43a28aa669 100644
--- a/source3/nmbd/nmbd_workgroupdb.c
+++ b/source3/nmbd/nmbd_workgroupdb.c
@@ -52,7 +52,7 @@ static void name_to_unstring(unstring unname, const char *name)
if (errno == E2BIG) {
unstring tname;
pull_ascii_nstring(tname, sizeof(tname), nname);
- unstrcpy(unname, tname);
+ strlcpy(unname, tname, sizeof(nname));
DEBUG(0,("name_to_nstring: workgroup name %s is too long. Truncating to %s\n",
name, tname));
} else {
@@ -250,7 +250,7 @@ workgroup %s on subnet %s\n", work->work_group, subrec->subnet_name));
const char *name = my_netbios_names(i);
int stype = lp_default_server_announce() | (lp_local_master() ? SV_TYPE_POTENTIAL_BROWSER : 0 );
- if(!strequal(global_myname(), name))
+ if(!strequal(lp_netbios_name(), name))
stype &= ~(SV_TYPE_MASTER_BROWSER|SV_TYPE_POTENTIAL_BROWSER|SV_TYPE_DOMAIN_MASTER|SV_TYPE_DOMAIN_MEMBER);
create_server_on_workgroup(work,name,stype|SV_TYPE_LOCAL_LIST_ONLY, PERMANENT_TTL,