httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: updated patch (was Re: renaming after-effects)
Date Mon, 13 Apr 1998 18:39:34 GMT


On 12 Apr 1998, Arnt Gulbrandsen wrote:

> +static const char *set_cookie_name(cmd_parms *parms, void *dummy,
> +				   const char *arg)
> +{
> +    const char * p;
> +    cookie_log_state *cls = ap_get_module_config(parms->server->module_config,
> +						 &usertrack_module);
> +
> +    for( p=arg; *p; p++ )
> +	if ( *p <= ' ' || *p >= (char)127 ||
> +	     *p == '(' || *p == ')' || *p == '<' || *p == '>' ||
> +	     *p == '@' || *p == ',' || *p == ';' || *p == ':' ||
> +	     *p == '\\' || *p == '"' || *p == '/' || *p == '[' ||
> +	     *p == ']' || *p == '?' || *p == '=' || *p == '{' )
> +	    return "bad cookie name; contains illegal character";
> +
> +    cls->name = ap_pstrdup( parms->pool, arg );
> +
> +    return NULL;
> +}

This isn't portable and re-encodes stuff which is already in util.c ...
you should consider creating a function ap_is_token() in util.c that uses
the TEST_CHAR stuff which you can find used in ap_find_token().

Dean




Mime
View raw message