httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: cvs commit: apache-1.3/src/main util.c
Date Mon, 01 Jun 1998 18:24:06 GMT
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.

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);
>   
>   
>   
> 


Mime
View raw message