Opened 4 years ago
Last modified 4 years ago
#55469 new enhancement
WP_Filesystem_SSH2::chmod() should use ssh2_sftp_chmod()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Filesystem API | Keywords: | has-patch needs-testing |
| Focuses: | Cc: |
Description
WP_Filesystem_SSH2::chmod() currently uses ::run_command( sprintf( 'chmod %o %s', $mode, escapeshellarg( $file ) ), true ) (which calls ssh2_exec()). It has essentially been this way since WP_Filesystem_SS2 was introduced in [8812].
However, some sftp servers do not allow ssh2_exec() to be run, generating PHP warnings such as:
PHP Warning: ssh2_exec(): Unable to request command execution on remote host
and on those severs all calls to WP_Filesystem_SSH2::chmod() basically become noops.
Luckily, starting with version 0.12, the ssh2 extension introduced ssh2_sftp_chmod(), and WP_Filesystem_SSH2::chmod() should be changed to use it.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Trac ticket: #55469