WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#19313 closed enhancement (duplicate)

improved file system install method detection - allow direct install if user or group permissions match

Reported by: neosource Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:

Description

The reason I made this patch was because all versions of WordPress that I've installed on my local debian server fail to automatically use the direct file system method.

The permissions structure of my server allows group write access to the web folders. The current method only does a single myuid() check. I've expanded this to check for groupid and also included the posix methods.

It saves having to modify the wp-config with FS_METHOD to allow plugins/themes to be installed more easily.

I hope this helps make plugin/theme installations easier on similarly configured web hosts, without having to bother with FTP install etc.

Attachments (1)

2011-1122-install-method-permissions.txt (744 bytes) - added by neosource 2 years ago.

Download all attachments as: .zip

Change History (6)

comment:2 sirzooro2 years ago

  • Cc sirzooro added

posix_* functions are not available on Windows - you need to check if they are present before calling them.

comment:3 neosource2 years ago

  • Resolution set to duplicate
  • Status changed from new to closed
  • Type changed from defect (bug) to enhancement

Thanks for adding the related tickets Sergey. This is the first time I've tried contributing to WordPress. I didn't see the related tickets when doing my intial search, which wasn't exhaustive enough by the looks of it :p

Hmm, seems this patch may cause other issues, and the posix functions not being available on windows should be checked for existence as well. Yes I just realised, thanks sirzooro.

I've marked it as duplicate, and perhaps I might submit a patch to include a commented line of define('FS_METHOD, 'direct'); in wp-config instead, to make people more aware of it ...?

comment:4 SergeyBiryukov2 years ago

  • Milestone Awaiting Review deleted

comment:5 dd322 years ago

I might submit a patch to include a commented line of define('FS_METHOD, 'direct'); in wp-config instead, to make people more aware of it ...?

I'd want to avoid that too, Core should automatically select the best option for the environment it's on, WordPress should be able to determine it better than most users can (Face it, most users think their host is secure too, I'd be willing to be a large chunk that currently use FTP upgrades are quite simply, not, and allow for cross-account file modifications in the wrong situation).

If there's a case where we should take into account the group settings for creating new files then it's a worthy addition, unfortunately, since WordPress can't change the ownership of files from group:group to user:group, the only case of user:group files being created should be handled by the existing code.

Note: See TracTickets for help on using tickets.