From: Gustaf N. <ne...@wu...> - 2015-07-29 12:59:38
|
Hi David, i see nothing wrong and no bad side effects with this change. please make a pull request -g Am 23.07.15 um 10:46 schrieb David Osborne: > Hi, > > I came across this while trying to turn fastpath directorylisting off. > From the docs: > > directorylisting > > Style of directory listings, Can be *fancy* or *simple*. (string, > defaults to simple) > > directoryproc > > Name of Tcl proc to use to display directory listings. One can > either specify *directoryproc*, or *directoryadp*, but not both. > (string, defaults to _ns_dirlist) > > > The docs don't explicitly say how to disable them as far as I can see. > But fastpath.tcl seems to default to a value of "none" if no config > value is set. > Should Naviserver support this value explicitly? > > I tried: > > ns_param directorylisting none > > This then gave be a Tcl error: > > invalid command name "none" > while executing > "none" > while executing callback > ns:tclrequest none > (context: request proc) > > It seems the value "none" is being used as the directoryproc. When > directoryproc is not set, and directorylisting is not "simple" or > "fancy", dirproc is set to p which will be "none": > > p = Ns_ConfigString(path, "directorylisting", "simple"); > if (p != NULL && (STREQ(p, "simple") || STREQ(p, "fancy"))) { > p = "_ns_dirlist"; > } > servPtr->fastpath.dirproc = Ns_ConfigString(path, "directoryproc", p); > > To make fastpath return a 404 instead of a dir listing I needed both : > > ns_param directorylisting none > ns_param directoryproc _ns_dirlist > > Is there another way of doing this? > Strikes me that directoryproc should default to _ns_dirlist no matter > what directorylisting is set to? > Could naviserver drop this check in fastpath.c, and leave the default > value of directorylisting to be set in fastpath.tcl as in the > following commit? > > https://bitbucket.org/davidqc/naviserver/commits/afd8de3e5bdc6813ab49c6bc5713faeaaf68b854 > > Regards, > -- > David Osborne > Qcode Software Limited > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel -- Univ.Prof. Dr. Gustaf Neumann WU Vienna Institute of Information Systems and New Media Welthandelsplatz 1, A-1020 Vienna, Austria |