From 074419cdc4001ee3d1170facb7485538d7d6d28c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 9 Dec 1998 06:21:59 +0000 Subject: [PATCH] I got sick of the debate with luke about the SID and nmbd so I just went ahead and removed the offending code from nmbd_processlogon(). If luke ever goes back to that dark alley and manages to find the nmbd packet type which needs a SID in the reply then we can reconsider. This also means we don't need the password database code linked into nmbd, which is a blessing, and nmbd will startup without smbd. while I'm looking at this, why do RPCTORTURE_OBJ and RPCCLIENT_OBJ include the password database code? Maybe Luke just likes that code a lot and wants it in as many binaries as possible :) --- source/Makefile.in | 2 +- source/nmbd/nmbd.c | 3 --- source/nmbd/nmbd_processlogon.c | 28 +++++----------------------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/source/Makefile.in b/source/Makefile.in index 6dd30e568fd..ded8da71359 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -169,7 +169,7 @@ NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \ nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \ - $(PASSDB_OBJ) $(LIB_OBJ) + $(LIB_OBJ) SWAT_OBJ = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \ web/swat.o $(LIBSMB_OBJ) $(LOCKING_OBJ) \ diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c index d7ce42dae24..33c4a5882c4 100644 --- a/source/nmbd/nmbd.c +++ b/source/nmbd/nmbd.c @@ -567,9 +567,6 @@ static void usage(char *pname) charset_initialise(); - if(!initialize_password_db()) - exit(1); - #ifdef LMHOSTSFILE pstrcpy( host_file, LMHOSTSFILE ); #endif diff --git a/source/nmbd/nmbd_processlogon.c b/source/nmbd/nmbd_processlogon.c index 3f519ecfc94..42810683412 100644 --- a/source/nmbd/nmbd_processlogon.c +++ b/source/nmbd/nmbd_processlogon.c @@ -44,7 +44,6 @@ 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; @@ -53,7 +52,6 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len, char *uniuser; /* Unicode user name. */ pstring ascuser; char *unicomp; /* Unicode computer name. */ - struct smb_passwd *smb_pass; /* To check if machine account exists */ memset(outbuf, 0, sizeof(outbuf)); @@ -196,7 +194,8 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n", DEBUG(3,("process_logon_packet: SAMLOGON sidsize %d ntv %d\n", domainsidsize, ntversion)); /* - * If MACHINE$ is in our password database then respond, else ignore. + * we respond regadless of whether the machine is in our password + * database. If it isn't then we let smbd send an appropriate error. * Let's ignore the SID. */ @@ -206,26 +205,9 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n", fstrcpy(reply_name,"\\\\"); /* Here it wants \\LOGONSERVER. */ fstrcpy(reply_name+2,my_name); - smb_pass = getsmbpwnam(ascuser); - - if(!smb_pass ) - { - DEBUG(3,("process_logon_packet: SAMLOGON request from %s(%s) for %s, not in password file\n", - unistr(unicomp),inet_ntoa(p->ip), ascuser)); - return; - } - else if(smb_pass->acct_ctrl & ACB_DISABLED) - { - DEBUG(3,("process_logon_packet: SAMLOGON request from %s(%s) for %s, accound disabled.\n", - unistr(unicomp),inet_ntoa(p->ip), ascuser)); - return; - } - else - { - DEBUG(3,("process_logon_packet: SAMLOGON request from %s(%s) for %s, returning logon svr %s domain %s code %x token=%x\n", - unistr(unicomp),inet_ntoa(p->ip), ascuser, reply_name, global_myworkgroup, - SAMLOGON_R ,lmnttoken)); - } + DEBUG(3,("process_logon_packet: SAMLOGON request from %s(%s) for %s, returning logon svr %s domain %s code %x token=%x\n", + unistr(unicomp),inet_ntoa(p->ip), ascuser, reply_name, global_myworkgroup, + SAMLOGON_R ,lmnttoken)); /* Construct reply. */ -- 2.11.4.GIT