Help with autoindex on; missing slash for directories

Igor Sysoev is at rambler-co.ru
Tue Oct 13 23:21:57 MSD 2009


On Tue, Jul 21, 2009 at 10:08:06PM +0400, Maxim Dounin wrote:

> Hello!
> 
> On Fri, Jul 17, 2009 at 03:14:35PM +0400, Igor Sysoev wrote:
> 
> > On Fri, Jul 17, 2009 at 07:01:00AM +0400, Maxim Dounin wrote:
> > 
> > > Hello!
> > > 
> > > On Thu, Jul 16, 2009 at 04:25:16PM -0700, Yazz D. Atlas wrote:
> > > 
> > > > Maxim,
> > > >
> > > > Ok finally added the patch with the I believe the right stuff. Attached 
> > > > is the patch and the log file.
> > > >
> > > > I just ran "GET http://localhost:88/static"
> > > 
> > > Ok, thanx.  According to
> > > 
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: ".svn", type 4
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: "questionnaires", type 10
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: "site", type 10
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: "50x.html", type 8
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: "rev.txt", type 8
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: ".", type 4
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: "protocols", type 10
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: "video", type 10
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: "..", type 4
> > > 2009/07/16 16:16:10 [debug] 20579#0: *2 http autoindex file: "content", type 10
> > > 
> > > the only directories here are '.svn', '.' and '..'.  It's symlinks 
> > > to directories that has no slash now.
> > > 
> > > I'll take a look how to fix this properly.
> > 
> > I've reproduced this bug on FreeBSD too. Will look how to resolve this.
> 
> Attached patch fixes the problem.  It also fixes typo (DT_LINK 
> instead of DT_LNK, not used in code) and removes Linux special 
> case as dirent.d_type may be unset on other systems too (e.g. 
> cd9660 on FreeBSD).
> 
> Also I've changed DT_UNKNOWN check to explicit one (instead of 
> implicitly checking for 0) - on all systems I've seen it's 0, but 
> AFAIK it's not guaranteed.
> 
> This patch was shamelessly tested with The CSRG Archives CD-ROM 1 
> as shipped by Marshall Kirk McKusick.  :)

Another patch version.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.autoindex.txt
Type: application/octet-stream
Size: 2916 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20091013/2e87b00d/attachment.obj>


More information about the nginx mailing list