summaryrefslogtreecommitdiffstats
path: root/source/nmbd
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-02-22 21:00:01 +0000
committerLuke Leighton <lkcl@samba.org>2000-02-22 21:00:01 +0000
commit27ef1789267c7af70071ac9b1d216b4dd745578a (patch)
tree5e256e49a21a5a471721f3800c4ab7022cdba2c4 /source/nmbd
parent89aa4d8ca9cc9e8e6dd4566076c0cace8b82d838 (diff)
downloadsamba-27ef1789267c7af70071ac9b1d216b4dd745578a.tar.gz
samba-27ef1789267c7af70071ac9b1d216b4dd745578a.tar.xz
samba-27ef1789267c7af70071ac9b1d216b4dd745578a.zip
richard got the short request for GETDC right (hooray!) win9x _and_ nt
now work.
Diffstat (limited to 'source/nmbd')
-rw-r--r--source/nmbd/nmbd_processlogon.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/source/nmbd/nmbd_processlogon.c b/source/nmbd/nmbd_processlogon.c
index 279ab1c764f..e13dff8302b 100644
--- a/source/nmbd/nmbd_processlogon.c
+++ b/source/nmbd/nmbd_processlogon.c
@@ -44,10 +44,11 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len,
pstring outbuf;
int code;
uint16 token = 0;
- uint32 ntversion;
- uint16 lmnttoken;
- uint16 lm20token;
+ uint32 ntversion = 0;
+ uint16 lmnttoken = 0;
+ uint16 lm20token = 0;
uint32 domainsidsize;
+ BOOL short_request = 0;
char *getdc;
char *uniuser; /* Unicode user name. */
pstring ascuser;
@@ -120,12 +121,21 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
q = skip_unicode_string(q, 1);
- ntversion = IVAL(q, 0);
- q += 4;
- lmnttoken = SVAL(q, 0);
- q += 2;
- lm20token = SVAL(q, 0);
- q += 2;
+ if ((buf - q) >= len) { /* Check for a short request */
+
+ short_request = 1;
+
+ }
+ else { /* A full length request */
+
+ ntversion = IVAL(q, 0);
+ q += 4;
+ lmnttoken = SVAL(q, 0);
+ q += 2;
+ lm20token = SVAL(q, 0);
+ q += 2;
+
+ }
/* Construct reply. */
@@ -135,10 +145,11 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
fstrcpy(reply_name,my_name);
fstrcpy(q, reply_name);
-
q = skip_string(q, 1); /* PDC name */
- if (strcmp(mailslot, NT_LOGON_MAILSLOT)==0) {
+ /* PDC and domain name */
+ if (!short_request) /* Make a full reply */
+ {
q = align2(q, buf);
dos_PutUniCode(q, my_name, sizeof(pstring)); /* PDC name */
@@ -155,6 +166,8 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
q += 2;
}
+ /* RJS, 21-Feb-2000, we send a short reply if the request was short */
+
DEBUG(3,("process_logon_packet: GETDC request from %s at IP %s, \
reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
machine,inet_ntoa(p->ip), reply_name, lp_workgroup(),