In the file include/utils.php there is a function called make_sugar_config which manipulates for some purpose which I do not know the global variable $sugar_config.
I noticed that the array default_permissions contains two keys (chown and chgroup) that, from the core definitions found at http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.5/02_Application_Framework/Helper_Classes/Configurator/Core_Settings/, do not exist.
I believe that these should be replaced by user and group (which are the keys defined in the above link as well as in config.php.
In addition, the values of file_mode and of dir_mode are expressed in octal instead of their decimal equivalents (as specified in the above mentioned core definitions link as well as in config.php).
Further in the code there is another function called get_sugar_config_defaults which correctly refers to user and group but sets dir_mode and file_mode in octal rather than their decimal equivalents.
I am not an expert, but I believe there are some inconsistencies to be checked
for completeness here is what the manual says:
default_permissions
Array that defines the ownership and permissions for directories and files created naturally by the application.
Type: Array
Versions: 5.2.0+
Editions: CE, Pro, Ent, Corp, and Ult
Override Example:
$sugar_config['default_permissions'] = array();
default_permissions.dir_mode
Part of the ‘default_permissions’ array. Used in UNIX-based systems only to define the permissions on newly created directories. The value is stored in decimal notation while UNIX file permissions are octal. For example, a value of 1528 in this setting equates to 2770 permissions.
Type: Integer
Versions: 5.2.0+
Editions: CE, Pro, Ent, Corp, and Ult
Override Example:
$sugar_config['default_permissions']['dir_mode'] = 1528;
default_permissions.file_mode
Part of the ‘default_permissions’ array. Used in UNIX-based systems only to define the permissions on newly created files. The value is stored in decimal notation while UNIX file permissions are octal. For example, a value of 432 in this setting equates to 660 permissions.
Type: Integer
Versions: 5.2.0+
Editions: CE, Pro, Ent, Corp, and Ult
Override Example:
$sugar_config['default_permissions']['file_mode'] = 432;
default_permissions.group
Part of the ‘default_permissions’ array. Used in UNIX-based systems only to define the group membership of any newly created directories and files. This value should be a group that the Apache user is a member of to help ensure proper functionality.
Type: String: Group for the Apache user
Versions: 5.2.0+
Editions: CE, Pro, Ent, Corp, and Ult
Override Example:
$sugar_config['default_permissions']['group'] = 'apache';