You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brad Nicholes <BN...@novell.com> on 2001/09/13 22:55:13 UTC

[PATCH] Relative server root...

   I would like to propose the following code changes for main.c.  These changes will allow a platform to use a relative server root that is based on argv[0] rather than a hard coded server root.  If these changes seem fair, I would like to check them in.

thanks,
Brad


Re: [PATCH] Relative server root...

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Take the argv[0] through

apr_filepath_merge(&server_root, "", argv[0], 0, global_pool)

so that we assure that the systemwide path is canonical, and I'm +1

Bill

----- Original Message -----
From: "Brad Nicholes" <BN...@novell.com>
To: <de...@httpd.apache.org>
Sent: Thursday, September 13, 2001 3:55 PM
Subject: [PATCH] Relative server root...


   I would like to propose the following code changes for main.c.  These changes will allow a platform to use a relative server root
that is based on argv[0] rather than a hard coded server root.  If these changes seem fair, I would like to check them in.

thanks,
Brad







Re: [PATCH] Relative server root...

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Ryan Bloom" <rb...@covalent.net>
Sent: Thursday, September 13, 2001 5:24 PM


> On Thursday 13 September 2001 01:55 pm, Brad Nicholes wrote:
> 
> I really dislike this.  Netware included a hack in 1.3 to use the argv from cwd.
> There are much cleaner ways to do this in 2.0.  Which MPM are you using?
> Why not just create a Netware specific module that has a rewrite_args
> function that sets ap_server_root to the correct argv?

This code will be duplicated across three or so platforms, for five or so MPM's.

This is the right solution to avoid unnecessary and error-prone redundancy, IMHO.

> This is what Windows does, and it does work.  This is also what Bill has been
> trying to explain to you.  Please look at server/mpm/winnt/mpm_winnt.c, for the
> function  winnt_rewrite_args.  You need to have your own MPM to make this
> work currently, but it would be a simple thing to make standard modules have
> access to the re-write args hook.

Yes - this works for win32, or any platform-specific MPM.  But Brad's solution
makes sense because unix is about the only platform that appears disinterested,
and I suspect that some unix folks might eventually apprecicate it.

Consider that someone suggested that the httpd support start|stop|restart|graceful 
options.  If we put the essential, basic features into httpd across platforms,
then others will profit.  I would still encourage folks to do anything unusual
through shell script/batch file helpers, but this patch is essentially useful.

Bill







Re: [PATCH] Relative server root...

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 13 September 2001 01:55 pm, Brad Nicholes wrote:

I really dislike this.  Netware included a hack in 1.3 to use the argv from cwd.
There are much cleaner ways to do this in 2.0.  Which MPM are you using?
Why not just create a Netware specific module that has a rewrite_args
function that sets ap_server_root to the correct argv?

This is what Windows does, and it does work.  This is also what Bill has been
trying to explain to you.  Please look at server/mpm/winnt/mpm_winnt.c, for the
function  winnt_rewrite_args.  You need to have your own MPM to make this
work currently, but it would be a simple thing to make standard modules have
access to the re-write args hook.

Ryan

>    I would like to propose the following code changes for main.c.  These
> changes will allow a platform to use a relative server root that is based
> on argv[0] rather than a hard coded server root.  If these changes seem
> fair, I would like to check them in.
>
> thanks,
> Brad

-- 

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------