The following reply was made to PR general/2117; it has been noted by GNATS.

From: "David J. MacKenzie" <[EMAIL PROTECTED]>
To: Marc Slemko <[EMAIL PROTECTED]>
Cc: Apache bugs database <[EMAIL PROTECTED]>,
        "David J. MacKenzie" <[EMAIL PROTECTED]>
Subject: Re: general/2117: The CIDR syntax support for allow and deny finds the 
'/' in comments.
Date: Wed, 22 Apr 1998 16:01:24 -0400 (EDT)

 I wrote:
 
 int ap_hostname_syntax(char *s)
 {
     for (; *s; s++) {
        /* Allow : for IPv6.  */
        if (!isalnum(*s) && strchr("_-.:", *s) == NULL)
            return 0;
     }
     return 1;
 }
 
 Include a "/" in the strchr argument if you want to allow netmask
 specification, too.... or else split up the IP addr from the host
 before calling this.  It's not perfect, but it will help diagnose
 errors such as our staff made.  Or you could even have a function that
 takes a hostname or IP address or network number plus optional netmask,
 and returns a magic token or two depending on what sort of thing it
 determined it got passed.  I haven't looked, but you must have some
 code like that already.  It just needs to be more careful about what
 it accepts as a hostname... there's an RFC that specifies what
 characters can be in valid Internet hostnames.
 

Reply via email to