]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 3497: Bad ssl_crtd db size file causes infinite loop
authorGuy Helmer <ghelmer@palisadesys.com>
Sat, 3 Mar 2012 23:38:55 +0000 (16:38 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 3 Mar 2012 23:38:55 +0000 (16:38 -0700)
commit95645397858c4522f0143265e90d90b9adb5e397
tree1c2e8809ad833e3c9765e48c34b42fb221b8a0a3
parent3279eda9931b8ca7188e85596842d9744b58cf3c
Bug 3497: Bad ssl_crtd db size file causes infinite loop

The db size file may become empty when Squid runs out of disk space. Ignoring
db size reading errors led to bogus db sizes used as looping condition. This
fix honors reading errors and also terminates the loop when no more
certificates can be removed. Both errors and removal failure are fatal to
ssl_crtd.

A positive side-effect of this fix is one less call to the relatively
expensive file-reading size()/readSize() methods under normal conditions.

I also removed "minimum db size" check because it did not seem to be in sync
with other ssl_crtd parameters such as fs block size and because its overall
purpose was unclear. The check was also removed by the original bug reporter.

TODO: Remaining problems include: ssl_crtd should not exit just because it
cannot write something to disk. A proper reporting/debugging API is missing.
src/ssl/certificate_db.cc