problem with only_ipaddrs_in_list in access.c

Tom Gasaway tdg at lucent.com
Fri Apr 27 04:07:53 GMT 2001


I found a problem with only_ipaddrs_in_list in lib/access.c in version 2.2.0.
I am running redhat 6.2 with kernel 2.2.16 with gcc egcs-2.91.66.  I am using 
the configuration parameter "allow hosts" with names instead of IP addresses.  
When only_ipaddrs_in_list() determines that one of the strings of "allow hosts"
is not an IP address it then attempts to verify that it is not a 
network/netmask pair by looking for a '/' by using strtok().  I had 
to change mine to strchr().

I hope this helps...

Tom Gasaway
tdg at lucent.com


diff -u access.sav access.c
--- access.sav  Thu Apr 26 16:38:25 2001
+++ access.c    Thu Apr 26 16:39:01 2001
@@ -266,7 +266,7 @@
                         * was a network/netmask pair.  Only network/netmask pairs
                         * have a '/' in them
                         */
-                       if ((p=strtok(tok, "/")) == NULL)
+                       if ((p=strchr(tok, '/')) == NULL)
                        {
                                only_ip = False;
                                DEBUG(3,("only_ipaddrs_in_list: list [%s] has non-ip address %s\n",
list, p));




More information about the samba mailing list