Forwarding this to the proper list for you... and I'll personally look at
it this week as I review directory parsing throughout (particularly for
Apache 2.0).
Bill
----- Original Message -----
From: "gatorette" <[EMAIL PROTECTED]>
Newsgroups: comp.infosystems.www.servers.ms-windows
Sent: Monday, June 11, 2001 10:18 AM
Subject: Small patch for the vhost_alias module
> Running Apache 1.3.19 (going to 1.3.20 soon) on a Win2K Server box, I
> wanted to add dynamically configured virtual hosting through the
> vhost_alias module. After having compiled the module, I modified my
> 'httpd.conf' so that it would load it and I set up a
> 'VirtualDocumentRoot "d:/users/%1"'. To my surprise, Apache rejected
> my command with a "format string must start with '/' or be 'none'"
> error. Obviously the module was meant for *nix systems and not
> Windows!
>
> To solve this (small) bug I modified lightly the source code of the
> module so that, under Windows, it also accepts drive letters. I don't
> have time and knowledge to test it extensively, and it might not
> conform standard rules, but this solution works for me.
>
> *** In the file "mod_vhost_alias.c", modify the lines : *****
>
> if (*map != '/') {
> if (strcasecmp(map, "none")) {
> return "format string must start with '/' or be 'none'";
> }
> *pmap = NULL;
> *pmode = VHOST_ALIAS_NONE;
> return NULL;
> }
>
> *************************** To : *******************************
>
> if (*map != '/') {
> #ifdef WIN32
> if( strncasecmp( map+1, ":/", 2 ) ) {
> if (strcasecmp(map, "none")) {
> return "format string must start with 'drive:/' or '/' or be
> 'none'";
> }
> *pmap = NULL;
> *pmode = VHOST_ALIAS_NONE;
> return NULL;
> }
> #else
> if (strcasecmp(map, "none")) {
> return "format string must start with '/' or be 'none'";
> }
> *pmap = NULL;
> *pmode = VHOST_ALIAS_NONE;
> return NULL;
> #endif
> }
>
> ****************************************************************************
>
> What it does is extract the second and third letters of the parameter
> and check it is ':/' { 'strncasecmp( map+1, ":/", 2 )' }.
>
> I'm waiting for your comments!
>
>
> -----------
> <add traditional disclaimer here />