cagefs_enter_user weirdness
Forum
  1. Forums
  2. General
  3. General Discussion
  1. Dan
  2. Monday, 24 August 2015
  3.  Subscribe via email
Shortly after enabling CageFS on a server, we got a complaint from a customer that their site was throwing an error. I looked into their logs, and PHP was throwing "failed to open stream: No such file or directory" when trying to reference a file it needed (/home/chcc/public_html/config.php). Sure enough:

[email protected] [/home/chcc/public_html]# ls -l config.php
-rwxr-xr-x 1 chcc chcc 495 Jun 30 10:53 config.php*
[email protected] [/home/chcc/public_html]# cagefs_enter_user chcc "ls config.php"
cagefs_enter_user: ls config.php: No such file or directory
[email protected] [/home/chcc/public_html]#
However:
[email protected] [/home/chcc/public_html]# cagefs_enter_user chcc "ls .."
cagefs_enter_user: ls ..: No such file or directory
[email protected] [/home/chcc/public_html]# cagefs_enter_user chcc "ls ."
cagefs_enter_user: ls .: No such file or directory
[email protected] [/home/chcc/public_html]#
Disabling CageFS for that user also didn't fix the problem, so I'm doubtful it's een related to CageFS in the first place. However, I'd still like to be able to use the cagefs_enter_user tool to debug issues that will inevitably come up in the future, and this behavior doesn't make sense. Am I just misunderstanding something here?
Rate this post:
  1. 25.08.2015 10:08:35
  2. # 1
Dan Accepted Answer
Posts: 7
Joined: 17.08.2015
0
Votes
Undo
Thanks, cagefsctl -e is what I was actually looking for.

As for the original issue, the full absolute path was displayed in the error log. The file is accessible using cagefsctl -e, and the problem also doesn't go away when I disable CageFS for that user, so I'm thinking the cause is actually unrelated to CageFS, and I'm looking at other potential causes now.

Thanks for your help.
  1. 25.08.2015 02:08:17
  2. # 2
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
It is not correct to use \'cagefs_enter_user\' to access his filesystem structure, please use \"cagefsctl -e username\" instead:

-e | --enter : enter into user\'s CageFS as root

This will fully mount users filesystem and give you \'chroot\' into it.

About the original issue with config.php, are you sure it is looking for a file in /home/chcc/public_html ? do you see this full path in error log or you just assume it?
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.