diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-10-02 14:09:22 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-10-02 14:09:22 +0000 |
commit | 5a2f52b79e28530c454cb488a44588147640f061 (patch) | |
tree | 1f412098bbcf050bce556d00f2c3fddd470746c9 /source3/namelogon.c | |
parent | 11d9539d755d5c5accb4481577781b8b7bfeda50 (diff) | |
download | samba-5a2f52b79e28530c454cb488a44588147640f061.tar.gz samba-5a2f52b79e28530c454cb488a44588147640f061.tar.xz samba-5a2f52b79e28530c454cb488a44588147640f061.zip |
- a huge pile of changes from Luke which implement the browse.conf
stuff and also fix a pile of nmbd bugs. Unfortunately I found it very
hard to disentangle the new features from the bug fixes so I am
putting in the new code. I hope this is the last big pile of changes
to the 1.9.16 series!
(This used to be commit 20b6203dac4bbb43e4e7bea0b214496d76d679d9)
Diffstat (limited to 'source3/namelogon.c')
-rw-r--r-- | source3/namelogon.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/source3/namelogon.c b/source3/namelogon.c index aacf32c280..6b3b2e01ed 100644 --- a/source3/namelogon.c +++ b/source3/namelogon.c @@ -21,7 +21,11 @@ Revision History: 14 jan 96: lkcl@pires.co.uk - added multiple workgroup domain master support + added domain master browser support + + 30 aug 96: lkcl@pires.co.uk + added multiple domain logon support, using extensions to David Chappell's + multiple domain master browser code. */ @@ -29,13 +33,8 @@ extern int ClientDGRAM; -#define TEST_CODE /* want to debug unknown browse packets */ - extern int DEBUGLEVEL; -extern pstring myname; - - /**************************************************************************** process a domain logon packet @@ -54,14 +53,18 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len) pstring outbuf; int code,reply_code; struct work_record *work; - + char *my_name; + if (!d) return; if (!(work = find_workgroupstruct(d,dgram->dest_name.name, False))) return; - if (!lp_domain_logons()) { - DEBUG(3,("No domain logons\n")); + if ((my_name = conf_browsing_alias(work->token)) == NULL) return; + + if (!conf_should_domain_logon(work->token)) + { + DEBUG(3,("No domain logons for %s (%s)\n", work->work_group, my_name)); return; } @@ -73,7 +76,7 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len) char *user = skip_string(machine,1); logname = skip_string(user,1); reply_code = 6; - strcpy(reply_name,myname); + strcpy(reply_name, my_name); strupper(reply_name); add_slashes = True; DEBUG(3,("Domain login request from %s(%s) user=%s\n", @@ -87,7 +90,7 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len) reply_code = 7; strcpy(reply_name,lp_domain_controller()); if (!*reply_name) { - strcpy(reply_name,myname); + strcpy(reply_name,my_name); reply_code = 0xC; } strupper(reply_name); @@ -121,8 +124,8 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len) PutUniCode(q,reply_name); q += 2*(strlen(reply_name) + 1); - PutUniCode(q,lp_workgroup()); - q += 2*(strlen(lp_workgroup()) + 1); + PutUniCode(q,work->work_group); + q += 2*(strlen(work->work_group) + 1); SIVAL(q,0,1); q += 4; @@ -134,6 +137,6 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len) q += 2; send_mailslot_reply(logname,ClientDGRAM,outbuf,PTR_DIFF(q,outbuf), - myname,&dgram->source_name.name[0],0x20,0,p->ip, + my_name,&dgram->source_name.name[0],0x20,0,p->ip, *iface_ip(p->ip)); } |