mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
- fixed wins.dat reloading (it wasn't happening!)
- made nb_flags an unsigned 16 bit int in nameserv.h - nmbd was calling add_my_subnets() with an uninitialised parameter group. removed it. lkcl
This commit is contained in:
parent
917160dee6
commit
3d55e54156
@ -126,7 +126,7 @@ struct nmb_name {
|
|||||||
struct nmb_ip
|
struct nmb_ip
|
||||||
{
|
{
|
||||||
struct in_addr ip; /* ip address of host that owns this name */
|
struct in_addr ip; /* ip address of host that owns this name */
|
||||||
int nb_flags; /* netbios flags */
|
uint16 nb_flags; /* netbios flags */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* this is the structure used for the local netbios name list */
|
/* this is the structure used for the local netbios name list */
|
||||||
|
@ -247,25 +247,26 @@ void dump_names(void)
|
|||||||
|
|
||||||
if (f && ip_equal(d->bcast_ip, ipgrp) && n->source == REGISTER)
|
if (f && ip_equal(d->bcast_ip, ipgrp) && n->source == REGISTER)
|
||||||
{
|
{
|
||||||
|
fstring data;
|
||||||
|
|
||||||
/* XXXX i have little imagination as to how to output nb_flags as
|
/* XXXX i have little imagination as to how to output nb_flags as
|
||||||
anything other than as a hexadecimal number :-) */
|
anything other than as a hexadecimal number :-) */
|
||||||
|
|
||||||
fprintf(f,"%s#%02x %ld",
|
sprintf(data, "%s#%02x %ld ",
|
||||||
n->name.name,n->name.name_type, /* XXXX ignore scope for now */
|
n->name.name,n->name.name_type, /* XXXX ignore scope for now */
|
||||||
n->death_time);
|
n->death_time);
|
||||||
|
fprintf(f, "%s", data);
|
||||||
|
|
||||||
for (i = 0; i < n->num_ips; i++)
|
for (i = 0; i < n->num_ips; i++)
|
||||||
{
|
{
|
||||||
DEBUG(3,("%15s NB=%2x ",
|
sprintf(data, "%s %2x ",
|
||||||
inet_ntoa(n->ip_flgs[i].ip),
|
|
||||||
n->ip_flgs[i].nb_flags));
|
|
||||||
|
|
||||||
fprintf(f, "%s %2x ",
|
|
||||||
inet_ntoa(n->ip_flgs[i].ip),
|
inet_ntoa(n->ip_flgs[i].ip),
|
||||||
n->ip_flgs[i].nb_flags);
|
n->ip_flgs[i].nb_flags);
|
||||||
|
fprintf(f, "%s", data);
|
||||||
}
|
}
|
||||||
DEBUG(3,("\n"));
|
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
@ -310,12 +311,15 @@ void load_netbios_names(void)
|
|||||||
|
|
||||||
pstring name;
|
pstring name;
|
||||||
int type = 0;
|
int type = 0;
|
||||||
int nb_flags;
|
unsigned int nb_flags;
|
||||||
time_t ttd;
|
time_t ttd;
|
||||||
struct in_addr ipaddr;
|
struct in_addr ipaddr;
|
||||||
|
|
||||||
enum name_source source;
|
enum name_source source;
|
||||||
|
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if (!fgets_slash(line,sizeof(pstring),f)) continue;
|
if (!fgets_slash(line,sizeof(pstring),f)) continue;
|
||||||
@ -333,7 +337,7 @@ void load_netbios_names(void)
|
|||||||
|
|
||||||
if (count != 4) {
|
if (count != 4) {
|
||||||
DEBUG(0,("Ill formed wins line"));
|
DEBUG(0,("Ill formed wins line"));
|
||||||
DEBUG(0,("[%s]: name#type ip nb_flags abs_time\n",line));
|
DEBUG(0,("[%s]: name#type abs_time ip nb_flags\n",line));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,11 +365,11 @@ void load_netbios_names(void)
|
|||||||
source = REGISTER;
|
source = REGISTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(4, ("add WINS line: %s#%02x %s %ld %2x\n",
|
DEBUG(4, ("add WINS line: %s#%02x %ld %s %2x\n",
|
||||||
name,type, inet_ntoa(ipaddr), ttd, nb_flags));
|
name,type, ttd, inet_ntoa(ipaddr), nb_flags));
|
||||||
|
|
||||||
/* add all entries that have 60 seconds or more to live */
|
/* add all entries that have 60 seconds or more to live */
|
||||||
if (ttd - 60 < time(NULL) || ttd == 0)
|
if (ttd - 60 > time(NULL) || ttd == 0)
|
||||||
{
|
{
|
||||||
time_t t = (ttd?ttd-time(NULL):0) / 3;
|
time_t t = (ttd?ttd-time(NULL):0) / 3;
|
||||||
|
|
||||||
@ -536,7 +540,7 @@ struct name_record *search_for_name(struct subnet_record **d,
|
|||||||
if (!n)
|
if (!n)
|
||||||
{
|
{
|
||||||
struct in_addr dns_ip;
|
struct in_addr dns_ip;
|
||||||
uint32 a;
|
unsigned long a;
|
||||||
|
|
||||||
/* only do DNS lookups if the query is for type 0x20 or type 0x0 */
|
/* only do DNS lookups if the query is for type 0x20 or type 0x0 */
|
||||||
if (!dns_type && name_type != 0x1b)
|
if (!dns_type && name_type != 0x1b)
|
||||||
|
@ -410,7 +410,6 @@ static void usage(char *pname)
|
|||||||
int opt;
|
int opt;
|
||||||
extern FILE *dbf;
|
extern FILE *dbf;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
fstring group;
|
|
||||||
|
|
||||||
*host_file = 0;
|
*host_file = 0;
|
||||||
|
|
||||||
@ -498,9 +497,6 @@ static void usage(char *pname)
|
|||||||
|
|
||||||
set_samba_nb_type();
|
set_samba_nb_type();
|
||||||
|
|
||||||
if (*group)
|
|
||||||
add_my_subnets(group);
|
|
||||||
|
|
||||||
if (!is_daemon && !is_a_socket(0)) {
|
if (!is_daemon && !is_a_socket(0)) {
|
||||||
DEBUG(0,("standard input is not a socket, assuming -D option\n"));
|
DEBUG(0,("standard input is not a socket, assuming -D option\n"));
|
||||||
is_daemon = True;
|
is_daemon = True;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user