Dynamically allocate the AF_UNIX sockaddr based on the required filename size.
For some platforms (e.g., Solaris, OS X, FreeBSD), this allows longer
socket filenames to be used.
When the name is too long, the failure reporting is more consistent and a
socket with truncated pathname is not left stranded. The user still needs
to use ScriptSock to specify a shorter name.
An extra unlink() failure message may be generated when attempting to clean
up the socket after a daemon initialization error; the message is surpressed
for ENOTENT, but not for ENAMETOOLONG.
PR: 47037
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@765725 13f79535-47bb-0310-9956-ffa450edef68
mod_cgid and request processing threads, for OS'es such as HPUX and AIX
that do not use umask for AF_UNIX socket permissions.
[Eric Covener, Jeff Trawick]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@654332 13f79535-47bb-0310-9956-ffa450edef68
script process wasn't created (storing 0 for the pid in that case).
Otherwise, the remembered pid is that of the last successful script
execution for this hash key.
Prior to this patch, the wrong process could be terminated in
rare circumstances:
- A CGI process with pid 10101 is forked for connection 99.
- After the CGI exits and some time elapses, some other process gets
pid 10101. (Connection 99 hasn't handled another CGI request yet.)
- The next time connection 99 has a CGI process, the fork()
or other early setup fails, so no CGI process is created.
- The remembered pid for connection 99 is still 10101. It
gets terminated (subject to permissions).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@503340 13f79535-47bb-0310-9956-ffa450edef68
respond to OPTIONS directly rather than via server default.
PR: 15242
Reviewed-by: Paul Querna, Andre Malo, William A. Rowe, Jr.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@326255 13f79535-47bb-0310-9956-ffa450edef68
a function I think, especially with the fact that
the mapping of getpid() to APR_PID_T_FMT isn't
consistant in some areas.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265506 13f79535-47bb-0310-9956-ffa450edef68
Instead of using mod_userdir and mod_suexec specific hacks, we now run the hook
on the httpd side of the handler.
If this is NULL, we pass on a magic empty_ugid constant, otherwise pass on the
real ugid.
On the cgid side of the equation, we add our own hook, with REALLY_FIRST, and
then order the hooks. This ensures that cgid's doer runs before any other
registered get_suexec_identity doers.
We use cgid's request config to store the ugid. If ugid == empty_ugid, we DON'T
call ap_os_create_privileged_process, because our doer would return the magic
empty_ugid constant. Having the doer return NULL is no good, because then
userdir and mod_suexec's doers would be called. Instead, we call plain old
apr_proc_create().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@264759 13f79535-47bb-0310-9956-ffa450edef68
invoked cgi application, to conform to the behavior of mod_cgi.
PR: 34542
Reviewed by: Andre, OtherBill
Submitted by: Pradeep Kumar S <pradeep.smani gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@264623 13f79535-47bb-0310-9956-ffa450edef68
running instances of httpd will not clobber each others script sockets.
Because a different socket will be created for each instance, this change also
unlinks the script-socket on exit, to prevent pollution.
unlink() happens from within the parent process, since the change in userid's
means the cgid process likely won't have the correct permissions.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240044 13f79535-47bb-0310-9956-ffa450edef68
Don't place script socket inside default server root instead of
actual server root.
The sock name was being stored in the server config, though it
was not specific to a server.
ap_server_root_relative() was being used prior to config processing,
so it was always picking up the default server root.
PR: 27886
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103184 13f79535-47bb-0310-9956-ffa450edef68