/sites/sitename/files/custom_themes is symlinked to /sites/sitename/themes

In IMCE I have set sites/sitename/files/. as my imce directory.

When I click on custom_themes in imce it says
Directory "custom_themes" is not accessible under file system!

Other directories inside the files folder is accessible. The symlink and those directories have the same permissions and ownership. The /sites/sitename/themes directory has the same permissions and ownership as the other directories.

Is this kind of setup supported? If so where can I start looking?

Comments

ufku’s picture

IMCE uses Drupal's directory path handling and it resolves paths in order to get the real path. This done to avoid directory exploits using paths like .././
Since your theme path is not under file directory, IMCE won't allow you to reach there.
FYI IMCE works fine with a file directory which is a symlink.

redndahead’s picture

Status: Active » Fixed

well there went that plan. On to plan b. Thanks.

Status: Fixed » Closed (fixed)

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

pepeek’s picture

What is the plan B? Is there a solution/workarround for it?
Thanks,
--Josef

Bevan’s picture

Status: Closed (fixed) » Active

Unfortunately moving the directory into the Drupal files directory is not an option for a project I am working on. Short of recursively hard-linking (then synchronising changes), are there other other workarounds, such as a configuration setting or a hack to the module?

(The security issue you describe is not an problem for this project as all users with access to the site are trusted. It's an intranet)

Thank you!

ufku’s picture

The function used for checking directory location is file_check_location(). You can either hack IMCE to use an alternate function or hack file_check_location() not to use realpath() that resolves symlinks. It's in includes/file.inc

Bevan’s picture

Status: Active » Fixed

Thanks ufku! (:

Status: Fixed » Closed (fixed)

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

donquixote’s picture

Status: Closed (fixed) » Needs work

Hm, any idea how to do that in D7 ?
There is no file_check_location() in imce, just a lot of uri() stuff.

donquixote’s picture

Status: Needs work » Fixed
ufku’s picture

Status: Fixed » Closed (won't fix)