Results 1 to 2 of 2

Thread: File Permissions Updated with Upgrades & Installs

  1. #1
    gregmarsh is offline Junior Member
    Join Date
    Dec 2011
    Posts
    5

    Default File Permissions Updated with Upgrades & Installs

    I was wondering if there are any plans to create a utility that would scan a sugar directory structure and set all the file defaults (Sugar only I guess). Every time I install an update I have to fix a sea of directories and files and to be honest I am wondering why this very boring activity is necessary.

    With out the changes of course I do not have the correct msgs showing and in some cases the pages don't display but on the other hand it is very frustrating and I have had to expose sites temporarily to hacking when they had to be immediately available and I did not have the time to tweak the individual files or directories.

    This should not be a major task for the attribute definition for each file can be set up on mass by file type on mass and then tweaked from there. This would also force the development team to think about permissions which is always a good thing since permissions probably cause the most bugs for "Working Code" out there.

    Any build software would easily be able to generate a fix file that could adapt to each OS and if done with a simple structure anyone adding to sugar could simply #include (or similar) their own file definitions.

    Gone would be the need to guess between a 664 and 665 etc. - why directories switch to 770 versus 775 and why there seems to be this random change of 0255 for some but not all the structures.

    The other thing is if it could run from within the installation imagine the speed difference between this and running via FTP.

    All the best.

  2. #2
    Ramblin is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    136

    Default Re: File Permissions Updated with Upgrades & Installs

    I just wrote a little bash script that resets all the file permissions

    Code:
    #!/bin/bash
    
    cd /var/www/html
    
    chown -R asterisk:asterisk crm
    
    chmod -R 755 crm
    
    cd crm
    
    chmod -R 775 cache
    chmod -R 775 custom
    chmod -R 775 data
    chmod -R 775 modules
    if [ -s upload ]
         then
    	chmod -R 775 upload
    fi
    chmod 644 .htaccess
    chmod 664 config.php
    chmod 664 config_override.php
    chmod 664 sugarcrm.log
    Put the above in a file at the same level as (ie not in <sugar_root>, but in /var/www/html/
    make it executable

    Before AND After each update (or after each Repair & Rebuild) run the script

    Your permissions are set according to SugarCRM Guidelines

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 2011-02-27, 05:19 PM
  2. Replies: 1
    Last Post: 2009-02-05, 12:31 PM
  3. All about file permissions
    By southwestcrm in forum Installation and Upgrade Help
    Replies: 2
    Last Post: 2007-07-03, 02:48 PM
  4. Replies: 4
    Last Post: 2006-10-25, 04:10 PM
  5. Upgrades, Timings and Installs
    By JayL in forum General Discussion
    Replies: 0
    Last Post: 2005-05-10, 03:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •