[Mimedefang] MIMEDefang broken-ness on OpenBSD

David F. Skoll dfs at roaringpenguin.com
Wed Mar 12 15:29:39 EDT 2008


Hello,

We've observed the following broken-ness with MIMEDefang on OpenBSD,
and a MIMEDefang user e-mailed me also.  The MIMEDefang user writes:

===========================================================================
my problem is these lines in /var/log/maillog:
lstat(/var/spool/MIMEDefang/mdefang-m2CIZBPa015192/Work/msg-13078-3.txt)
failed: No such file or directory

failed to clean up /var/spool/MIMEDefang/mdefang-m2CIZBPa015192: No such
file or directory

mimedefang-2.63
sendmail 8.14.1
OpenBSD 4.2 GENERIC.MP#0 i386
AMD Opteron 4 Processor 8218 Dual-Core 2.62 GHz

I have traced with ktrace to this very interesting point:

  3552 mimedefang CALL  getdirentries(0x9,0x89c43000,0x4000,0x85c9d654)
  3552 mimedefang RET   getdirentries 512/0x200
  3552 mimedefang CALL  lstat(0x81116c68,0x81114b38)
  3552 mimedefang NAMI
"/var/spool/MIMEDefang/mdefang-m2CI6GGq019997/Work/msg-1
3078-1.txt"
  3552 mimedefang RET   lstat 0
  3552 mimedefang CALL  unlink(0x81116c68)
  3552 mimedefang NAMI
"/var/spool/MIMEDefang/mdefang-m2CI6GGq019997/Work/msg-1
3078-1.txt"
  3552 mimedefang RET   unlink 0
  3552 mimedefang CALL  getdirentries(0x9,0x89c43000,0x4000,0x85c9d654)
  3552 mimedefang RET   getdirentries 0
  3552 mimedefang CALL  lstat(0x81116c68,0x81114b38)
  3552 mimedefang NAMI
"/var/spool/MIMEDefang/mdefang-m2CI6GGq019997/Work/msg-1
3078-1.txt"
  3552 mimedefang RET   lstat -1 errno 2 No such file or directory
  3552 mimedefang CALL  gettimeofday(0x81113e30,0)
  3552 mimedefang RET   gettimeofday 0
  3552 mimedefang CALL  getpid()

It looks like mimedefang deletes successfully the file
msg-13078-1.txt
and then tries to lstat it again, which fails
because the file isn't there no more.

Would you please be so kind as to verify the problem
with the attached ktrace file ?
===========================================================================

Looking at the file rm_r.c, I can't see any errors (and we only see
this on OpenBSD.)  It seems that the library call "readdir_r" on OpenBSD
is not setting result to NULL when it hits the end of the directory.
Any OpenBSD developers care to comment?

Regards,

David.




More information about the MIMEDefang mailing list