Closed (won't fix)
Project:
IMCE
Version:
6.x-1.2
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Mar 2009 at 07:59 UTC
Updated:
3 Jan 2012 at 17:21 UTC
/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
Comment #1
ufku commentedIMCE 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.
Comment #2
redndahead commentedwell there went that plan. On to plan b. Thanks.
Comment #4
pepeek commentedWhat is the plan B? Is there a solution/workarround for it?
Thanks,
--Josef
Comment #5
Bevan commentedUnfortunately 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!
Comment #6
ufku commentedThe 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
Comment #7
Bevan commentedThanks ufku! (:
Comment #9
donquixote commentedHm, any idea how to do that in D7 ?
There is no file_check_location() in imce, just a lot of uri() stuff.
Comment #10
donquixote commentedThis one looks promising.
#1008402: Allow the use of symlinks within the files directory.
Comment #11
ufku commentedSee #1008402: Allow the use of symlinks within the files directory.