Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1188867

Bug#1065247: new lighttpd serves mangled file names

From Glenn Strauss <gs-bugs.debian.org@gluelogic.com>
Newsgroups linux.debian.bugs.dist
Subject Bug#1065247: new lighttpd serves mangled file names
Date 2024-03-03 05:30 +0100
Message-ID <IdLE5-e3Wy-1@gated-at.bofh.it> (permalink)
References <Idt4t-dSxi-7@gated-at.bofh.it> <Idztf-dWzA-13@gated-at.bofh.it> <IdKeZ-e2Uq-9@gated-at.bofh.it> <Idt4t-dSxi-7@gated-at.bofh.it> <IdKeZ-e2Uq-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> I have noticed something odd though. I created a directory which when
> served by lighttpd in Firefox looks like:
> 
>     Index of /test/
>     ../	 	-  	Directory
>     This is just a test.mkv/	2024-Mar-03 13:22:24	583.7M	video/x-matroska
>     This is just a test.txt/	2024-Mar-03 13:05:21	0.1K	text/plain;charset=utf-8

There is a regression in lighttpd 1.4.74 and will be fixed in lighttpd
1.4.75 released later this month (Mar).  The regression causes the
display of filenames in mod_dirlisting to end in '/'.

https://redmine.lighttpd.net/issues/3242

> In Firefox, if I click on the text file it works just as expected and FF shows
> the contents of the text file.
> 
> For the video file however it starts a download, but renames the file to
> `6GQOZxf0.mpv` (an MS-DOS like 8.3 filename).
> 
> If I use wget to retrieve the file I get this:
> 
>     > wget -S http://white:8080/test/This%20is%20just%20a%20test.mkv/
>     --2024-03-03 13:38:41--  http://white:8080/test/This%20is%20just%20a%20test.mkv/
>     Resolving white (white)... 192.168.1.8
>     Connecting to white (white)|192.168.1.8|:8080... connected.
>     HTTP request sent, awaiting response... 
>       HTTP/1.1 200 OK
>       Content-Type: video/x-matroska
>       ETag: "72386044"
>       Last-Modified: Sun, 03 Mar 2024 02:22:24 GMT
>       Content-Length: 612101519
>       Accept-Ranges: bytes
>       Date: Sun, 03 Mar 2024 02:38:41 GMT
>       Server: lighttpd/1.4.74
>     Length: 612101519 (584M) [video/x-matroska]
>     Saving to: ‘index.html.1’
> 
> However, if I drop the trailing `/` from the filename it works as expected:
> 
> 
>     > wget -S http://white:8080/test/This%20is%20just%20a%20test.mkv
>     --2024-03-03 13:40:38--  http://white:8080/test/This%20is%20just%20a%20test.mkv
>     Resolving white (white)... 192.168.1.8
>     Connecting to white (white)|192.168.1.8|:8080... connected.
>     HTTP request sent, awaiting response... 
>       HTTP/1.1 200 OK
>       Content-Type: video/x-matroska
>       ETag: "72386044"
>       Last-Modified: Sun, 03 Mar 2024 02:22:24 GMT
>       Content-Length: 612101519
>       Accept-Ranges: bytes
>       Date: Sun, 03 Mar 2024 02:40:38 GMT
>       Server: lighttpd/1.4.74
>     Length: 612101519 (584M) [video/x-matroska]
>     Saving to: ‘This is just a test.mkv’
> 
> My guess is that that problem is in the module that generates the listing
> for a directory and that the problem is that it puts a trailing `/` on 
> file as well as just directories.
> 
> I use lighttpd to serve viedo files for a kodi.tv box, so I cannot maually
> correct the generated directory listings that lighttpd gives me.

Ok, so it sounds to me like the client is renaming the downloaded file,
not lighttpd, due to the bug in lighttpd 1.4.74 mod_dirlisting
erroneously adding a trailing '/' to the filename.

This will be fixed in the next version of lighttpd, and I'll probably
submit a patch to Debian sooner.

Cheers, Glenn

Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#1065247: new lighttpd servers mangled file names Erik de Castro Lopo <erikd@mega-nerd.com> - 2024-03-02 09:40 +0100
  Bug#1065247: new lighttpd servers mangled file names Glenn Strauss <gs-bugs.debian.org@gluelogic.com> - 2024-03-02 16:30 +0100
  Bug#1065247: new lighttpd serves mangled file names Erik de Castro Lopo <erikd@mega-nerd.com> - 2024-03-03 04:00 +0100
  Bug#1065247: new lighttpd serves mangled file names Glenn Strauss <gs-bugs.debian.org@gluelogic.com> - 2024-03-03 05:30 +0100
    Bug#1065247: new lighttpd serves mangled file names Erik de Castro Lopo <erikd@mega-nerd.com> - 2024-03-03 07:30 +0100

csiph-web