Support » Plugin: SSH SFTP Updater Support » [Plugin: SSH SFTP Updater Support] sftp.php foreach error

  • Resolved Stephen Page

    (@camwynsp)


    For any update I attempt, I get the same error – and it always causes the update to fail.

    Warning: Invalid argument supplied for foreach() in /fileserv/tdc/Home/wp-content/plugins/ssh-sftp-updater-support/phpseclib/Net/SFTP.php on line 1591

    Could not copy file. /fileserv/tdc/Home/wp-content/upgrade/bj-lazy-load.tmp/

    I haven’t looked deeply into the code, but I noticed this:
    // presumably $entries will never be empty because it'll always have . and ..
    and wonder if this could be the issue?

    http://wordpress.org/extend/plugins/ssh-sftp-updater-support/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Stephen Page

    (@camwynsp)

    Ah, and that’s on WP 3.3.1 with the latest version of SSH SFTP Updater.

    Plugin Author TerraFrost

    (@terrafrost)

    Can you do this?:

    #
    #-----[ OPEN ]------------------------------------------
    #
    class-wp-filesystem-ssh2.php
    #
    #-----[ FIND ]------------------------------------------
    #
    		} else {
    			$rsa = new Crypt_RSA();
    			if ( $this->password ) {
    				$rsa->setPassword($this->options['password']);
    			}
    			$rsa->loadKey($this->options['private_key']);
    			if ( ! $this->link->login($this->options['username'], $rsa ) ) {
    				$this->errors->add('auth', sprintf(__('Private key incorrect for %s'), $this->options['username']));
    				return false;
    			}
    		}
    #
    #-----[ AFTER, ADD ]------------------------------------
    #
    echo $this->link->getServerIdentification();

    Won’t fix the problem but could give me information that’d enable me to better understand what’s going on.

    Something that *might* fix it…

    #
    #-----[ OPEN ]------------------------------------------
    #
    phpseclib/Net/SFTP.php
    #
    #-----[ FIND ]------------------------------------------
    #
            $entries = $this->_list($path, true, false);
    #
    #-----[ AFTER, ADD ]------------------------------------
    #
            if (empty($entries)) {
                if (!$this->_send_sftp_packet(NET_SFTP_RMDIR, pack('Na*', strlen($path), $path))) {
                    return false;
                }
            }
    Thread Starter Stephen Page

    (@camwynsp)

    Never mind, it wasn’t your problem…turned out the sysadmin had done a bit of fiddling in there and wound up with ownership of the updates folder…so my ssh account couldn’t manipulate it’s contents. (University system…wonky security issues)

    Thanks though!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: SSH SFTP Updater Support] sftp.php foreach error’ is closed to new replies.