You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ken Parzygnat <kp...@raleigh.ibm.com> on 1998/10/20 17:08:35 UTC

[PATCH] Win32: nul pseudofile

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.

Re: [PATCH] Win32: nul pseudofile

Posted by Martin Kraemer <ma...@mch.sni.de>.
On Tue, Oct 20, 1998 at 11:08:35AM -0400, Ken Parzygnat wrote:
> 
> --- util.c.b42708	Mon Oct 19 19:13:41 1998
> +++ util.c	Tue Oct 20 14:36:34 1998
> @@ -767,7 +767,9 @@
>  #ifdef WIN32
> -        strcasecmp(name, "nul") != 0) {
> +        !(strcasecmp(name, "nul") == 0 ||
> +          (strlen(name) >= 4 &&
> +           strcasecmp(name+strlen(name)-4, "/nul") == 0))) {

Makes sense to me. +1 (untested).

    Martin
-- 
<Ma...@Mch.SNI.De>      |        Siemens Information and
Phone: +49-89-636-46021          |        Communication  Products
FAX:   +49-89-636-47816          |        81730  Munich,  Germany