意外な盲点
先日、面倒を見ている某サイトで別会社さんがやっちゃってくれてました。本番サイトでプログラム修正するなよ!お陰で「*~」ファイルが直打ちで見えてしまう状態でした。
以下のblogではPHPファイルが対象ですが、cgiだろうがswfだろうがplだろうがrbだろうが、テキストファイルに対しては同じですね。あと、「*.BAK」とかも含めた方がヨサゲです。
Another pattern to look out for is backup files, some editors create backup versions of edited files in the same directory where the original file is located, for example, if you edit index.php, a backup called index.php~ will be created, given that this file doesn't end with .php, it will not be processed by the PHP engine, and it's code will also be available to users by requesting:
http://www.example.com/index.php~To circumvent the dangers mentioned above, you can use the following Apache directive:
Order allow,deny
Deny from all