apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: apr/threadproc/netware proc.c
Date Fri, 20 Dec 2002 19:08:01 GMT
bnicholes    2002/12/20 11:08:01

  Modified:    threadproc/netware proc.c
  Log:
  Make sure that the path to the current working directory and to the spawned
  NLM is fully qualified.
  
  Revision  Changes    Path
  1.16      +13 -5     apr/threadproc/netware/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apr/threadproc/netware/proc.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- proc.c	7 Nov 2002 19:50:04 -0000	1.15
  +++ proc.c	20 Dec 2002 19:08:01 -0000	1.16
  @@ -196,11 +196,8 @@
   APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, 
                                  const char *dir) 
   {
  -    attr->currdir = apr_pstrdup(attr->pool, dir);
  -    if (attr->currdir) {
  -        return APR_SUCCESS;
  -    }
  -    return APR_ENOMEM;
  +    return apr_filepath_merge(&attr->currdir, NULL, dir, 
  +                              APR_FILEPATH_NATIVE, attr->pool);
   }
   
   APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr,
  @@ -305,6 +302,17 @@
       newproc->err = attr->parent_err;
   
       addr_space = (attr->detached ? 0 : PROC_CURRENT_SPACE) | PROC_LOAD_SILENT;
  +
  +    if (attr->currdir) {
  +        char *fullpath = NULL;
  +        apr_status_t rv;
  +
  +        if ((rv = apr_filepath_merge(&fullpath, attr->currdir, progname, 
  +                                     APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) {
  +            return rv;
  +        }
  +        progname = fullpath;
  +    } 
   
       if ((newproc->pid = procve(progname, addr_space, (const char**)env, &wire, 
           NULL, NULL, 0, NULL, (const char **)args)) == 0) {
  
  
  

Mime
View raw message