Forum

Special characters in file names

Prit
15 August 2009, 01:14
Hi Hugo,

As you know we are using Hiawatha on Puppylinux.ca to serve the files. We noticed that when there is a ":" in the file name, Hiawatha does not handle this like the other servers. I know that this is not a common naming convention. But, apache and lighttpd handle this file name.
Example file name: ppa-422.iso:puppy-4.3beta1-k2.6.29.6-v423.iso.delta

When using Hiawatha, we get the message:
Firefox doesn't know how to open this address, because the protocol (ppa-422.iso) isn't associated with any program.

Is there any way to fix this?

Hiawatha version: 6.16
Operating System: CentOS
Hugo Leisink
16 August 2009, 14:43
I can open the file without a problem. But I see that the directory listing generated by Hiawatha doesn't contain a valid link to the file. So, the problem lies in Hiawatha's directory listing code, not in the request handeling code. Is that your case too?

P.S.
Listing problem has been fixed. Add a double-point character to the function called char_needs_encoding() which can be found in libstr.c around line 195.

strchr("\"#%'<>", c) -> strchr("\"#%':<>", c)
Prit
16 August 2009, 20:58
Thanks a lot Hugo. That did the trick. Now the files show with the correct link in the directory listing.
Eric Mulcaster
16 August 2009, 23:35
Hello Hugo and Prit,
If the changes to libstr.c become a security issue I will roll it back to the original file or, with your advice, to what we need.

I think it would be best if I/we focus on security rather than how a file is handled in the file manager.

With this in mind, I will post to my users that a naming convention is best followed to avoid this situation in the future.
Thanks for Hiawatha..very good work.

Best,
Eric
Hugo Leisink
16 August 2009, 23:59
The change to libstr.c as descibed in my previous post will not become a security issue. It can be applied without any problem. The change will be present in the next release of Hiawatha.
Prit
18 August 2009, 18:52
Hugo .. we also had the "+" character in one of the files and I did the same change that you suggested for the other character. It works fine now. Do you think allowing these characters can cause any other problems ?
This topic has been closed.