Ticket #1150 (closed defect: fixed)

Opened 1 year ago

Last modified 3 months ago

Incomplete cache files can lead to serving bad content

Reported by: gadams+lighttpd@avernus.com Assigned to: jan
Priority: normal Milestone: 1.4.19
Component: mod_compress Version: 1.4.18
Severity: major Keywords: patch
Cc: Blocking:
Need Feedback: 0

Description

I recently had the partition that contains my cache/compress directory become full. After that, each time a request was handled for a file that didn't already appear in the compressed cache, an error like the following was logged:

2007-04-25 09:58:47: (mod_compress.c.398) creating cachefile /tmp/cache/compress/stargaze/ILmass.htm-gzip-2289252-13601-1116618996 failed No space left on device

This was all fine, and the request was served with un-cached content, as you would expect. However, the next time that page was requested, the empty cache file would be found, and the request would be fulfilled with a zero-length response. I served a number of empty pages that day before I noticed.

The solution is simply to remove the compressed cache file if the write fails. A patch is attached.

Attachments

patch-1 (501 bytes) - added by gadams+lighttpd@avernus.com on 04/25/2007 08:08:24 PM.
Patch to fix mod_compress empty cache file problem

Change History

04/25/2007 08:08:24 PM changed by gadams+lighttpd@avernus.com

  • attachment patch-1 added.

Patch to fix mod_compress empty cache file problem

02/23/2008 12:00:49 PM changed by stbuehler

  • keywords set to patch.
  • version changed from 1.4.13 to 1.4.18.
  • pending changed.

02/27/2008 07:37:16 PM changed by stbuehler

  • status changed from new to closed.
  • resolution set to fixed.

I think you patched the wrong place; if open() failed, there is no new file to delete.
If the write (or the compression) fails, then the cache file should be removed.

Fixed in [2101]


Add/Change #1150 (Incomplete cache files can lead to serving bad content)




Change Properties
Action