Code Monkey home page Code Monkey logo

cpanel-fixperms's People

Contributors

ashworthconsulting avatar boomshadow avatar lsthompson avatar matiniamirhossein avatar whattheserver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpanel-fixperms's Issues

Permission and Ownership Backup

We should add an option to backup of existing permission and ownership for all users.
Below is code snippet for your review.

backupdir="/root/fixperms_backups/fixperms_backups_'date +%s'"
mkdir -p $backupdir

function permsbkp
{
	local user=$1
	local home_dir=$2
	echo "Backing up permissions for $user"
	find $home_dir -printf 'chmod %#m "%p"\n' > ${backupdir}/${user}-perms_backup_'date +%s'.sh
	echo "Backing up ownerships for $user"
	find $home_dir -printf 'chown %u:%g "%p"\n' > ${backupdir}/${user}-owners_backup_'date +%s'.sh
}

Option to ignore files set to 000

In abuse situations, we sometimes have to temporarily set files to 000 until customers have a chance to take care of the problem.

Generally, when files are left in that state, it's best that they be left in that state until manually corrected after the abuse issue is resolved.

I'm not sure you'd want it to be the default, but having an option to skip over any file/directory that's set to 000 would be a nice safety net here. Generally, when you run across that, it's been explicitly set that way, not by accident.

ignore cpanel user system

script gets stuck in loop with the cpanel user system.

from the script output;

Fixing perms for system:

Fixing website files....
find: ‘/public_html’: No such file or directory
find: ‘/public_html’: No such file or directory
find: ‘/public_html’: No such file or directory
chown: invalid user: ‘system:system’
chown: invalid user: ‘system.system’
chown: invalid user: ‘system.system’
chown: invalid user: ‘system.system’
........ etc

I get an error with ContOS 7

./fixperms.sh: line 24: $'\r': command not found
./fixperms.sh: line 25: $'\r': command not found
./fixperms.sh: line 28: $'\r': command not found
./fixperms.sh: line 29: $'\r': command not found
./fixperms.sh: line 31: syntax error near unexpected token $'{\r'' '/fixperms.sh: line 31: helptext () {

No such file or directory

hi, i'm receiving the following error when i run this script. seems like a path parsing issue?

chown: cannot access ‘On"}]}},"enable_sni_for_mail":"1","group":"xyz","owner":"root","usecanonicalname":"Off","customlog":[{"target":"/etc/apache2/logs/domlogs/xyz.xyzhosting.com","format":"combined"}],"documentroot":"/home/xyz/xyz-websites/xyzhosting","sslcertificatefile":"/var/cpanel/ssl/installed/certs/_wildcard__xyzhosting_com_cbc7b_7ab37_1533513599_4b02ce0d75f4eae7d6dab9986e65cd4e.crt","secruleengineoff":null,"ifmodulemodsuphpc":{"group":"xyz"},"options":"-ExecCGI’: No such file or directory
find: ‘On"}]}},"enable_sni_for_mail":"1","group":"xyz","owner":"root","usecanonicalname":"Off","customlog":[{"target":"/etc/apache2/logs/domlogs/xyz.xyzhosting.com","format":"combined"}],"documentroot":"/home/xyz/xyz-websites/xyzhosting","sslcertificatefile":"/var/cpanel/ssl/installed/certs/_wildcard__xyzhosting_com_cbc7b_7ab37_1533513599_4b02ce0d75f4eae7d6dab9986e65cd4e.crt","secruleengineoff":null,"ifmodulemodsuphpc":{"group":"xyz"},"options":"-ExecCGI’: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.