Fix the chown and chgrp methods for the filesystem API's SSH2 transport. fixes #24277.

git-svn-id: https://develop.svn.wordpress.org/trunk@24626 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-07-10 04:15:13 +00:00
parent 0fc3503f69
commit 381110d9f2
1 changed files with 4 additions and 4 deletions

View File

@ -184,8 +184,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
if ( ! $this->exists($file) )
return false;
if ( ! $recursive || ! $this->is_dir($file) )
return $this->run_command(sprintf('chgrp %o %s', $mode, escapeshellarg($file)), true);
return $this->run_command(sprintf('chgrp -R %o %s', $mode, escapeshellarg($file)), true);
return $this->run_command(sprintf('chgrp %s %s', escapeshellarg($group), escapeshellarg($file)), true);
return $this->run_command(sprintf('chgrp -R %s %s', escapeshellarg($group), escapeshellarg($file)), true);
}
function chmod($file, $mode = false, $recursive = false) {
@ -210,8 +210,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
if ( ! $this->exists($file) )
return false;
if ( ! $recursive || ! $this->is_dir($file) )
return $this->run_command(sprintf('chown %o %s', $mode, escapeshellarg($file)), true);
return $this->run_command(sprintf('chown -R %o %s', $mode, escapeshellarg($file)), true);
return $this->run_command(sprintf('chown %s %s', escapeshellarg($owner), escapeshellarg($file)), true);
return $this->run_command(sprintf('chown -R %s %s', escapeshellarg($owner), escapeshellarg($file)), true);
}
function owner($file) {