summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-08-16 13:03:26 +0000
committerAndrew Tridgell <tridge@samba.org>1996-08-16 13:03:26 +0000
commitf63d4c830aa88d20ababe4c3543bff7becc3a506 (patch)
tree286125d72593631440f3b92c85dac62b3ec2e42f /source3/lib
parentb990567a8c8afe8a085eb7865c7704925334a4b5 (diff)
downloadsamba-f63d4c830aa88d20ababe4c3543bff7becc3a506.tar.gz
samba-f63d4c830aa88d20ababe4c3543bff7becc3a506.tar.bz2
samba-f63d4c830aa88d20ababe4c3543bff7becc3a506.zip
- added the "remote announce" option
- made the lp_string() code able to handle any length string - got rid of the obsolete lmhosts code, instead users should use "interfaces" and "remote announce". lmhosts now is just used as a IP to netbios name map - cleanup the inet_address() code (This used to be commit be2b67940302b2e63890cb865fe3948c2206ea91)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 5b765e0ac6..aeaac29ae1 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2889,15 +2889,22 @@ uint32 interpret_addr(char *str)
{
struct hostent *hp;
uint32 res;
+ int i;
+ BOOL pure_address = True;
if (strcmp(str,"0.0.0.0") == 0) return(0);
if (strcmp(str,"255.255.255.255") == 0) return(0xFFFFFFFF);
+ for (i=0; pure_address && str[i]; i++)
+ if (!(isdigit(str[i]) || str[i] == '.'))
+ pure_address = False;
+
/* if it's in the form of an IP address then get the lib to interpret it */
- if (isdigit(str[0])) {
+ if (pure_address) {
res = inet_addr(str);
} else {
- /* otherwise assume it's a network name of some sort and use Get_Hostbyname */
+ /* otherwise assume it's a network name of some sort and use
+ Get_Hostbyname */
if ((hp = Get_Hostbyname(str)) == 0) {
DEBUG(3,("Get_Hostbyname: Unknown host. %s\n",str));
return 0;