Skip to content

Instantly share code, notes, and snippets.

@bangpound
Last active November 23, 2015 20:03
Show Gist options
  • Save bangpound/be3f83fc9f355b92b61b to your computer and use it in GitHub Desktop.
Save bangpound/be3f83fc9f355b92b61b to your computer and use it in GitHub Desktop.
Disables Drupal 8's security feature that removes write permission on sites/*, sites/*/settings.php, sites/*/settings.local.php, sites/*/services.yml. You should never deploy this code. It's only for local development environments.
diff --git a/docroot/core/modules/system/system.install b/docroot/core/modules/system/system.install
index c9e8175..3841e6e 100644
--- a/docroot/core/modules/system/system.install
+++ b/docroot/core/modules/system/system.install
@@ -365,12 +365,12 @@ function system_requirements($phase) {
else {
$site_path = DrupalKernel::findSitePath(Request::createFromGlobals());
}
- if (!drupal_verify_install_file($site_path, FILE_NOT_WRITABLE, 'dir')) {
+ if (!drupal_verify_install_file($site_path, FILE_WRITABLE, 'dir')) {
$conf_errors[] = t("The directory %file is not protected from modifications and poses a security risk. You must change the directory's permissions to be non-writable.", array('%file' => $site_path));
}
foreach (array('settings.php', 'settings.local.php', 'services.yml') as $conf_file) {
$full_path = $site_path . '/' . $conf_file;
- if (file_exists($full_path) && !drupal_verify_install_file($full_path, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE)) {
+ if (file_exists($full_path) && !drupal_verify_install_file($full_path, FILE_EXIST|FILE_READABLE|FILE_WRITABLE)) {
$conf_errors[] = t("The file %file is not protected from modifications and poses a security risk. You must change the file's permissions to be non-writable.", array('%file' => $full_path));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment