[milters] Archive

Lists Index Date Thread Search

Article: 722
From: Anthony Howe
Date: 2005-09-19 02:09:22 -0400
Subject: How Snert milters detect access.db updates.

Removal...........: milters-request@milter.info?subject=remove
More information..: http://www.milter.info/#Support

I'm writing this more for archive history and general information.

I had a bug report this weekend concerning an issue with access.db 
updates not being properly handled by a Snert milter, forcing the admin 
to restart the milter each time.

I was baffled as to what could be the problem, since all the typical 
file permissions and ownership issues were correct.

Now the smdb code in LibSnert used by the milters uses fstat() on the 
open file descriptor of the access.db to detect a new timestamp when the 
file has been updated. At which point it closes and reopens the .db file 
so as to flush the BDB library's internal structures.

After I mentioned this to the bug reporter, it obvious struct a cord 
with them:

	We found that we were moving the old access.db away, and then
	running makmap on an empty file, which makes a new file and
	inode.  The old file was then being unlinked, but  technically
	no changes were made to that [old] inode.  We changed our
	generate software, and all is fine now.

My method of detecting file updates is not wrong, just different. It 
assumes that most people overwrite access.db, instead of rename & 
create. This makes the fstat() on an open file descriptor more efficient 
than the slower stat().

Anthony C Howe                                 +33 6 11 89 73 78
http://www.snert.com/       ICQ:
7116561         AIM: Sir Wumpus

Sendmail Anti-Spam Solutions           http://www.snertsoft.com/
                                             We Serve Your Server

Lists Index Date Thread Search