summaryrefslogtreecommitdiff
path: root/source3/namedbname.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-08-17 14:27:12 +0000
committerAndrew Tridgell <tridge@samba.org>1996-08-17 14:27:12 +0000
commitefb8113d00a4513c1115640004c0905465d3b673 (patch)
tree13823188f1f1b05a4861611a806109d2281e6479 /source3/namedbname.c
parente351461e094a14caed31b7eae37e39d935d30561 (diff)
downloadsamba-efb8113d00a4513c1115640004c0905465d3b673.tar.gz
samba-efb8113d00a4513c1115640004c0905465d3b673.tar.bz2
samba-efb8113d00a4513c1115640004c0905465d3b673.zip
- made FAST_SHARE_MODES standard for Linux
- you can now press enter after a password prompt with "smbclient -L hostname" and it will use a blank username and password, the same as if you used -U% - changed the wins.dat store code to not go via a string variable (just use fprintf instead) - removed a "unsigned long" that luke put back in, changing it to uint32 to keep 64 bit machines happy. Naughtly luke! - allow guest non-connnected print queue listings so ms client 3 can work (This used to be commit 917160dee69bbc198985b6f3232ca2dcda809d8a)
Diffstat (limited to 'source3/namedbname.c')
-rw-r--r--source3/namedbname.c73
1 files changed, 32 insertions, 41 deletions
diff --git a/source3/namedbname.c b/source3/namedbname.c
index b8edfa2554..188e46ff75 100644
--- a/source3/namedbname.c
+++ b/source3/namedbname.c
@@ -230,8 +230,8 @@ void dump_names(void)
{
int i;
- DEBUG(3,("%15s ", inet_ntoa(d->bcast_ip)));
- DEBUG(3,("%15s ", inet_ntoa(d->mask_ip)));
+ DEBUG(3,("%15s ", inet_ntoa(d->bcast_ip)));
+ DEBUG(3,("%15s ", inet_ntoa(d->mask_ip)));
DEBUG(3,("%-19s TTL=%ld ",
namestr(&n->name),
n->death_time?n->death_time-t:0));
@@ -243,35 +243,29 @@ void dump_names(void)
n->ip_flgs[i].nb_flags));
}
- DEBUG(3,("\n"));
+ DEBUG(3,("\n"));
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
anything other than as a hexadecimal number :-) */
- sprintf(data, "%s#%02x %ld",
- n->name.name,n->name.name_type, /* XXXX ignore scope for now */
- n->death_time);
- fprintf(f, "%s", data);
+ fprintf(f,"%s#%02x %ld",
+ n->name.name,n->name.name_type, /* XXXX ignore scope for now */
+ n->death_time);
for (i = 0; i < n->num_ips; i++)
{
DEBUG(3,("%15s NB=%2x ",
- inet_ntoa(n->ip_flgs[i].ip),
- n->ip_flgs[i].nb_flags));
+ inet_ntoa(n->ip_flgs[i].ip),
+ n->ip_flgs[i].nb_flags));
- sprintf(data, "%s %2x ",
- inet_ntoa(n->ip_flgs[i].ip),
- n->ip_flgs[i].nb_flags);
-
- fprintf(f, "%s", data);
+ fprintf(f, "%s %2x ",
+ inet_ntoa(n->ip_flgs[i].ip),
+ n->ip_flgs[i].nb_flags);
}
- DEBUG(3,("\n"));
- fprintf(f, "\n");
+ DEBUG(3,("\n"));
+ fprintf(f, "\n");
}
-
}
fclose(f);
@@ -318,34 +312,31 @@ void load_netbios_names(void)
int type = 0;
int nb_flags;
time_t ttd;
- struct in_addr ipaddr;
-
- enum name_source source;
-
+ struct in_addr ipaddr;
+ enum name_source source;
char *ptr;
- int count = 0;
-
+ int count = 0;
char *p;
if (!fgets_slash(line,sizeof(pstring),f)) continue;
if (*line == '#') continue;
- ptr = line;
-
- if (next_token(&ptr,name_str ,NULL)) ++count;
- if (next_token(&ptr,ttd_str ,NULL)) ++count;
- if (next_token(&ptr,ip_str ,NULL)) ++count;
- if (next_token(&ptr,nb_flags_str,NULL)) ++count;
+ ptr = line;
- if (count <= 0) continue;
+ if (next_token(&ptr,name_str ,NULL)) ++count;
+ if (next_token(&ptr,ttd_str ,NULL)) ++count;
+ if (next_token(&ptr,ip_str ,NULL)) ++count;
+ if (next_token(&ptr,nb_flags_str,NULL)) ++count;
- if (count != 4) {
- DEBUG(0,("Ill formed wins line"));
- DEBUG(0,("[%s]: name#type ip nb_flags abs_time\n",line));
- continue;
- }
+ if (count <= 0) continue;
+ if (count != 4) {
+ DEBUG(0,("Ill formed wins line"));
+ DEBUG(0,("[%s]: name#type ip nb_flags abs_time\n",line));
+ continue;
+ }
+
/* netbios name. # divides the name from the type (hex): netbios#xx */
strcpy(name,name_str);
@@ -357,10 +348,10 @@ void load_netbios_names(void)
}
/* decode the netbios flags (hex) and the time-to-die (seconds) */
- sscanf(nb_flags_str,"%x",&nb_flags);
- sscanf(ttd_str,"%ld",&ttd);
+ sscanf(nb_flags_str,"%x",&nb_flags);
+ sscanf(ttd_str,"%ld",&ttd);
- ipaddr = *interpret_addr2(ip_str);
+ ipaddr = *interpret_addr2(ip_str);
if (ip_equal(ipaddr,ipzero)) {
source = SELF;
@@ -545,7 +536,7 @@ struct name_record *search_for_name(struct subnet_record **d,
if (!n)
{
struct in_addr dns_ip;
- unsigned long a;
+ uint32 a;
/* only do DNS lookups if the query is for type 0x20 or type 0x0 */
if (!dns_type && name_type != 0x1b)