[wp-trac] [WordPress Trac] #10205: getmyuid() called instead of posix_getuid() in get_filesystem_method() (wp-admin/includes/file.php)

WordPress Trac noreply at wordpress.org
Thu Sep 12 04:06:16 UTC 2013


#10205: getmyuid() called instead of posix_getuid() in get_filesystem_method() (wp-
admin/includes/file.php)
------------------------------------+-----------------------
 Reporter:  pgl                     |       Owner:  dd32
     Type:  enhancement             |      Status:  reopened
 Priority:  normal                  |   Milestone:  3.7
Component:  Filesystem              |     Version:  2.8
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+-----------------------

Comment (by dd32):

 > Attachment attachment:10205.2.diff​ added
 * This attachment enables Partial core updates to use the Direct FS
 handler when they would otherwise use FTP. This is a safe operation, as
 partial builds will not include new files, so this is just updating the
 contents of some files.
 * There is the downside that if `ABSPATH` and the current file IS
 writable, but some of the other core files which need to be modified are
 not writable, the upgrade will fail.
 * TODO: There should also be a check for ! empty( $api->added_files ) in
 addition to checking it's a partial build in use, so as to avoid cases in
 the future where a partial build will be forced to include extra files.

 > Attachment attachment:10205.3.diff​ added
 * This does effectively the same as we currently do in PHP to determine if
 we can use the Direct FS handler, except, it verifies it over FTP post-
 upgrade and stores the result in an option.
 * Verifies that files can be read/written to by both FTP and via local
 file operations
 * Doesn't handle the case where a database is moved to a new host, or, the
 server configuration changes making Direct upgrades impossible (This would
 prevent the user from installing, or upgrading, themes, plugins, and core)
 * TODO: Option should be cleared in the event of a upgrade failure, so as
 to prevent issues configuration changes, We could potentially also include
 things such as `ABSPATH` or `md5( ABSPATH . DB_NAME . DB_USER . DB_HOST )`
 or similar to invalidate the option after a hosting move

 Both of these patches can work side-by-side, and will reduce friction for
 upgrades (in particular, auto-upgrades), attachment:10205.2.diff is
 reasonably safe, attachment:10205.3.diff​ not so much for server
 configuration changes issues.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/10205#comment:31>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list