Cheers Ryan, that was the function I was looking for. :P
The patch has now been updated to use the apr_tokenize_to_argv function.
Tested and working fine on RH7.1.
Incidentally, what is the best source of documentation/information on the
apr and apr-utils supplied functions? I'm currently using a combination of
grep'ing the source and the docs at http://apr.apache.org/docs/apr-util/
and http://apr.apache.org/docs/apr/ -- I don't know how I managed to miss
that function at the bottom of the page. /me shrugs
Cheers,
JT
>>See bugzilla id #8464 for details....
> There is a function, tokenize_to_argv, which given a string, will pass
> back an argv array. If we use that, then we get the ability to quote
> the arguments, and there is less duplicate code. Please re-submit with
> that change, and I will apply the patch.
>
> Ryan
--
+------------------------------------+------------------------------------+
| James Tait | ICQ# 17834893 |
| MUD programmer and Linux advocate | http://www.wyrddreams.demon.co.uk/ |
+------------------------------------+------------------------------------+
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
--- ../httpd-2.0.36-unmodified/modules/mappers/mod_rewrite.c Mon Apr 22 11:27:01
2002
+++ modules/mappers/mod_rewrite.c Mon May 27 17:53:30 2002
@@ -3370,20 +3370,23 @@
apr_status_t rc;
apr_procattr_t *procattr;
apr_proc_t *procnew;
+ char **args;
+
+ rc = apr_tokenize_to_argv(progname, &args, p);
if (((rc = apr_procattr_create(&procattr, p)) != APR_SUCCESS) ||
((rc = apr_procattr_io_set(procattr, APR_FULL_BLOCK,
APR_FULL_NONBLOCK,
APR_FULL_NONBLOCK)) != APR_SUCCESS) ||
((rc = apr_procattr_dir_set(procattr,
- ap_make_dirstr_parent(p, progname)))
+ ap_make_dirstr_parent(p, args[0])))
!= APR_SUCCESS) ||
((rc = apr_procattr_cmdtype_set(procattr, APR_PROGRAM)) != APR_SUCCESS)) {
/* Something bad happened, give up and go away. */
}
else {
procnew = apr_pcalloc(p, sizeof(*procnew));
- rc = apr_proc_create(procnew, progname, NULL, NULL, procattr, p);
+ rc = apr_proc_create(procnew, args[0], (const char **)args, NULL, procattr,
+p);
if (rc == APR_SUCCESS) {
apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT);