Does Drupal modify the permissions on folder within the sites folder? Is there an edge case where this is possible outside of install?

I've been seeing an issue where a sites folder whether it be default or blah.com is getting it's write permissions removed after loading the site.

It's not specific to one codebase, it occurs across multiple codebases (no modifications to core) and across multiple versions 6/7.

This is problematic when using git with a specific site folder as git can no longer perform checkouts and merges without the write permissions.


String chmod is found in 11 files in my Drupal 7.22 installation. Next 9 occurrences are found in Drush and Coder modules, and one in Examples for Developers module.

One of the files frequently turned read only is settings.php and it is done exactly to stop people from overwriting it with automatic tools.

  • Thanks, I've tracked down an edge case with prepareInstallDirectory thanks to this answer.
    – digital
    May 15 '13 at 10:51

Yes drupal modify default folder permission during runtime, and this folder is what exactly you should add it to your .gitignore because it contains user uploaded files which have not value to keeping in repository.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.