Results 1 to 4 of 4

Thread: Default_Permissions in config.php

  1. #1
    nickgiguere is offline Senior Member
    Join Date
    Jun 2009
    Posts
    24

    Default Default_Permissions in config.php

    Can anyone tell me how to set the default_permissions in the config.php file so that new folders created in the cache directory (or any directory really) are set to 755? I don't understand how to translate the "1520" or "436" to octal...

    PHP Code:
    'default_permissions' => 
      array (
        
    'dir_mode' => 1528,
        
    'file_mode' => 436

  2. #2
    Cynjut is offline Member
    Join Date
    May 2010
    Posts
    8

    Default Re: Default_Permissions in config.php

    Assuming you are using Windows, Click "start". "All Programs", "Calculator".

    Turn on scientific mode.

    Select "Oct".

    Enter 755

    Select "Dec"

    The answer should appear on your screen.

    Failing that, converting from Octal to Decimal (in 4 digits) is reasonably simple.

    Split the number into columns. working from right to left.

    The first digit is the same in octal as it is in decimal, so "7" is "7". Call this your "running answer".

    The next digit is the "8"s column, so you multiply that digit by 8 and add it to the running answer.

    The next digit is the "64"s column, so you multiply that digit by 64 and add it to your running answer.

    The next digit is the "512"s column, so you multiply that digit by 512 and add it to your running answer..

    The next digit is the "4096"s column, but since we're talking permissions, you probably won't need that one.

  3. #3
    nickgiguere is offline Senior Member
    Join Date
    Jun 2009
    Posts
    24

    Default Re: Default_Permissions in config.php

    Thank you so much! I couldn't find anything online. I guess I didn't realize I needed to convert an octal number into decimal.

    It appears that answers my question for 'file_mode'. How about 'dir_mode'? That's a 4 digit number. When I convert 755 to decimal I get "493".

    Wait, nevermind. I remember reading somewhere here on the forums that 1and1 controls the security settings on all files (644 in this instance) no matter what you set in the config.php.

  4. #4
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Default_Permissions in config.php

    For directories there is a so called Group-ID.
    For this the chmod command was extended to 4 digits, the first to define the behaviuor for directories.
    See e.g. here http://uw714doc.sco.com/en/man/html.1/chmod.1.html for details.
    So you set directories not to 755 but to 2755.
    And oct(02755) = 1517

    If you do not have any windows calculator at hand you could even write

    PHP Code:
    'default_permissions' =>  
      array ( 
        
    'dir_mode' => octdec('2755'), 
        
    'file_mode' => octdec('755'), 

    to the config.php.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SSL in config.php?
    By jsherk in forum Help
    Replies: 0
    Last Post: 2009-09-21, 07:32 PM
  2. default_permissions - Decimal or Octal Values?
    By jjwdesign in forum Developer Help
    Replies: 9
    Last Post: 2009-03-17, 04:30 PM
  3. Clarification of default_permissions
    By seade in forum Help
    Replies: 3
    Last Post: 2008-11-19, 01:25 PM
  4. Config Help
    By vidtechsteve in forum Help
    Replies: 13
    Last Post: 2006-04-18, 10:07 PM
  5. config.php
    By hyperion in forum Help
    Replies: 1
    Last Post: 2005-05-02, 07:44 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
  •