Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 91890 invoked by uid 500); 21 Nov 2002 09:29:48 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 91874 invoked from network); 21 Nov 2002 09:29:47 -0000 Date: Thu, 21 Nov 2002 09:29:58 +0000 From: Francis Daly To: dev@httpd.apache.org Subject: Re: [PATCH] IndexResults for mod_autoindex Message-ID: <20021121092958.GA24473@kerna.ie> References: <20021121090935.GA24371@kerna.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021121090935.GA24371@kerna.ie> User-Agent: Mutt/1.4i X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Thu, Nov 21, 2002 at 09:09:35AM +0000, Francis Daly wrote: > There are two further optional code patches to follow, which are only > useful if something similar to these are accepted. Here come the patches... The first changes the icon presented in the mod_autoindex listing (if FancyIndexing is on) to the whatever is set for ^^UNAUTHORIZED^^ or, failing that, the default. (The final patch is a docs patch for that magic string.) The second additionally hides details like file size and modification time from unauthorized requesters. If they want that info, they can HEAD the resource with credentials, or just request the directory index with credentials. The first patch is probably useful. The second is possibly unnecessary. I like them both. Neither are required. All are against the as-patched-in-previous-mail versions, although they should be trivial to modify if those patches are changed before being accepted. All the best, f -- Francis Daly deva@daoine.org --- modules/generators/mod_autoindex.c 21 Nov 2002 02:35:54 -0000 +++ modules/generators/mod_autoindex.c 21 Nov 2002 02:40:23 -0000 @@ -1468,6 +1468,11 @@ p->ascending = (apr_toupper(direction) == D_ASCENDING); p->version_sort = !!(autoindex_opts & VERSION_SORT); + /* Change to the "UNAUTHORIZED" icon, if appropriate */ + if (rr->status == HTTP_UNAUTHORIZED) { + rr->filename = "^^UNAUTHORIZED^^"; + } + if (autoindex_opts & (FANCY_INDEXING | TABLE_INDEXING)) { p->lm = rr->finfo.mtime; if (dirent->filetype == APR_DIR) { --- modules/generators//mod_autoindex.c 21 Nov 2002 02:40:23 -0000 +++ modules/generators//mod_autoindex.c 21 Nov 2002 02:41:24 -0000 @@ -1468,9 +1468,12 @@ p->ascending = (apr_toupper(direction) == D_ASCENDING); p->version_sort = !!(autoindex_opts & VERSION_SORT); - /* Change to the "UNAUTHORIZED" icon, if appropriate */ + /* Change to the "UNAUTHORIZED" icon, if appropriate. + And conceal details which people don't need until they authenticate */ if (rr->status == HTTP_UNAUTHORIZED) { rr->filename = "^^UNAUTHORIZED^^"; + rr->finfo.mtime = -1; + rr->finfo.size = -1; } if (autoindex_opts & (FANCY_INDEXING | TABLE_INDEXING)) { --- mod_autoindex.xml.new Thu Nov 21 09:27:14 2002 +++ mod_autoindex.xml Thu Nov 21 09:28:10 2002 @@ -309,7 +309,9 @@

Name is either ^^DIRECTORY^^ for directories, ^^BLANKICON^^ for blank lines (to format the list - correctly), a file extension, a wildcard expression, a partial + correctly), ^^UNAUTHORIZED^^ for anything for which + the user has not provided appropriate credentials (available from + 2.0.44), a file extension, a wildcard expression, a partial filename or a complete filename.

Examples