summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1996-08-09 18:05:34 +0000
committerSamba Release Account <samba-bugs@samba.org>1996-08-09 18:05:34 +0000
commit2b9475cc5fda4b272f19c4f168d3f00363c8042b (patch)
treeba4f27c6d20f620cd819a04ad172081c5e6f2ce6
parent6567bac5d13f32729fe51eba1e904268c6ee00be (diff)
downloadsamba-2b9475cc5fda4b272f19c4f168d3f00363c8042b.tar.gz
applying login updates from jim@oxfordcc.co.uk, sent in by
lewis2@server.uwindsor.ca. rest of this patch to follow. bug in interface.c - uninitialised pointer. nmbd has 0x20 as well as 0x0 NetBIOS name when lmhosts entry is added. lkcl
-rw-r--r--source/lib/interface.c1
-rw-r--r--source/nameelect.c2
-rw-r--r--source/namelogon.c34
-rw-r--r--source/nmbd/nmbd.c1
-rw-r--r--source/smbd/ipc.c22
-rw-r--r--source/smbd/server.c4
6 files changed, 49 insertions, 15 deletions
diff --git a/source/lib/interface.c b/source/lib/interface.c
index 3a532140b39..061ac08c7b4 100644
--- a/source/lib/interface.c
+++ b/source/lib/interface.c
@@ -334,6 +334,7 @@ static void interpret_interfaces(char *s, struct interface **interfaces,
DEBUG(2,("Warning: inconsistant interface %s\n",inet_ntoa(iface->ip)));
}
+ iface->next = NULL;
(*interfaces) = last_iface = iface;
DEBUG(1,("Added interface ip=%s ",inet_ntoa(iface->ip)));
diff --git a/source/nameelect.c b/source/nameelect.c
index 8c93de03a85..38b4d5d80e7 100644
--- a/source/nameelect.c
+++ b/source/nameelect.c
@@ -376,7 +376,7 @@ void become_master(struct subnet_record *d, struct work_record *work)
if (lp_domain_logons())
{
- update_type |= SV_TYPE_DOMAIN_CTRL;
+ update_type |= SV_TYPE_DOMAIN_CTRL|SV_TYPE_SERVER_UNIX;
}
work->ServerType |= update_type;
diff --git a/source/namelogon.c b/source/namelogon.c
index 8a7fe87965c..24bb9842474 100644
--- a/source/namelogon.c
+++ b/source/namelogon.c
@@ -38,6 +38,10 @@ extern pstring myname;
/****************************************************************************
process a domain logon packet
+
+ 08aug96 lkcl@pires.co.uk
+ reply_code == 0xC courtesy of jim@oxfordcc.co.uk forwarded by
+ lewis2@server.uwindsor.ca
**************************************************************************/
void process_logon_packet(struct packet_struct *p,char *buf,int len)
{
@@ -87,11 +91,11 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len)
reply_code = 7;
reply_name = lp_domain_controller();
if (!*reply_name) {
- DEBUG(3,("No domain controller configured\n"));
- return;
+ reply_name = myname;
+ reply_code = 0xC;
}
- DEBUG(3,("GETDC request from %s(%s)\n",
- machine,inet_ntoa(p->ip)));
+ DEBUG(3,("GETDC request from %s(%s), reporting %s 0x%2x\n",
+ machine,inet_ntoa(p->ip), reply_name, reply_code));
}
break;
default:
@@ -110,6 +114,28 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len)
StrnCpy(q,reply_name,16);
strupper(q);
q = skip_string(q,1);
+
+ if (reply_code == 0xC)
+ {
+ if ( PTR_DIFF (q,outbuf) & 1 )
+ {
+ q++;
+ }
+
+ StrnCpy(q,reply_name,16);
+ strupper(q);
+ q = skip_string(q,1);
+
+ StrnCpy(q,lp_workgroup(),16);
+ strupper(q);
+ q = skip_string(q,1);
+
+ SIVAL(q,0,1);
+ q += 4;
+ SSVAL(q,0,0xFFFF);
+ q += 2;
+ }
+
SSVAL(q,0,0xFFFF);
q += 2;
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index e2a4bdeb67f..5c3be920f5f 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -296,6 +296,7 @@ static void load_hosts_file(char *fname)
struct subnet_record *d = find_subnet(ipaddr);
if (d)
{
+ add_netbios_entry(d,name,0x00,NB_ACTIVE,0,source,ipaddr,True,True);
add_netbios_entry(d,name,0x20,NB_ACTIVE,0,source,ipaddr,True,True);
}
}
diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c
index 415c939bf38..f4f18079225 100644
--- a/source/smbd/ipc.c
+++ b/source/smbd/ipc.c
@@ -59,6 +59,9 @@ extern fstring local_machine;
#define SNLEN 15 /* service name length */
#define QNLEN 12 /* queue name maximum length */
+#define MAJOR_VERSION 2
+#define MINOR_VERSION 0
+
extern int Client;
static int CopyExpanded(int cnum, int snum, char** dst, char* src, int* n)
@@ -1406,14 +1409,16 @@ static BOOL api_SetUserPassword(int cnum,int uid, char *param,char *data,
*rdata_len = 0;
- SSVAL(*rparam,0,NERR_Success);
+ SSVAL(*rparam,0,NERR_badpass);
SSVAL(*rparam,2,0); /* converter word */
DEBUG(3,("Set password for <%s>\n",user));
- if (!password_ok(user,pass1,strlen(pass1),NULL,False) ||
- !chgpasswd(user,pass1,pass2))
- SSVAL(*rparam,0,NERR_badpass);
+ if (password_ok(user,pass1,strlen(pass1),NULL,False) &&
+ chgpasswd(user,pass1,pass2))
+ {
+ SSVAL(*rparam,0,NERR_Success);
+ }
bzero(pass1,sizeof(fstring));
bzero(pass2,sizeof(fstring));
@@ -1740,9 +1745,10 @@ static BOOL api_RNetServerGetInfo(int cnum,int uid, char *param,char *data,
}
if (servers) free(servers);
- SCVAL(p,0,2); /* version_major */
- SCVAL(p,1,0); /* version_minor */
+ SCVAL(p,0,MAJOR_VERSION);
+ SCVAL(p,1,MINOR_VERSION);
SIVAL(p,2,servertype);
+
if (mdrcnt == struct_len) {
SIVAL(p,6,0);
} else {
@@ -1817,8 +1823,8 @@ static BOOL api_NetWkstaGetInfo(int cnum,int uid, char *param,char *data,
p2 = skip_string(p2,1);
p += 4;
- SCVAL(p,0,2); /* major version?? */
- SCVAL(p,1,1); /* minor version?? */
+ SCVAL(p,0,MAJOR_VERSION);
+ SCVAL(p,1,MINOR_VERSION);
p += 2;
SIVAL(p,0,PTR_DIFF(p2,*rdata));
diff --git a/source/smbd/server.c b/source/smbd/server.c
index e582ea735ab..d15ca9336ec 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -3454,11 +3454,11 @@ static void process(void)
*/
static int error_count=0;
static time_t error_time=0;
- if (error_count==0) {
+ if (error_count++==0) {
error_time = t;
} else if (error_time != t) {
error_count = 0;
- } else if (error_count++ > 2) {
+ } else if (error_count > 2) {
exit_server("looping in process()\n");
}
}