You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2006/03/05 05:34:41 UTC

[jira] Closed: (MODPYTHON-4) Bug in setting up of config_dir from Handler directives.

     [ http://issues.apache.org/jira/browse/MODPYTHON-4?page=all ]
     
Graham Dumpleton closed MODPYTHON-4:
------------------------------------


> Bug in setting up of config_dir from Handler  directives.
> ---------------------------------------------------------
>
>          Key: MODPYTHON-4
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-4
>      Project: mod_python
>         Type: Bug
>     Versions: 3.1.3
>  Environment: Win32
>     Reporter: Graham Dumpleton
>     Assignee: Nicolas Lehuen
>     Priority: Minor
>      Fix For: 3.2.7

>
> The problem is that mod_python doesn't seem to take into account that the
> directory is given to it by Apache in POSIX directory naming convention.
> Instead, because mod_python knows it is on Win32, it looks for a trailing '\'
> and since it doesn't see one, because it is actually '/', it goes and adds a '\'.
> The code in mod_python.c is:
> static void *python_create_dir_config(apr_pool_t *p, char *dir)  
> {
>  
>     py_config *conf = python_create_config(p);
>  
>     /* make sure directory ends with a slash */
>     if (dir && (dir[strlen(dir) - 1] != SLASH)) 
>         conf->config_dir = apr_pstrcat(p, dir, SLASH_S, NULL);
>     else
>         conf->config_dir = apr_pstrdup(p, dir);
>  
>     return conf;
> }
> It should in this case ignore whether it is on Win32 and instead use:
> static void *python_create_dir_config(apr_pool_t *p, char *dir)  
> {
>  
>     py_config *conf = python_create_config(p);
>  
>     /* make sure directory ends with a slash */
>     if (dir && (dir[strlen(dir) - 1] != '/')) 
>         conf->config_dir = apr_pstrcat(p, dir, "/", NULL);
>     else
>         conf->config_dir = apr_pstrdup(p, dir);
>  
>     return conf;
> }
> Code change not personally tested as don't have Win32 machine.
> See thread on mailing list for full discussion of issue.
>   http://www.modpython.org/pipermail/mod_python/2004-November/016784.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira