Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#9274 closed defect (bug) (fixed)

Filesystem Class for ftpext does not perform chmod for directories

Reported by: st3ff3n Owned by: DD32
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7.1
Component: Filesystem API Keywords: reporter-feedback
Focuses: Cc:


When I try to install or update a plugin with ftp, which comes with its own directory, the directory gets created with permission 400. The ftp_chmod function is not performed for created directories. wp-admin is not able, to acces this plugin. I don't know, if this is the desired behaviour, but I worked around this with the attached patch. The exists function always returns false for directories, so I changed the line to also check, if the argument is a directory.

Perhaps there are better ways, to do this.

Best regards, Steffen Hau

Attachments (1)

wordpress_admin_plugin_ftp.patch (472 bytes) - added by st3ff3n 9 years ago.

Download all attachments as: .zip

Change History (5)

#1 @DD32
9 years ago

  • Keywords reporter-feedback added
  • Milestone changed from Unassigned to 2.8
  • Owner set to DD32
  • Status changed from new to assigned
  • Type changed from feature request to defect (bug)

I'll look into this.

Can I get some examples however?

So, In short:

  • When you connect via FTP, The folders are created as chmod 400 (This would not be an issue alone to WP, It should happen when you connect via FTP to the host as well)
  • What chmod do you expect the folders to be?
  • What chmod are the created files/what do you expect them to be?
  • Have you defined FS_CHMOD_DIR / FS_CHMOD_FILE to see if that fixes your problem?
    • Note, You'd define those as such in your wp-config.php file: define('FS_CHMOD_DIR', 0660);(Note the leading zeo): [10050]

#2 @ryan
9 years ago

  • Component changed from Plugins to Filesystem

#3 @DD32
9 years ago

Havn't actually tested this, But looking at the code it seems like its definitely a possibility. The patch cant do any harm as well, So it might as well be commited.

Some extra look will be needed to see if ::exists() is returning true only for files.

#4 @ryan
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [11082]) Check if not exists and not is_dir before bailing. Props st3ff3n. fixes #9274

Note: See TracTickets for help on using tickets.