summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_elections.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-08-27 18:00:09 +0000
committerJeremy Allison <jra@samba.org>2003-08-27 18:00:09 +0000
commit8dc1a4f30066f7cc25ab6b775b24f32ba275d78e (patch)
treeffddb657a9c0dd56e9153729f95d3d2941bcd2a4 /source3/nmbd/nmbd_elections.c
parent4561b811df8b858fd7fbedeb534aa715d66a9005 (diff)
downloadsamba-8dc1a4f30066f7cc25ab6b775b24f32ba275d78e.tar.gz
Ensure we use correct length nstrings for workgroup and browser names.
Jeremy. (This used to be commit be534c8adf6c3cb8921ce49dbb79991c632d501e)
Diffstat (limited to 'source3/nmbd/nmbd_elections.c')
-rw-r--r--source3/nmbd/nmbd_elections.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/nmbd/nmbd_elections.c b/source3/nmbd/nmbd_elections.c
index d4d6da081a6..e341f6f7fb1 100644
--- a/source3/nmbd/nmbd_elections.c
+++ b/source3/nmbd/nmbd_elections.c
@@ -97,7 +97,7 @@ static void check_for_master_browser_fail( struct subnet_record *subrec,
return;
}
- if (strequal(work->work_group, lp_workgroup())) {
+ if (strnequal(work->work_group, lp_workgroup(), sizeof(nstring))) {
if (lp_local_master()) {
/* We have discovered that there is no local master
@@ -145,7 +145,7 @@ void check_master_browser_exists(time_t t)
struct work_record *work;
for (work = subrec->workgrouplist; work; work = work->next) {
- if (strequal(work->work_group, workgroup_name) && !AM_LOCAL_MASTER_BROWSER(work)) {
+ if (strnequal(work->work_group, workgroup_name, sizeof(nstring)) && !AM_LOCAL_MASTER_BROWSER(work)) {
/* Do a name query for the local master browser on this net. */
query_name( subrec, work->work_group, 0x1d,
check_for_master_browser_success,
@@ -284,7 +284,7 @@ void process_election(struct subnet_record *subrec, struct packet_struct *p, cha
goto done;
}
- if (!strequal(work->work_group, lp_workgroup())) {
+ if (!strnequal(work->work_group, lp_workgroup(), sizeof(nstring))) {
DEBUG(3,("process_election: ignoring election request for workgroup %s on subnet %s as this \
is not my workgroup.\n", work->work_group, subrec->subnet_name ));
goto done;
@@ -381,7 +381,7 @@ void nmbd_message_election(int msg_type, pid_t src, void *buf, size_t len)
for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
struct work_record *work;
for (work = subrec->workgrouplist; work; work = work->next) {
- if (strequal(work->work_group, lp_workgroup())) {
+ if (strnequal(work->work_group, lp_workgroup(), sizeof(nstring))) {
work->needelection = True;
work->ElectionCount=0;
work->mst_state = lp_local_master() ? MST_POTENTIAL : MST_NONE;