httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Wilson <and...@aaaaaaaa.demon.co.uk>
Subject Re: Bug on path fix....
Date Mon, 13 Jan 1997 18:48:54 GMT
This problem happens for FreeBSD-2.1.6.1 also.  Adding '|| errno
== ENOENT' fixes it.

>From FreeBSD's stat manpage:

ERRORS
     Stat() and lstat() will fail if:

     [ENOTDIR]       A component of the path prefix is not a directory.

     [EINVAL]        The pathname contains a character with the high-order bit
                     set.

     [ENAMETOOLONG]  A component of a pathname exceeded 255 characters, or an
                     entire path name exceeded 1023 characters.

     [ENOENT]        The named file does not exist.

     [EACCES]        Search permission is denied for a component of the path
                     prefix.

     [ELOOP]         Too many symbolic links were encountered in translating
                     the pathname.

     [EFAULT]        Sb or name points to an invalid address.

     [EIO]           An I/O error occurred while reading from or writing to
                     the file system.

     Fstat() will fail if:

     [EBADF]   fd is not a valid open file descriptor.

     [EFAULT]  Sb points to an invalid address.

     [EIO]     An I/O error occurred while reading from or writing to the file
               system.

Cheers,
Ay.

Marc Slemko:
> 
> Sigh.
> 
> It appears that you are correct.  This appears like it may be
> somewhat OS specific.  What OS are you running?
> 
> Thanks for reporting it.  Your fix looks good if it works for you,
> although it may need to be modified a little for portability.
> 
> On Mon, 13 Jan 1997, Frederico A. C. Neves wrote:
> 
> > 
> > 	Dear Marc Slemko,
> > 
> > 	I have to make a change on your path to work for me....
> > 	Please correct-me if i'm doing something wrong.
> > 
> > 	when you compare ....if (errno == ENOENT)... i change it for...
> > 
> > 	.....else if (errno == ENOENT || errno == ENOTDIR) {.....
> > 
> > 	if i don't do that the extra PATH_INFO that i past to my cgi's give me the error
on the next else statment because the stat function return errno = ENOTDIR /server-path/cgi-bin/mycgi/parameters...
> > 
> > 	following a patch for the http_request.c after your patch or for httpd-1.1.2
> > 
> > ---begin---
> > 183c183
> > <       else if (errno == ENOENT) {
> > ---
> > >       else if (errno == ENOENT || errno == ENOTDIR) {
> > 200c200
> > <           log_printf(r->server, "access to %s failed for client; unable
to determine if index file exists (stat() returned unexpected error)", r->filename);
> > ---
> > >           log_printf(r->server, "access to %s failed for client; unable
to determine if index file exists (stat() returned unexpected error %d)", r->filename,
errno);
> > --end---
> > 
> > 	Please report me any mistakes
> > 
> > 	Best Regards
> > 	Frederico Neves
> > 
> > -- 
> >  ----------------------------------------------------------------
> >  Frederico A. C. Neves         ExCon Consultoria em Sistemas Ltda
> >  <fneves@ExCon.com.BR>    Av.Dr.Jose Cesar de Oliveira 181 Cj.409
> >  Tel/Fax +55-11-833-0660      Sao Paulo - SP - Brazil - 05317-000 
> > 
> 
> 


-- 
Andrew.Wilson@cm.cf.ac.uk http://www.cm.cf.ac.uk/User/Andrew.Wilson/

Mime
View raw message