httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Parzygnat" <kp...@raleigh.ibm.com>
Subject [PATCH] Win32: nul pseudofile
Date Tue, 20 Oct 1998 15:08:35 GMT
As described in PR 2708, if you specify:
AccessConfig nul
on Win32, Apache quits with the error message like:
httpd:  could not open document config file d:/apache/nul

There is already a check in ap_pcfg_openfile for
nul, but it only checks for the string "nul".  This is not
quite sufficient because d:/apache/nul is just as good
as nul on Win32.  ap_process_resource_config
calls ap_server_root_relative to make the conf name
relative to the server root if it is not already; hence,
giving you d:/apache/nul

--- util.c.b42708	Mon Oct 19 19:13:41 1998
+++ util.c	Tue Oct 20 14:36:34 1998
@@ -767,7 +767,9 @@
     if (fstat(fileno(file), &stbuf) == 0 &&
         !S_ISREG(stbuf.st_mode) &&
 #ifdef WIN32
-        strcasecmp(name, "nul") != 0) {
+        !(strcasecmp(name, "nul") == 0 ||
+          (strlen(name) >= 4 &&
+           strcasecmp(name+strlen(name)-4, "/nul") == 0))) {
 #else
         strcmp(name, "/dev/null") != 0) {
 #endif

- - - - - - - - - - - - - - - - - -
Ken Parzygnat
email: kparz@raleigh.ibm.com 









--------------------------------------------------------------------------------
Users of the Apache webserver are hereby granted a non-exclusive, irrevocable,
world-wide, royalty-free, non-transferable license to use, execute, prepare
derivative works of, and distribute (internally and externally, and including
derivative works) the code accompanying this license as part of, and
integrated into the Apache webserver.  This code is provided "AS IS" WITHOUT
WARRANTY OF ANY KIND EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
AND ANY WARRANTY OF NON-INFRINGEMENT.  THE ENTIRE RISK ARISING OUT OF THE USE
OR PERFORMANCE OF THIS CODE REMAINS WITH USERS OF THE APACHE WEBSERVER.  The
owner of this code represents and warrants that it is legally entitled to
grant the above license.

Mime
View raw message