http://bugzilla.spamassassin.org/show_bug.cgi?id=3731





------- Additional Comments From [EMAIL PROTECTED]  2004-08-26 10:24 -------
Subject: Re:  [review] umask isn't correctly reset in some situations

On Thu, Aug 26, 2004 at 10:16:34AM -0700, [EMAIL PROTECTED] wrote:
> I worry when I see the same complex piece of code repeated 4 times with very
> slight variations. For example, I don't see why O_EXCL is used in some cases 
> but
> not others. Would it not make sense to factor the tie statement and its umask
> wrapper to a new method to make sure that future updates catch all the 
> instances
> consistently? Parameters would be the hash, filename, and open flags.

Well, the sections of code are doing different things.  The first tie() wants
to create a new database file which will get the upgraded token information.
So you want O_EXCL so that the tie fails if the new/temp file already exists.
The second tie() sets the new DB (after the temp one was renamed, etc,) active
for SA to use it.  It replicates the tie() call in tie_db_writable(), and
should *not* fail if the file already exists (since it is, after all, trying
to open an already existing file).

I do think the code can (always?) be refactored a bit more, but it's ok
for now imo.





------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

Reply via email to