Make WordPress Core

Changes between Initial Version and Version 8 of Ticket #32345


Ignore:
Timestamp:
06/12/2015 06:30:47 AM (8 years ago)
Author:
dd32
Comment:

Turns out that the SSH2 transport definately does not work on chroot'd SSH configurations at present.

This is because it relies on the ability to run shell commands, however that's not possible in a chrooted/sftp-only environment - This service allows sftp connections only.. The following methods require shell access at present:

  • pwd() - Needed to locate directory
  • chdir() - Not used by the SSH transport (but used by FTP systems)
  • chgrp() - Not used
  • chmod() - Used, but it's okay if it fails, especially on a SSH connection (It's far more expected the files will be created with the correct permissions IMHO)
  • chown() - Not used

Based on that, it looks like we can fix pwd() to use ssh2_sftp_realpath( $this->sftp_link, '.' ); instead of shell_exec( 'pwd' ), which should fix SSH2 w/ chrooted environments. This should avoid the need to make the FTP_* constants work for SSH2.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32345

    • Property Component changed from Upgrade/Install to Filesystem API
    • Property Summary changed from FTP_BASE, FTP_CONTENT_DIR, FTP_PLUGIN_DIR are not considered when using built in ssh2/sftp to ssh2/sftp doesn't work in chrooted environments, FTP_BASE, FTP_CONTENT_DIR, FTP_PLUGIN_DIR not available
    • Property Version changed from 4.2.2 to 2.7
    • Property Milestone changed from Awaiting Review to 4.3
  • Ticket #32345 – Description

    initial v8  
     1The SSH2 extension doesn't work with chrooted environments.
     2Previously:
     3
     4----
     5
    16FTP_BASE, FTP_CONTENT_DIR, FTP_PLUGIN_DIR are not considered when using built in ssh2/sftp. They are necessary in chrooted environments.
    27
     
    1318if ( stripos($this->method, 'ftp') !== false || stripos($this->method, 'ssh2') !== false ) {
    1419}}}
    15