The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FileManager always prepends users' home directory to files/directories

Discussion in 'General Discussion' started by ErickCantwell, Apr 25, 2012.

  1. ErickCantwell

    ErickCantwell Registered

    Joined:
    Jan 1, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    This may be a bug, but I can also see where it would be working as intended, so I figured that I would post this here in case anybody has a work-around. If others think that it's a bug then I'll be happy to create a ticket.

    The file manager always prepends the users' home directory to directory paths. This can cause problems when symlinks exist that point outside of the user's home directory. For example:

    If we have the following symlink set up to point to a special directory that contains logs we want the customer to access:

    lrwxrwxrwx 1 rioteigt rioteigt 11 Apr 19 14:13 /home1/rioteigt/access-logs -> /var/log/domlogs/rioteigt

    The filemanager will:

    A) Properly list the symlink as a directory we shoud be able to navigate
    B) When we try to access it through the FileManager we get the following error:
    [2012-04-25 20:46:54 -0600] warn [fileman::listfiles] Encountered error in fileman::listfiles: Internal error: can't find that folder: /home1/rioteigt/var/log/domlogs/rioteigt

    I've read over the fileman::listfiles documentation here Fileman Module Documentation and it seems like we should be able to work around this problem by changing the dir value when listing a symlink. That being said, the fileman module is built into the cPanel binary. We can't patch or modify it (if my understanding is correct). Has anybody already run into worked around this or come up with a solution?

    Thanks in advance,

    Erick
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hi Erick,

    I suggest posting a ticket if you believe this to be a product defect. Of note, the workarounds forum is not for asking for assistance. We have multiple forums for that purpose. The workarounds forum is to post workarounds you have for others to use. Basically, guides on how to change things. Please only post actual workarounds for customizations you've found to this forum.

    As such, I'm moving the thread to the general forum where requests for assistance would go.

    Thanks!
     
  3. NetMantis

    NetMantis BANNED

    Joined:
    Apr 22, 2012
    Messages:
    117
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Utah
    cPanel Access Level:
    DataCenter Provider
    Speaking purely from a security standpoint, you actually would not want the file manager to follow any symlinks. Doing so would completely undermine the whole basis of folder security of having any home locations entirely. The web logs can be accessed by other means and should be downloaded that way, not by the File Manager.
     
  4. ErickCantwell

    ErickCantwell Registered

    Joined:
    Jan 1, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Thanks Tristan, and sorry for posting it in the wrong forum. I don't believe this to be a product defect. I think that it's working as intended.

    NetMantis:
    I agree with you on a general basis (also why I don't really think that this is a bug), but there are also several specific instances where following symlinks is, while not completely necessary, much better for customers. For example, why would we not allow them to follow a symlink that points /home/user/www -> /home/user/public_html (which they can do)?

    Anyways, I'm not here to argue that point. On that train of thought, though:

    Any ideas on how I would get the FileManager to NOT list that symlink?

    I have two options:

    1) Make it work so that customers can access that directory.
    2) Not display the symlink. Not displying it would be better than having it be broken.

    If I had access to the listfiles function I could simply edit it. That apparently isn't an option. Does anybody know of a Javascript workaround or any other files that could be modified to the get one of those outcomes?
     
Loading...

Share This Page