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: "David J. MacKenzie" <[EMAIL PROTECTED]>,
        Apache bugs database <[EMAIL PROTECTED]>
Subject: Re: general/2117: The CIDR syntax support for allow and deny finds the 
'/' in comments.
Date: Wed, 22 Apr 1998 15:56:36 -0400 (EDT)

 On Wed, 22 Apr 1998 13:41:46 -0600 (MDT), Marc Slemko <[EMAIL PROTECTED]> said:
 
 > But the problem is that they aren't trailing comments; it just happens
 > that you have specified that access should be allowed from a certain set
 > of hostnames that you think should be a comment, but that Apache knows are
 > just a list of space delimited hostnames.  We could special-case the '#'
 > character or do more stringent checks for names that are valid in
 > hostnames, but that can get to be a pain. 
 
 Ah, I see!  Caught by surprise!  Don't special-case '#', but it's
 easy to write a function to tell whether a word could potentially
 be a valid hostname or IP address:
 
 int ap_hostname_syntax(char *s)
 {
     for (; *s; s++) {
        /* Allow : for IPv6.  */
        if (!isalnum(*s) && strchr("_-.:", *s) == NULL)
            return 0;
     }
     return 1;
 }
 
 I suggest using that where a valid hostname or IP address is required.

Reply via email to