cPanel & WHM Version 92 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Make option to disable symlink creation during rearrange account

jandafields shared this idea 4 years ago
Open Discussion

When you rearrange an account, the system creates a symlink in the old location (usually /home) pointing to the new location (like /home2). The only purpose of this symlink is to prevent scripts from breaking that were hard coded to the old location. If you create a brand new account in a secondary location, it does not create a symlink in /home pointing to /home2 because the account was never in /home to being with, and there is no reason to believe that /home would have been hard coded in any of their scripts.


So, that all makes sense.


However, for accounts that use cron or have the php or apache jail protection (keeps users inside their own folder), having the old locations hard coded in the scripts will break the scripts regardless of the symlink because that old location, even symlinked to the new location, is considered to be outside of their jailed location so they get access denied.


That also makes sense, but because of that, the symlinks really are not useful and they do not prevent scripts from breaking when moving accounts... and if an account gets moved multiple times, for whatever reason, you get symlinks scattered everywhere (/home/user pointing to /home2/user pointing to /home3/user).


So, if there was an option to completely disable the symlink creation, it would have the benefit of keeping a cleaner/neater /home folders, and it wouldn't really hurt anything since cron and the jailed apache/php doesn't work with symlinks anyway.

Comments (3)

photo
1

I haven't tested outside cagefs recently but everything keeps working even with cron on our servers (we had to add a ligne to cagefs so it included the symlinks to get this working but it does work for us.

photo
1

ROOT USER CAN ACCESS SYMLINKS TO AN ACCOUNT:


  1. [root@server2 ~]# whoami
  2. root
  3. [root@server2 ~]# cd /home/testuser
  4. [root@server2 testuser]# pwd
  5. /home/testuser
  6. [root@server2 testuser]# cd /home4/testuser
  7. [root@server2 testuser]# pwd
  8. /home4/testuser
  9. [root@server2 testuser]#

JAILED USER CANNOT ACCESS SYMLINKS TO AN ACCOUNT:


  1. [testuser@server2 ~]$ whoami
  2. testuser
  3. [testuser@server2 ~]$ pwd
  4. /home4/testuser
  5. [testuser@server2 ~]$ cd /home/testuser
  6. -jailshell: cd: /home/testuser: No such file or directory
  7. [testuser@server2 ~]$ cd /home4/testuser
  8. [testuser@server2 ~]$ pwd
  9. /home4/testuser
  10. [testuser@server2 ~]$

photo
1

https://forums.cpanel.net/threads/jailshell-question-with-multiple-home-folders.548671/


[quote=cPanelMichael]


Hello,Thank you for providing the steps to reproduce the issue. I've confirmed the same result. This is by design for the jailed shell environment. You will need to assign the account regular shell access to circumvent this limitation.Thank you.


[/quote]