Change mkdir to use correct and more secure mdoe numbers

The original setting of `777` is not a valid mode number for mkdir, and
should have been `0777` as it is an octal number. This has been changed
to `0755` to be in keeping with the wordpress permission scheme, which
is readable by all but only writeable by the current user. As these are
for backups a more strict setting may be preferable, but this is a
reasonable compromise
parent 9063b3b7
......@@ -654,7 +654,7 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
$restore_backup_dir .= '/plugins/restore/' . $date;
if ( ! mkdir( $restore_backup_dir, 777, true ) ) {
if ( ! mkdir( $restore_backup_dir, 0755, true ) ) {
return WP_CLI::error( 'Failed creating directory: ' . $restore_backup_dir );
}
......@@ -999,7 +999,7 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
# begin upgrade
$backup_dir .= '/plugins/' . $date;
if ( ! mkdir( $backup_dir, 777, true ) ) {
if ( ! mkdir( $backup_dir, 0755, true ) ) {
return WP_CLI::error( 'Failed creating directory: ' . $backup_dir );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment