httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: cvs commit: apache-1.3/src/main util.c
Date Mon, 01 Jun 1998 18:32:44 GMT
Marc Slemko wrote:
> 
> Or do we want to have both /dev/null and nul be special cased so that on
> both platforms they act as an empty file even if they don't exist on the
> platform?  The reason for this is cross-platform portability of configs,
> especially htaccess files.

I was thinking the main reason for doing it this way is that
the code kinda clearly spells out that there are only 2 valid device
files for config-files: 'nul' for Win32/NT and /dev/null for everything
else. I was thinking about creating a NULLDEVFILE #define but that
seemed a bit much for all this.

Recall that no matter what, they must be "non-regular" files...

> 
> The real solution to avoid needing this is to have a separate special name
> that does this, but...
> 
> On 1 Jun 1998 jim@hyperreal.org wrote:
> 
> > jim         98/06/01 11:20:31
> > 
> >   Modified:    src/main util.c
> >   Log:
> >   WIN32/NT uses 'nul' as it's universal
> >   '/dev/null' file, so we should special-case that for valid config-file
> >   device files
> >   
> >   Revision  Changes    Path
> >   1.118     +7 -3      apache-1.3/src/main/util.c
> >   
> >   Index: util.c
> >   ===================================================================
> >   RCS file: /export/home/cvs/apache-1.3/src/main/util.c,v
> >   retrieving revision 1.117
> >   retrieving revision 1.118
> >   diff -u -r1.117 -r1.118
> >   --- util.c	1998/05/28 19:57:11	1.117
> >   +++ util.c	1998/06/01 18:20:30	1.118
> >   @@ -753,9 +753,13 @@
> >        if (file == NULL)
> >            return NULL;
> >    
> >   -    if (strcmp(name, "/dev/null") != 0 &&
> >   -        fstat(fileno(file), &stbuf) == 0 &&
> >   -        !S_ISREG(stbuf.st_mode)) {
> >   +    if (fstat(fileno(file), &stbuf) == 0 &&
> >   +        !S_ISREG(stbuf.st_mode) &&
> >   +#ifdef WIN32
> >   +        strcasecmp(name, "nul") != 0) {
> >   +#else
> >   +        strcmp(name, "/dev/null") != 0) {
> >   +#endif
> >            ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, NULL,
> >                        "Access to file %s denied by server: not a regular file",
> >                        name);
> >   
> >   
> >   
> > 
> 
> 


-- 
===========================================================================
   Jim Jagielski   |||   jim@jaguNET.com   |||   http://www.jaguNET.com/
            "That's no ordinary rabbit... that's the most foul,
            cruel and bad-tempered rodent you ever laid eyes on"

Mime
View raw message