summaryrefslogtreecommitdiff
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
commitf7324464b1adcac67e620a75f2fd51ef8e615173 (patch)
tree2a370408d2cd872126a66d9c227fcdc7566f3c4e
parented95d8ed4f3281b62dc38f5f9004dbe72102bed7 (diff)
downloadsamba-f7324464b1adcac67e620a75f2fd51ef8e615173.tar.gz
samba-f7324464b1adcac67e620a75f2fd51ef8e615173.tar.bz2
samba-f7324464b1adcac67e620a75f2fd51ef8e615173.zip
richard got the short request for GETDC right (hooray!) win9x _and_ nt
now work. (This used to be commit 27ef1789267c7af70071ac9b1d216b4dd745578a)
-rw-r--r--source3/nmbd/nmbd_processlogon.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/source3/nmbd/nmbd_processlogon.c b/source3/nmbd/nmbd_processlogon.c
index 279ab1c764..e13dff8302 100644
--- a/source3/nmbd/nmbd_processlogon.c
+++ b/source3/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(),