www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David J. MacKenzie" <...@va.pubnix.com>
Subject Re: general/2117: The CIDR syntax support for allow and deny finds the '/' in comments.
Date Wed, 22 Apr 1998 20:00:00 GMT
The following reply was made to PR general/2117; it has been noted by GNATS.

From: "David J. MacKenzie" <djm@va.pubnix.com>
To: Marc Slemko <marcs@znep.com>
Cc: "David J. MacKenzie" <djm@va.pubnix.com>,
        Apache bugs database <apbugs@apache.org>
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 <marcs@znep.com> 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.

Mime
View raw message