[wp-trac] [WordPress Trac] #33480: After upgrade to 4.3 unable to update plugins.
WordPress Trac
noreply at wordpress.org
Mon Aug 24 06:25:19 UTC 2015
#33480: After upgrade to 4.3 unable to update plugins.
-------------------------------------+-----------------------------
Reporter: jobst | Owner: dd32
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.3.1
Component: Upgrade/Install | Version: 4.3
Severity: major | Resolution:
Keywords: needs-patch fixed-major | Focuses: administration
-------------------------------------+-----------------------------
Comment (by jobst):
I am trying to complete/fix the problem but I have discovered a small
issue that may (or may not) needs fixing before continuing.
@dd32, can you check my question (below) please.
Assumption: The function "owner" in class "class-wp-filesystem-ssh2.php"
on line 272 is partially wrong.
It gets the owneruid using
{{{
@fileowner('ssh2.sftp://'.$this->sftp_link.'/'.ltrim($file, '/'));
}}}
which is correct but then it gets the username using
{{{
$ownerarray = posix_getpwuid($owneruid);
}}}
which is trying to get a LOCAL username (if the UID exists!!) from a
REMOTE UID!
Which is incorrect (misleading -> false info).
It should really do below to get the required (username) info:
{{{
$username = $this->run_command(sprintf('stat -c %U %s',
escapeshellarg($file)), true);
return $username;
}}}
which will return the username immediately, bypassing the fileowner stuff
but rather executing "stat" on the remote machine getting the correct info
immediately.
So am I correct that the function "owner" has a bug?
Jobst
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33480#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list