From 381110d9f20ea4edabfd22a84952e86cff254fea 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: https://develop.svn.wordpress.org/trunk@24626 602fd350-edb4-49c9-b593-d223f7449a82 --- 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) {