Project

General

Profile

Actions

Bug #3242

closed

Directory listing

Added by guy 10 months ago. Updated 10 months ago.

Status:
Fixed
Priority:
Normal
Category:
mod_dirlisting
Target version:
ASK QUESTIONS IN Forums:
No

Description

Recent version displays files as directories (with '/')


Related issues 2 (0 open2 closed)

Related to Bug #3245: lighttpd-1.4.74 appends slashes "/" after all files in dirlistingDuplicateActions
Has duplicate Bug #3248: trailing slash after regular files in dirlistingDuplicateActions
Actions #1

Updated by avij 10 months ago ยท Edited

It would be really nice to know the exact version of lighttpd you are running. "Recent" is not a particularly exact term.

That said, there does seem to be a bug in 1.4.74.

Works:
https://orava.miuku.net/tmp/dirtest/

Extra slash at the end of the filename:
https://miuku.net/tmp/dirtest/

Actions #2

Updated by gstrauss 10 months ago

  • Status changed from New to Patch Pending
  • Target version changed from 1.4.xx to 1.4.75

Sorry. Regression in lighttpd 1.4.74. A bit too much code reuse in commit b7a49778

--- a/src/mod_dirlisting.c
+++ b/src/mod_dirlisting.c
@@ -1022,10 +1022,19 @@ static void http_list_directory_dirname(buffer * const out, const dirls_entry_t
        buffer_append_string_len(out, CONST_STR_LEN("</td><td class=\"s\">- &nbsp;</td><td class=\"t\">Directory</td></tr>\n"));
 }

+static void http_list_file_ent(buffer * const out, const dirls_entry_t * const ent, const char * const name) {
+       buffer_append_string_encoded(out, name, ent->namelen, ENCODING_REL_URI_PART);
+       buffer_append_string_len(out, CONST_STR_LEN("\">"));
+       buffer_append_string_encoded(out, name, ent->namelen, ENCODING_MINIMAL_XML);
+       buffer_append_string_len(out, CONST_STR_LEN("</a></td><td class=\"m\">"));
+
+       http_list_directory_mtime(out, ent);
+}
+
 static void http_list_directory_filename(buffer * const out, const dirls_entry_t * const ent, const char * const name, handler_ctx * const hctx) {
        buffer_append_string_len(out, CONST_STR_LEN("<tr><td class=\"n\"><a href=\""));

-       http_list_directory_ent(out, ent, name);
+       http_list_file_ent(out, ent, name);

        const buffer *content_type;
   #if defined(HAVE_XATTR) || defined(HAVE_EXTATTR) /*(pass full path)*/

Actions #3

Updated by gstrauss 10 months ago

  • Status changed from Patch Pending to Fixed
Actions #4

Updated by gstrauss 10 months ago

  • Related to Bug #3245: lighttpd-1.4.74 appends slashes "/" after all files in dirlisting added
Actions #5

Updated by gstrauss 9 months ago

  • Has duplicate Bug #3248: trailing slash after regular files in dirlisting added
Actions

Also available in: Atom