Closed (duplicate)
Project:
Drupal core
Version:
7.24
Component:
file system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Nov 2013 at 23:22 UTC
Updated:
25 Nov 2013 at 16:13 UTC
Jump to comment: Most recent
Comments
Comment #1
niek_kloots commentedDrupal: 6.29
MySQL database : 5.5.32
PHP: 5.3.27
Web server: Apache
I've added a .htaccess file to my existing files and to files/tmp but the warning doesn't goes away.
Tried a fresh install on a test site and Drupal makes a .htaccess file in the files directory but not in the files/tmp directory but still the warning stays.
What is wrong?
Comment #2
niek_kloots commentedComment #3
varkenshand commentedBeen fighting with this one for over two hours, too. But got it solved.
The tmp directory file needs an extra line, like it says in the (poor) documentation. "Deny from all" should be added, presumably as first line of the file.
It looks like the file is created automatically when you (re)define the tmp location through the Drupal UI.
Comment #4
niek_kloots commentedEven a new install (on a test site) gives the same warning with the automatic created .htaccess file .
Added the line and it doesn't work.
In my /tmp I have the following .htaccess
Comment #5
bezu60 commentedFor us newbies this is a bear!! Will this be fixed in the next update? And if I don't do anything what will happen?
Comment #6
David_Rothstein commentedClosing as a duplicate (well, partial duplicate) of #2141065: Incorrect warnings about insecure .htaccess file in /tmp directory from SA-CORE-2013-003; see that issue for details.
But in short, to answer your original question, @joelcollinsdc, as long as the temporary files directory is outside the webroot (for example, in /tmp) the .htaccess file is unnecessary and you don't have to worry about it. In that case, it will indeed get wiped occasionally (when the /tmp directory gets wiped) but it's also OK since the .htaccess file isn't needed in that case anyway. As a bit of a hack for this situation, the Status Report page will try to create the .htaccess file again every time you visit the Status Report (to prevent misleading error messages from appearing there).
@Niek_Kloots, it sounds like your issue is that you are creating the .htaccess file in "files/tmp" but that doesn't match the actual location ("/tmp") that your Drupal site is configured to use for temporary files. Again, see the above issue for more details.
Comment #7
Goofy2k2 commentedsubscribe
Comment #8
niek_kloots commented@David_Rothstein Thank you that worked.
previous I had in
File system path: files and
Temporary directory: /tmp
I changed /tmp in files/tmp and the warning disappeared.
Strange that previous /tmp was enough for the system to know the where the /tmp was.
Comment #9
David_Rothstein commentedAs described in #2141065: Incorrect warnings about insecure .htaccess file in /tmp directory from SA-CORE-2013-003 switching the configuration to use files/tmp (in the public web root) is not recommended. It is better to leave it at /tmp.