Muffinresearch Labs by Stuart Colville

Dreamweaver lock files exposed | Comments (2)

Posted in Code on 22nd November 2005, 12:48 am by Stuart

This is a warning to anyone out there using Dreamweaver to check files in and out from their web server. The lock files (.lck) that tell your colleagues that you have a file checked out can be indexed by google and reveal information such as your name, a username and your email address to anyone that looks for them. This came about when one of my friends who uses Dreamweaver discovered information from a lock file available freely on the internet.

As an example of how widespread this issue is, the following google search reveals all .lck files that are created for php files using the search inurl:”php.lck”. Search Google for .lck files associated with php files

OK so how do I stop this?

Google has a special syntax that can be used in robots.txt files to prevent indexing of specific file extensions. Bear in mind this use of the asterisk wild card should not be used for other bots as it will fail.

User-agent: Googlebot
Disallow: /*.lck$

The problem with the robots.txt approach is that it doesn’t actually prevent anyone else (people or bots) accessing the lock files. To achieve the desired result we can make use of an apache directive to deny access to all .lck files. This configuration can be used in a .htaccess file or added to httpd.conf and it works by using regex to pattern match all files ending in .lck. Any attempts to view the lock files will result in a 403 forbidden error. Time to get those custom error pages looking sexy.

<FilesMatch "\.(lck|LCK)$">
  order allow,deny
  deny from all
</FilesMatch>

For more information on the FilesMatch Apache directive please visit the apache 1.3 documentation pages.

Post Tools

Comments: Add yours

1. On March 3rd, 2006 at 3:31 pm Jimmy said:

I think .LCK files should die in a FIRE. THEY SUCK.

What a horrible idea. 9000 extra fun files on my site. yaaaayy..!!

2. On October 8th, 2006 at 4:09 am Jonathan said:

You could just use FileZilla and FTP everything. Then again, you lose the functionality of enabling multiple contributors.

I’m always glad to run across a fellow WordPress’er! ;)







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Ubuntu: add-apt-repository: command not found|(2)

When you’re using a minimal Ubuntu install if you find the ‘add-apt-repository’ command is missing (it’s useful for adding PPAs and other repositories), then simply run:

sudo apt-get install python-software-properties

Photos on Flickr

© Copyright 2004-12 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.484s.