From 51e89cca3022292b356d49c52544b21a60665139 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 10 Jul 2013 04:15:13 +0000 Subject: [PATCH] Fix the chown and chgrp methods for the filesystem API's SSH2 transport. fixes #24277. git-svn-id: http://core.svn.wordpress.org/trunk@24626 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-filesystem-ssh2.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/class-wp-filesystem-ssh2.php b/wp-admin/includes/class-wp-filesystem-ssh2.php index 3114456e09..8ff3cb18e7 100644 --- a/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -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) {