Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21565: Change mkdir to use correct and more secure mode numbers #120

Merged
merged 2 commits into from
May 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions wp-cli/civicrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private function install() {
$upload_dir = wp_upload_dir();
$settings_dir = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR;
civicrm_setup( $upload_dir['basedir'] . DIRECTORY_SEPARATOR );
WP_CLI::launch( "chmod 0777 $settings_dir -R" );
WP_CLI::launch( "chmod 0755 $settings_dir -R" );

# now we've got some files in place, require PEAR DB and check db setup
$dsn = "mysql://{$dbuser}:{$dbpass}@{$dbhost}/{$dbname}?new_link=true";
Expand Down Expand Up @@ -654,7 +654,7 @@ private function restore() {

$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 );
}

Expand Down Expand Up @@ -999,7 +999,7 @@ private function upgrade() {
# 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 );
}

Expand Down