I am using WebFM as a form of directory listing for a directory of documents. Ideally users will only have read access to it and would not be able to modify it. As the actual files are located elsewhere on the server (not in the files directory of drupal), I created a symlink and set that as my webfm root. Somehow this confuses webfm, and it fails to serve the files. I get the following error:

fopen(): Filename cannot be empty in /usr/share/drupal6/includes/file.inc on line 841.

A "page not found" error follows with the relevant link e.g. "webfm_send/378". If I place a physical copy of the documents in the files directory everything works fine. At first I thought this might be a permissions issue so I confirmed that www-data has read and write access to the documents in question after following the link (I added www-data and the owner to a group, changes the group which the documents belonged to and gave the relevant rights to the group). The situation remains identical even if I give the files 777 rights.

Any help would be greatly appreciated.

Comments

nhck’s picture

Title: WebFM has trouble following links » Handle symlinks with more care.
Version: 6.x-2.12 » 6.x-2.x-dev
Priority: Normal » Minor

thenasko,
thank you for reporting this and helping to make webfm better.

I am afraid I have to tell you that symlinks are not supported. Because that would raise all kinds of security concerns: Just imagine someone manages to place a symlink to /etc/passwd in your webfm directory.

However I agree with you that webfm should fail more gracefully. Even better they shouldn't be shown in the directory listing.

Thank you.

nhck’s picture

Priority: Minor » Major
Status: Active » Fixed

Thank you for helping and reporting this. I believe we fixed that:

Commit #482764: #1005936: Handle symlinks with more care., #362212: Symbolic link support without infinite loop Enforcing removal of symbolic links.

Thank you.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.