mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
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
(This used to be commit 2b9475cc5f
)
This commit is contained in:
@ -334,6 +334,7 @@ static void interpret_interfaces(char *s, struct interface **interfaces,
|
|||||||
DEBUG(2,("Warning: inconsistant interface %s\n",inet_ntoa(iface->ip)));
|
DEBUG(2,("Warning: inconsistant interface %s\n",inet_ntoa(iface->ip)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iface->next = NULL;
|
||||||
(*interfaces) = last_iface = iface;
|
(*interfaces) = last_iface = iface;
|
||||||
|
|
||||||
DEBUG(1,("Added interface ip=%s ",inet_ntoa(iface->ip)));
|
DEBUG(1,("Added interface ip=%s ",inet_ntoa(iface->ip)));
|
||||||
|
@ -376,7 +376,7 @@ void become_master(struct subnet_record *d, struct work_record *work)
|
|||||||
|
|
||||||
if (lp_domain_logons())
|
if (lp_domain_logons())
|
||||||
{
|
{
|
||||||
update_type |= SV_TYPE_DOMAIN_CTRL;
|
update_type |= SV_TYPE_DOMAIN_CTRL|SV_TYPE_SERVER_UNIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
work->ServerType |= update_type;
|
work->ServerType |= update_type;
|
||||||
|
@ -38,6 +38,10 @@ extern pstring myname;
|
|||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
process a domain logon packet
|
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)
|
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_code = 7;
|
||||||
reply_name = lp_domain_controller();
|
reply_name = lp_domain_controller();
|
||||||
if (!*reply_name) {
|
if (!*reply_name) {
|
||||||
DEBUG(3,("No domain controller configured\n"));
|
reply_name = myname;
|
||||||
return;
|
reply_code = 0xC;
|
||||||
}
|
}
|
||||||
DEBUG(3,("GETDC request from %s(%s)\n",
|
DEBUG(3,("GETDC request from %s(%s), reporting %s 0x%2x\n",
|
||||||
machine,inet_ntoa(p->ip)));
|
machine,inet_ntoa(p->ip), reply_name, reply_code));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -110,6 +114,28 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len)
|
|||||||
StrnCpy(q,reply_name,16);
|
StrnCpy(q,reply_name,16);
|
||||||
strupper(q);
|
strupper(q);
|
||||||
q = skip_string(q,1);
|
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);
|
SSVAL(q,0,0xFFFF);
|
||||||
q += 2;
|
q += 2;
|
||||||
|
|
||||||
|
@ -296,6 +296,7 @@ static void load_hosts_file(char *fname)
|
|||||||
struct subnet_record *d = find_subnet(ipaddr);
|
struct subnet_record *d = find_subnet(ipaddr);
|
||||||
if (d)
|
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);
|
add_netbios_entry(d,name,0x20,NB_ACTIVE,0,source,ipaddr,True,True);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,9 @@ extern fstring local_machine;
|
|||||||
#define SNLEN 15 /* service name length */
|
#define SNLEN 15 /* service name length */
|
||||||
#define QNLEN 12 /* queue name maximum length */
|
#define QNLEN 12 /* queue name maximum length */
|
||||||
|
|
||||||
|
#define MAJOR_VERSION 2
|
||||||
|
#define MINOR_VERSION 0
|
||||||
|
|
||||||
extern int Client;
|
extern int Client;
|
||||||
|
|
||||||
static int CopyExpanded(int cnum, int snum, char** dst, char* src, int* n)
|
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;
|
*rdata_len = 0;
|
||||||
|
|
||||||
SSVAL(*rparam,0,NERR_Success);
|
SSVAL(*rparam,0,NERR_badpass);
|
||||||
SSVAL(*rparam,2,0); /* converter word */
|
SSVAL(*rparam,2,0); /* converter word */
|
||||||
|
|
||||||
DEBUG(3,("Set password for <%s>\n",user));
|
DEBUG(3,("Set password for <%s>\n",user));
|
||||||
|
|
||||||
if (!password_ok(user,pass1,strlen(pass1),NULL,False) ||
|
if (password_ok(user,pass1,strlen(pass1),NULL,False) &&
|
||||||
!chgpasswd(user,pass1,pass2))
|
chgpasswd(user,pass1,pass2))
|
||||||
SSVAL(*rparam,0,NERR_badpass);
|
{
|
||||||
|
SSVAL(*rparam,0,NERR_Success);
|
||||||
|
}
|
||||||
|
|
||||||
bzero(pass1,sizeof(fstring));
|
bzero(pass1,sizeof(fstring));
|
||||||
bzero(pass2,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);
|
if (servers) free(servers);
|
||||||
|
|
||||||
SCVAL(p,0,2); /* version_major */
|
SCVAL(p,0,MAJOR_VERSION);
|
||||||
SCVAL(p,1,0); /* version_minor */
|
SCVAL(p,1,MINOR_VERSION);
|
||||||
SIVAL(p,2,servertype);
|
SIVAL(p,2,servertype);
|
||||||
|
|
||||||
if (mdrcnt == struct_len) {
|
if (mdrcnt == struct_len) {
|
||||||
SIVAL(p,6,0);
|
SIVAL(p,6,0);
|
||||||
} else {
|
} else {
|
||||||
@ -1817,8 +1823,8 @@ static BOOL api_NetWkstaGetInfo(int cnum,int uid, char *param,char *data,
|
|||||||
p2 = skip_string(p2,1);
|
p2 = skip_string(p2,1);
|
||||||
p += 4;
|
p += 4;
|
||||||
|
|
||||||
SCVAL(p,0,2); /* major version?? */
|
SCVAL(p,0,MAJOR_VERSION);
|
||||||
SCVAL(p,1,1); /* minor version?? */
|
SCVAL(p,1,MINOR_VERSION);
|
||||||
p += 2;
|
p += 2;
|
||||||
|
|
||||||
SIVAL(p,0,PTR_DIFF(p2,*rdata));
|
SIVAL(p,0,PTR_DIFF(p2,*rdata));
|
||||||
|
@ -3454,11 +3454,11 @@ static void process(void)
|
|||||||
*/
|
*/
|
||||||
static int error_count=0;
|
static int error_count=0;
|
||||||
static time_t error_time=0;
|
static time_t error_time=0;
|
||||||
if (error_count==0) {
|
if (error_count++==0) {
|
||||||
error_time = t;
|
error_time = t;
|
||||||
} else if (error_time != t) {
|
} else if (error_time != t) {
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
} else if (error_count++ > 2) {
|
} else if (error_count > 2) {
|
||||||
exit_server("looping in process()\n");
|
exit_server("looping in process()\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user