Support » Plugins » [Plugin: WordPress Automatic upgrade] Fix for permissions check error (“Server does not allow us to

  • [Just reposting here the fix I posted in the other forum – might be useful for some.]

    OK, found it:

    /* ... */
                    $permission =  exec("ls -l $theFile |awk '{print $1}'", $output, $error);
                    if($error == 0) {
                            //get the perms
                            $thePerms = $this->chmodnum(substr($permission, 1));
                            //if its 644 or 744 we cannot run man
                            //tell our wpau guy out there we need to change perms
                            //we only can write files when they are 766 or 666 lets see
                            $this->userPermission = $thePerms[0];
                            if($thePerms[2] < 6) {
                                    $canRun = false;
                            }
    /* ... */

    This is unfortunately not such a great way to figure out whether the file is writeable or not (it would be writeable if 030, 070, 120, etc.), but good try. Also, uh, right at the beginning of the function you have:

    $chmod = @chmod($theFile, 0644);

    so even if the file was writeable it would never find the “6” you check for. 🙂 Heh.

    The proper way to check would just be:

    $canRun = is_writable(ABSPATH . 'wpau-backup');

    There was a couple of other issues in runFTPPrelimCheck(), so I rerwote it to provide the same functionality (I think) – I hope that’s OK:

    /* ... */
            function runFTPPrelimChecks() {
                    if (!is_dir(ABSPATH . 'wpau-backup')) {
                            $this->canMakeBackupDir = @mkdir(ABSPATH . 'wpau-backup');
                            $this->createIndexes();
                            }
    
                    return is_writable(ABSPATH . 'index.php');
                    }
    /* ... */

    cheers,

    – pgl

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WordPress Automatic upgrade] Fix for permissions check error (“Server does not allow us to’ is closed to new replies.