OK. I've been testing spamassassin from CVS, and I've been getting the
bizarre error message that Craig reports, the `Cannot open: File exists'
one. However, in my case this can't be blamed on `a stupid RedHat
configuration error', because I'm not running RedHat (or any
distribution).

Looking at the code, libdb-2.7.7 is adding O_EXCL to the options passed
in no matter what, and then it endeavours to remove it and retry, so it
*is* opening the db file happily, but we're picking up an old $! from
its first O_EXCL call.

libdb-2.7.7's db_open call doesn't set errno at all itself, and DB_File
and AnyDBM don't reset it, so relying upon $! is a bad idea here. (This
is, of course, in violation of libdb's documentation :( )

--- why the db_open call is failing I am not sure yet, but if you
restructure the failing code in new_checker to this ugliness:

         if ( -f $path ) {
           tie %{$self->{accum}},"AnyDBM_File",$path, O_RDWR,   #open rw w/lock
                         (oct ($main->{conf}->{auto_whitelist_file_mode}) & 0666)
               or die "Cannot open existing auto_whitelist_path $path: $!\n";
           
         } else {
           tie %{$self->{accum}},"AnyDBM_File",$path, O_RDWR|O_CREAT,   #open rw w/lock
                         (oct ($main->{conf}->{auto_whitelist_file_mode}) & 0666)
               or die "Cannot open auto_whitelist_path $path for creation: $!\n";
         }

(i.e. only passing O_CREAT when a file will be created) then DB_File
*still* dies every time, but errno isn't set at all the second time,
leading to the edifying error message

Cannot open auto_whitelist_path /home/compiler/.spamassassin/auto-whitelist: 

There are a number of error paths in libdb's db_open code that return
with an error but print no error messages; I'm going to add error
messages to all of them and see which one's *actually* failing. One
thing's for sure: errno is lying, and this has nothing to do with
O_EXCL.


btw, I can see nothing in RedHat's bug database that might correspond to
a report of this bug, but maybe I'm overlooking something. (Bugzilla has
long had a grudge against me ;) )

Has anyone tracked this down before? The auto-whitelist looks a very
nifty feature, if only I could get it to work :)

-- 
`Frankly I wonder whether you are not writing your posts from underneath a
 bridge.' --- Jason Clifford, to a particularly dense troll

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to