Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Oct 2003
    Posts
    37

    Exclamation Files Owned by nobody and Disk Usage!

    Is cPanel going to try do something about checking what is physically in a users account space rather than just search for files owned by the user to calculate total disk space?

    I've just discovered an account using over 14GB of disk space with attachments uploaded via their forums.

    This is not the 1st time.

    Users are getting away with being able to exceed disk space limits because files are owned by nobody due to PHP uploads.

  2. #2
    aby
    aby is offline
    Member aby's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    638

    Lightbulb

    Quote Originally Posted by IdleServ
    Is cPanel going to try do something about checking what is physically in a users account space rather than just search for files owned by the user to calculate total disk space?

    I've just discovered an account using over 14GB of disk space with attachments uploaded via their forums.

    This is not the 1st time.

    Users are getting away with being able to exceed disk space limits because files are owned by nobody due to PHP uploads.
    You can disable the option upload using php in php.ini
    Aby

    MSN "abyvarghese007"
    Yahoo " abyattaikkulathu"

    http://slashome.com

  3. #3
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,093
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    A fairly simple solution is to write a script that goes through home directories, chowning the nobody files to each user account, then they're included in the disk quota. Or, switch to using phpsuexec/suexec.

  4. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Indeed. One of several reasons I always have phpsuexec enabled on all of my own servers. Ultimately, it's an issue between php and apache and the poor way that php has been developed for the real world and there's little cPanel can do about it.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,093
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Of course, one of the reasons it's switched on in my servers is because you administer them

    (I hate to give away one of my secrets )

  6. #6
    Member
    Join Date
    Oct 2003
    Posts
    37

    Default

    Disabling uploads and chowning files isn't an option as that will cause problems with user's scripts.

    Reason for chowning files being bad is because the script will then not have access to delete the uploaded file. It would be a headache to get the user to understand about permissions and chmod'ing, etc... especially if they are just newbies using a 3rd party script.

    Just wish cPanel could modify their script to look at whats physically in a user's homedir.

  7. #7
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Since cPanel are using standard unix file ownerships, they can't for the reasons I mentioned.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  8. #8
    Member carock's Avatar
    Join Date
    Sep 2002
    Location
    St. Charles, MO
    Posts
    215

    Default

    Since PHP created the files as user nobody, wouldn't PHP also be able to chown them to another user?

    If so, does someone have a utility script that can be run to facilitate the changing of ownership of these files?

    I know this is an old thread, but I didn't want to start a new one for the same problem.

    Thanks,
    Chuck

  9. #9
    Member
    Join Date
    Aug 2002
    Posts
    1,118

    Default

    Quote Originally Posted by carock
    Since PHP created the files as user nobody, wouldn't PHP also be able to chown them to another user?

    If so, does someone have a utility script that can be run to facilitate the changing of ownership of these files?

    I know this is an old thread, but I didn't want to start a new one for the same problem.

    Thanks,
    Chuck
    PHP created the files as nobody because that is the user that was running the Apache process that wrote the files. It doesn't have signficant privileges to change the ownership.

    As chirpy stated this is just an issue between PHP and Apache. I'm not sure which side is to blame or really if any side is to really blame. This is just the way it works. Apache runs as nobody, PHP scripts run as nobody, files written by PHP as owned by nobody.

    From a security point of view, if you are going to have PHP scripts that upload and/or create files, then PHP needs to be run as CGI or in some way, run the PHP script as the account owner. Having files owned by nobody and having open directories that are required for PHP scripts to write files as nobody can be a security risk.

    Running PHP as CGI (FastCGI, phpsuexec, suPHP, etc) may result in a slight performance loss, but its either that or having insecurities on the server. Take your choice.

Similar Threads & Tags
Similar threads

  1. Disk space usage ignoring files of nobody
    By marxiano533 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-23-2011, 02:05 AM
  2. Are /tmp files included in cpanel disk usage calculation?
    By electric in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 10-27-2008, 04:39 PM
  3. Solution to Disk Useage Prob when files owned by user nobody
    By fuzzymonkey in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 05-30-2007, 08:45 PM
  4. Disk usage viewer to show SINGLE list of all files by size
    By spaceman in forum Feature Requests for cPanel/WHM
    Replies: 4
    Last Post: 10-30-2003, 08:29 PM
  5. Disk usage viewer to show SINGLE list of all files by size
    By spaceman in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 10-30-2003, 08:29 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube