We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10221
    • 5 Posts
    Hi,

    I’ve been trying to get this to work properly for some time now without success. It seems Revo is installing Extras with the umask 0077, ignoring my set value in new_folder_permissions and new_file_permissions. I have set it to 0750 and 0640 as I’m using suPHP.

    I own the server and can do what I need to. The system wide umask is 022. The user PHP is run as (because of suPHP) has the umask 027 set in ~/.profile. Files and folders created through FTP and SFTP have the right permissions set.

    I did a test to see what PHP returns and decoct(umask(0)) returned 77. octdec(new_folder_permissions) returned 493. Isn’t the set $amode wrong in ie. core/model/modx/processors/system/filesys/file/unzip.php then?
    $amode = !empty($modx->getOption('new_folder_permissions')) ? octdec($modx->getOption('new_folder_permissions')) : 0777;

    I’ve also tried setting umask 022 in /usr/sbin/envvars and restarted Apache. No change.

    I can’t seem to figure out why uploaded files through Revo and installer Extras get the permissions 0700 and 0600.

    Any ideas what might be causing this?

    Apache 2.2.14
    PHP 5.2.13
      • 28215
      • 4,149 Posts
      Can you file it as a bug at http://bugs.modxcms.com and we’ll look at it?
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 10221
        • 5 Posts
          • 10221
          • 5 Posts
          Turns out I was missing something. I was wondering why PHP said the umask was 0077. I just found out why. suPHP has it’s own umask setting in it’s config file, and totally ignores the system-wide setting when it’s specified there at least. I didn’t even remember suPHP had it’s own config file.

          At least I solved the problem. Also, there doesn’t seem to be anything wrong with the code in those files. I works as it’s supposed to. I would close the "bug" if I knew how or could even log in. It’s not letting me for some reason.

          Anyway. Issue Solved!