Обновление Drupal 7 до версии 7.24

Главные вкладки

Аватар пользователя Funtik44 Funtik44 21 ноября 2013 в 22:56

После очередного обновления Drupal 7 до версии 7.24 в отчете о состоянии вылетели следующие ошибки:

Private files directory Not fully protected
See http://drupal.org/SA-CORE-2013-003 for information about the recommended .htaccess file which should be added to the sites/default/files/private directory to help protect against arbitrary code execution.

Public files directory Not fully protected
See http://drupal.org/SA-CORE-2013-003 for information about the recommended .htaccess file which should be added to the sites/default/files directory to help protect against arbitrary code execution.

Temporary files directory Not fully protected
See http://drupal.org/SA-CORE-2013-003 for information about the recommended .htaccess file which should be added to the sites/default/files/temp directory to help protect against arbitrary code execution.

Не пойму, что нужно сделать, чтобы исправить?

Комментарии

Аватар пользователя Funtik44 Funtik44 21 ноября 2013 в 23:45

Собственно решил проблему. Всё оказалось просто, кипишнул не прочитав доки. Для тех, кто в танке, как я, объясню на русском:

1. Идем в отчет о состоянии - admin/reports/status
2. Смотрим пути, на которые ругается Drupal, у меня это было три пути (думаю у вас тоже):
sites/default/files/private
sites/default/files
sites/default/files/temp
2. Идем по этим путям и видим там файлики .htaccess
3. Каждый файлик .htaccess открываем на редактирование и заменяем все содержимое на:

# Turn off all options we don't need.
Options None
Options +FollowSymLinks

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
  # Override the handler again if we're run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>

5. Идем в admin/config/media/file-system и нажимаем кнопку "сохранить".
6. Смотрим опять отчет о состоянии - admin/reports/status и видим, что ошибки ушли.

- https://drupal.org/SA-CORE-2013-003

Аватар пользователя Funtik44 Funtik44 28 ноября 2013 в 18:28

На друпал орг написано, что необходимо ручками править, я же ссылку привел.

При обновлении, у меня в этих дерикториях создались .htaccess, но не такие, какие нужно.

Аватар пользователя gedeon gedeon 28 ноября 2013 в 18:40

привел, да не читал "Alternatively, you can remove the .htaccess file from each directory using SFTP or SSH and then visit the file system configuration page (admin/settings/file-system in Drupal 6 or admin/config/media/file-system in Drupal 7) and click the save button to have Drupal create the file automatically."

щас спецом зашёл, у меня такой файлик создался

Turn off all options we don't need.
Options None
Options +FollowSymLinks

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
  # Override the handler again if we'

re run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>

Аватар пользователя Funtik44 Funtik44 29 ноября 2013 в 7:31

Да, интересно. Может быть они внесли изменения, т.к. я обновлялся прям сразу после выхода обновления.

Специально открывал инструкцию и делал всё по ней.

Аватар пользователя Mneznakomec Mneznakomec 24 декабря 2013 в 15:30

Я только не понял, зачем мне вставлять в директории данные htaccess файлы, если я использую nginx+fpm-php?
Файлы положил, предупреждения исчезли, только толку-то от этих файлов. Smile

wingnx эти инструкции не перевёл для nginx.

Аватар пользователя keerosin keerosin 10 ноября 2015 в 11:49

Выручайте ребят сил уже нет этой папки tmp небыло создал кинул файл туда ошибка одна и таже
Temporary files directory Not fully protectedSee http://drupal.org/SA-CORE-2013-003 for information about the recommended .htaccess file which should be added to the /tmp directory to help protect against arbitrary code execution.

Аватар пользователя leramulina leramulina 19 марта 2014 в 7:20

Смотрела я на эти htaccess файлы. У меня в них текст точно такой же как и у вас. Права на каталоги 700. Пробовала по рецепту удалить все htaccess из tmp, sites/default/files, sites/defaul/files/private и после запуска крона они обновились. С тем же текстом.

Тем не менее backup_migrate ругается

Security notice: Backup and Migrate will not save backup files to the server because the destination directory is publicly accessible. If you want to save files to the server, please secure the 'sites/default/files/private/backup_migrate/manual' directory
Security notice: Backup and Migrate will not save backup files to the server because the destination directory is publicly accessible. If you want to save files to the server, please secure the 'sites/default/files/private/backup_migrate/manual' directory
Could not run backup because the file could not be saved to the destination.

И файлы, сложенные в приватной папке доступны из браузера.