summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-09-09 22:38:37 +0200
committerGünther Deschner <gd@samba.org>2010-09-09 23:07:11 +0200
commitf002b7fa1b4162e691abb68eb95eee2a809faaf5 (patch)
tree81404173990496c8c40d2db84b4ac7d04723a3a1 /source3/nmbd
parent5fc7d14b064d83b40c65a8c41ea05a9b43af6f5d (diff)
downloadsamba-f002b7fa1b4162e691abb68eb95eee2a809faaf5.tar.gz
samba-f002b7fa1b4162e691abb68eb95eee2a809faaf5.tar.bz2
samba-f002b7fa1b4162e691abb68eb95eee2a809faaf5.zip
s3-nmbd: handle source_name in one location in nmbd_process_logon().
Guenther
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd_processlogon.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/nmbd/nmbd_processlogon.c b/source3/nmbd/nmbd_processlogon.c
index 8750ea1fac..ff05e9c9ca 100644
--- a/source3/nmbd/nmbd_processlogon.c
+++ b/source3/nmbd/nmbd_processlogon.c
@@ -307,6 +307,7 @@ Process a domain logon packet
void process_logon_packet(struct packet_struct *p, char *buf,int len,
const char *mailslot)
{
+ fstring source_name;
struct dgram_packet *dgram = &p->packet.dgram;
fstring my_name;
fstring reply_name;
@@ -350,6 +351,8 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
fstrcpy(my_name, global_myname());
+ pull_ascii_nstring(source_name, sizeof(source_name), dgram->source_name.name);
+
ZERO_STRUCT(request);
blob_in = data_blob_const(buf, len);
@@ -424,7 +427,7 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
send_mailslot(True, getdc_str,
outbuf,PTR_DIFF(q,outbuf),
global_myname(), 0x0,
- mach_str,
+ source_name,
dgram->source_name.name_type,
p->ip, ip, p->port);
break;
@@ -432,7 +435,6 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
case LOGON_PRIMARY_QUERY: {
fstring mach_str, getdc_str;
- fstring source_name;
char *q = buf + 2;
char *machine = q;
@@ -549,7 +551,6 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
dump_data(4, (uint8 *)outbuf, PTR_DIFF(q, outbuf));
pull_ascii_fstring(getdc_str, getdc);
- pull_ascii_nstring(source_name, sizeof(source_name), dgram->source_name.name);
send_mailslot(True, getdc_str,
outbuf,PTR_DIFF(q,outbuf),
@@ -562,7 +563,6 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
case LOGON_SAM_LOGON_REQUEST: {
fstring getdc_str;
- fstring source_name;
char *source_addr;
char *q = buf + 2;
fstring asccomp;
@@ -880,7 +880,6 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
dump_data(4, (uint8 *)outbuf, PTR_DIFF(q, outbuf));
pull_ascii_fstring(getdc_str, getdc);
- pull_ascii_nstring(source_name, sizeof(source_name), dgram->source_name.name);
source_addr = SMB_STRDUP(inet_ntoa(dgram->header.source_ip));
if (source_addr == NULL) {
DEBUG(3, ("out of memory copying client"