Jeff Trawick [Tue, 20 Jun 2000 19:36:50 +0000 (19:36 +0000)]
ap_create_pipe was changed to return a pipe with both handles
blocking (previously, both handles were non-blocking).
ap_set_pipe_timeout() is now the only way to manipulate the
blocking state of the pipe. Pass -1 for timeout to make it
blocking; pass 0 for timeout to make it non-blocking.
ap_block_pipe() is gone.
A few minor bugs were fixed along the way.
OS-specific notes:
non-Unix in general:
Only Unix/BeOS currently has the optimization to keep track of the blocking
state. This is used to avoid syscalls as well as to handle ap_put_os_file(),
which is a case where we don't know the blocking state of the handle we are
given.
OS/2:
ap_set_pipe_timeout() with timeout value > 0: The code didn't play with
the blocking state before and it doesn't still. I did add logic for special
timeout values 0 and -1 to play with the blocking state.
ap_create_pipe(): old logic didn't do anything with the blocking state
of the second handle; it still doesn't; hopefully it is blocking
pre-BONE BEOS:
old code to make a pipe non-blocking was a no-op; now it returns
APR_ENOTIMPL
BONE: old code to make a pipe non-blocking; it passed &zero as the
parm to FIONBIO instead of &one; this bug was fixed
Win32:
The pipe was always created blocking before; no change
previously, ap_setprocattr_io() ignored the blocking flag; now it
respects it like other platforms and calls ap_set_pipe_timeout(p,0)
on appropriate pipe handles (Bill Stoddard was just working in
ap_set_pipe_timeout(), so I presume this is golden)
Correct the problem where the only local host name that the IP stack
can discover are 'undotted' private names. If no fully qualified
domain name can be identified, the default ServerName will be set to
the machine's IP address string.
Ryan Bloom [Tue, 20 Jun 2000 19:16:18 +0000 (19:16 +0000)]
Remove unixd_detach function, because it is provided by APR as ap_detach.
This also modifies the ap_detach function to look like unixd_detach.
Finally all calls to unixd_detach are changed to ap_detach.
Jeff Trawick [Tue, 20 Jun 2000 11:31:54 +0000 (11:31 +0000)]
Use the new command-handler initializer macros in some more modules.
Unfortunately, the resulting warnings are *not* all cleaned up. Ten or
so warnings spill over to non-AP_DEBUG builds (but that just means that
there is a bigger pool of folks to resolve them, right?).
This Win32 patch adds the key HKCR/filetype/shell/execcgi/command as the
preference over the HKCR/filetype/shell/open/command for registry-based
script execution, allowing two behaviors to coexist peacefully (the pipe
based console behavior and the Win32 shell behavior.)
The new ScriptInterpreterSource registry-strict directive dismisses bth
the HKCR/filetype/shell/open/command and the shebang processing for
administrators who are interested in explicit authorization of file type
execution allowed in the context of subscriber-created scripts. The net
result: only HKCR/filetype/shell/execcgi/command processing is permitted.
1.3.x truncated any open/command arguments following the %1 arg.
so this patch adds the char** arguments to several functions
1.3.x did not expand environment strings (%userprofile% etc.)
*) This patch may still not do so, if we are running with a
subset of the 'normal' environment for security reasons.
1.3.x did not parse the extension itself (eg. the .pl key itself)
for the command, failing the 'named' type (eg. perlscript),
so this patch first tests the 'named' key, then the .ext key
Jeff Trawick [Mon, 19 Jun 2000 02:22:30 +0000 (02:22 +0000)]
Use the new command-handler initializer macros in dexter;
clean up the resulting warnings.
Fix minor glitch in previous changes to mpmt_pthread: the const-ness
of ap_scoreboard_fname wasn't consistent between mpmt_pthread.c and
scoreboard.c (of course, putting the decl in a header file would have
helped root this out earlier).
Jeff Trawick [Sun, 18 Jun 2000 03:05:41 +0000 (03:05 +0000)]
Make unixd_config.user_name const char * instead of char * to avoid
a warning when the set-user-name command handler saves the address of
the arg from the config file.
Time to jump back into 2.0 again... here are yesterday's updates to
the MSVC conversion scripts, since the old ones would occasional be
whacked. Again I ask, if you see better code here, please commit it.
Jeff Trawick [Sat, 17 Jun 2000 12:29:53 +0000 (12:29 +0000)]
Fill in missing implementations of AP_INIT_whatever for when
AP_DEBUG is not defined. Apache now compiles for me on FreeBSD
3.4 when AP_DEBUG isn't defined (albeit with a few warnings).
Greg Stein [Sat, 17 Jun 2000 01:29:29 +0000 (01:29 +0000)]
ap_bvputs() is a misnomer; introduce ap_bputstrs()
[todo: proxy and file_cache code should be updated for new name]
add ap_vbputstrs()
use ap_vbputstrs() from http_protocol.
use EOF in a few places, rather than the magic "-1" constant
Jeff Trawick [Fri, 16 Jun 2000 16:41:21 +0000 (16:41 +0000)]
Turn on buffering for config file reads. This is dependent on ap_fgets()
doing the right thing.
Brian Havard implemented buffering for ap_fgets() on Win32 recently; OS/2 had
it already. This provides it for Unix.
changes to ap_read(), ap_getc(), ap_fgets() for Unix:
1) this fixes a problem in where ap_open() where a lock is created for
non-buffered files
2) this fixes problems setting rv correctly in the ap_read() buffered
path
3) since ap_read() works as expected, it is possible to make ap_getc()
and ap_fgets() even smaller
4) ap_fgets() no longer cares about '\r'
Jeff Trawick [Fri, 16 Jun 2000 12:00:58 +0000 (12:00 +0000)]
Fix segfault when reporting this type of syntax error:
"</container> without matching <container> section", where
container is VirtualHost or Directory or whatever.
This was a path not covered by the fix in 2.0a4 to report
the proper line numbers (sorry!).
Jeff Trawick [Thu, 15 Jun 2000 13:42:01 +0000 (13:42 +0000)]
Include the proper header file (under X/Open, at least) for ntohs() in
a couple of modules. This lets us link-edit successfully again on OS/390.
(OS/390 only has the macro form of these functions.)
Tony Finch [Thu, 15 Jun 2000 00:56:37 +0000 (00:56 +0000)]
Prevent the source code for CGIs from being revealed when using
mod_vhost_alias and the CGI directory is under the document root
and a user makes a request like http://www.example.com//cgi-bin/cgi
as reported in <news:960999105.344321@ernani.logica.co.uk>
David Reid [Wed, 14 Jun 2000 00:17:21 +0000 (00:17 +0000)]
Tidy up the beos mpm by
- removing some unused variables
- correct a problem with pool allocations that killed the server
- add back the ap_lingering close call which I removed in error
just before going on holiday.
Bill Stoddard [Tue, 13 Jun 2000 14:09:22 +0000 (14:09 +0000)]
Add mpm.h to the src/modules/mpm/winnt directory (it's empty for now, but its presense
is required for http_core.c, et. al.). Update ApacheCore.dsp to pick it up in the
include path.
Ryan Bloom [Tue, 13 Jun 2000 01:22:06 +0000 (01:22 +0000)]
Fix the configuration process. If no modules are specified in a given
directory, then that directory is no longer added to the build process.
Also, I have added a .cvsignore to the file_cache directory and removed
a generated file from this directory. Finally, I have removed
some unnecessary checks from the config.m4 files.
Ryan Bloom [Mon, 12 Jun 2000 21:47:17 +0000 (21:47 +0000)]
Clean up a big chunk of ap_config.h. This basically stops ap_config.h from
including any files. Because of this change, other files must include
their own headers. I also cleaned up a couple of other bugs in some
modules because I had to compile them all.
I expect this to break multiple platforms, but this will be fixed over time.
The massive configure cleanup is almost done. I will go through the files
one more time after this commit.
Chuck Murcko [Mon, 12 Jun 2000 21:41:58 +0000 (21:41 +0000)]
New mod_proxy/mod_cache (file cache) for 2.0. This uses a caching API so
that shared mem, LDAP servers, DBs, etc. can also be used for proxy
caching. The caching API is very young, and subject to change as APR changes.
proxy_cache.c from the proxy subdir is no longer used.
Build with --enable-modules=proxy,cache
Lightly tested on Linux, no warranties expressed or implied yet.
This should be considered a *reference* proxy implementation for 2.0. What
actually ends up shipping with 2.0 is likely going to be rather different as
the redesign evolves. This may end up being the 2.0 backwards compatibility
workalike.
Modified to work with today's conf/build/layout scheme
Jeff Trawick [Mon, 12 Jun 2000 21:39:57 +0000 (21:39 +0000)]
Fix logging of errors creating the httpd.pid file.
perror() was converted to ap_log_error(), which will interpret the
specified APR error code properly.
The existing ap_log_error() call was changed so that the message is
formatted properly. Note that this call is made from the mpm after
we detach from the foreground process, so it can only appear in the
log.
Jeff Trawick [Mon, 12 Jun 2000 21:08:25 +0000 (21:08 +0000)]
Back out ap_set_default_perms(). Remove old logic to play with umask
around the creation of the httpd.pid file. Pass explicit permissions to
ap_open(), omitting write-ability except by the owning user. As always,
we end up with rw-r--r-- for the permissions unless the umask is something
unusual.
Note that the OS/2 and Win32 implementations of ap_open() ignore the
permissions parameter altogether.
Ryan Bloom [Mon, 12 Jun 2000 16:00:33 +0000 (16:00 +0000)]
Add a new function ap_set_default_fperms. This allows people to set the
umask to be used when creating files. This should change the permissions
of files created using APR_DEFAULT_OS. Also removed a warning introduced
with the sys/stat.h changes.
Ryan Bloom [Mon, 12 Jun 2000 15:29:09 +0000 (15:29 +0000)]
Remove the final vestiges of stat.h from Apache 2.0. All calls are now to
ap_stat. This also adds the new function ap_lstat(). This function is
analogous to lstat.
Jeff Trawick [Sun, 11 Jun 2000 22:06:57 +0000 (22:06 +0000)]
Fix a couple of problems with the pre/post config processing changes:
1) symptom: on system with bad/no DNS setup, ServerName isn't
processed so init fails
cause:
ap_fini_vhost_config() called before ap_process_config_tree(), so
ServerName was never stored in the config structure
2) symptom: on system with virtual hosts configured, SIGSEGV in
open_multi_logs()
cause:
the module configs for the virtual hosts haven't been merged in
yet, and open_multi_logs() gets NULL for the mod_log_config
configuration
This stuff needs to be cleaned up further, exploring the use of a
post-config hook for fixup_virtual_hosts(), ap_fini_vhost_config(),
and ap_sort_hooks(), getting a lot of logic out of main(), and
processing the config tree only once.
Ben Laurie [Sun, 11 Jun 2000 14:08:16 +0000 (14:08 +0000)]
Make "make depend" work - pending a real fix, that is. I did attempt to do this
properly, but that means some radical autoconf shit that is, once more, beyond
me.