Welcome! Log In Create A New Profile

Advanced

Re: Help with autoindex on; missing slash for directories

All files from this thread

File Name File Size   Posted by Date  
include-dirent-x86_64.tar.gz 3.6 KB open | download Yazz Atlas 07/02/2009 Read message
patch-nginx-debug-autoindex.txt 552 bytes open | download Maxim Dounin 07/02/2009 Read message
patch.autoindex.txt 2.8 KB open | download Igor Sysoev 10/13/2009 Read message
Maxim Dounin
October 13, 2009 08:52PM
Hello!

On Tue, Oct 13, 2009 at 11:21:57PM +0400, Igor Sysoev wrote:

> 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/

> Index: src/http/modules/ngx_http_random_index_module.c
> ===================================================================
> --- src/http/modules/ngx_http_random_index_module.c (revision 2519)
> +++ src/http/modules/ngx_http_random_index_module.c (working copy)
> @@ -175,7 +175,7 @@
>
> len = ngx_de_namelen(&dir);
>
> - if (!dir.valid_type) {
> + if (dir.type == 0) {

Oh, I somehow missed random index module.

But please note that it's currently broken for symlinks and this
patch doesn't fix it - links to files won't pass this check, and
will be ignored by ngx_de_is_file() test later.

Otherwise looks good and fixes autoindex issue as originally
reported.

Maxim Dounin

p.s. Just a quick note: I've added autoindex and random index
tests to test suite, with currently broken tests marked as TODO.
Subject Author Posted

Help with autoindex on; missing slash for directories

Yazz Atlas July 01, 2009 02:09AM

Re: Help with autoindex on; missing slash for directories

Maxim Dounin July 01, 2009 05:30AM

Re: Help with autoindex on; missing slash for directories

Yazz Atlas July 01, 2009 12:48PM

Re: Help with autoindex on; missing slash for directories

Maxim Dounin July 01, 2009 06:53PM

Re: Help with autoindex on; missing slash for directories Attachments

Yazz Atlas July 02, 2009 02:01PM

Re: Help with autoindex on; missing slash for directories Attachments

Maxim Dounin July 02, 2009 03:22PM

Re: Help with autoindex on; missing slash for directories

Joshua Zhu July 02, 2009 11:55PM

Re: Help with autoindex on; missing slash for directories

Maxim Dounin July 03, 2009 04:49AM

Re: Help with autoindex on; missing slash for directories

Yazz D. Atlas July 16, 2009 07:25PM

Re: Help with autoindex on; missing slash for directories

Maxim Dounin July 16, 2009 11:01PM

Re: Help with autoindex on; missing slash for directories

Igor Sysoev July 17, 2009 07:14AM

Re: Help with autoindex on; missing slash for directories

Maxim Dounin July 21, 2009 02:08PM

Re: Help with autoindex on; missing slash for directories

chris_14278 October 13, 2009 02:07AM

Re: Help with autoindex on; missing slash for directories Attachments

Igor Sysoev October 13, 2009 03:30PM

Re: Help with autoindex on; missing slash for directories

Maxim Dounin October 13, 2009 08:52PM

Re: Help with autoindex on; missing slash for directories

Igor Sysoev October 14, 2009 07:32AM

Re: Help with autoindex on; missing slash for directories

Maxim Dounin October 14, 2009 08:30AM

Re: Help with autoindex on; missing slash for directories

Igor Sysoev October 14, 2009 08:48AM

Re: Help with autoindex on; missing slash for directories

Maxim Dounin October 14, 2009 09:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready