diff options
author | Jeremy Allison <jra@samba.org> | 2001-06-18 17:56:44 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-06-18 17:56:44 +0000 |
commit | 4379023a4f1b56ed4f282cf8423be959b88ab46d (patch) | |
tree | ea6f14dc6e4c864637cad5a4695b34333376dff9 /source/lib/util.c | |
parent | fefc9afea6b2e3a557b5e13cfb01837f3c51ef15 (diff) | |
download | samba-4379023a4f1b56ed4f282cf8423be959b88ab46d.tar.gz samba-4379023a4f1b56ed4f282cf8423be959b88ab46d.tar.xz samba-4379023a4f1b56ed4f282cf8423be959b88ab46d.zip |
Fixes backported from HEAD to get rid of gethostbyname stuff.
Added "Jim McDonough" <jmcd@us.ibm.com> fixes for directory ACL get/set
from Win9x.
Jeremy.
Diffstat (limited to 'source/lib/util.c')
-rw-r--r-- | source/lib/util.c | 69 |
1 files changed, 4 insertions, 65 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index b3eef430f11..0c0d3f70a7c 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -803,13 +803,13 @@ uint32 interpret_addr(char *str) res = inet_addr(str); } else { /* 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)); + sys_gethostbyname */ + if ((hp = sys_gethostbyname(str)) == 0) { + DEBUG(3,("sys_gethostbyname: Unknown host. %s\n",str)); return 0; } if(hp->h_addr == NULL) { - DEBUG(3,("Get_Hostbyname: host address is invalid for host %s\n",str)); + DEBUG(3,("sys_gethostbyname: host address is invalid for host %s\n",str)); return 0; } putip((char *)&res,(char *)hp->h_addr); @@ -996,67 +996,6 @@ BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask) /**************************************************************************** -a wrapper for gethostbyname() that tries with all lower and all upper case -if the initial name fails -****************************************************************************/ -struct hostent *Get_Hostbyname(const char *name) -{ - char *name2 = strdup(name); - struct hostent *ret; - - if (!name2) - { - DEBUG(0,("Memory allocation error in Get_Hostbyname! panic\n")); - exit(0); - } - - - /* - * This next test is redundent and causes some systems (with - * broken isalnum() calls) problems. - * JRA. - */ - -#if 0 - if (!isalnum(*name2)) - { - free(name2); - return(NULL); - } -#endif /* 0 */ - - ret = sys_gethostbyname(name2); - if (ret != NULL) - { - free(name2); - return(ret); - } - - /* try with all lowercase */ - strlower(name2); - ret = sys_gethostbyname(name2); - if (ret != NULL) - { - free(name2); - return(ret); - } - - /* try with all uppercase */ - strupper(name2); - ret = sys_gethostbyname(name2); - if (ret != NULL) - { - free(name2); - return(ret); - } - - /* nothing works :-( */ - free(name2); - return(NULL); -} - - -/**************************************************************************** check if a process exists. Does this work on all unixes? ****************************************************************************/ |