WordPress.org

Ready to get started?Download WordPress

Forums

SSH SFTP Updater Support
[resolved] sftp.php foreach error (4 posts)

  1. camwynsp
    Member
    Posted 1 year ago #

    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/

  2. camwynsp
    Member
    Posted 1 year ago #

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

  3. TerraFrost
    Member
    Plugin Author

    Posted 1 year ago #

    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;
                }
            }
  4. camwynsp
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic