Hi Paul,

On Sun, 12 Aug 2012 22:34:57 +1000
Paul Szabo <paul.sz...@sydney.edu.au> wrote:
>   ... fcntl() locking must be combined with dot locking.
>   To avoid deadlocks, a program should use fcntl() first
>   and dot locking after this, or alternatively implement
>   the two locking methods in a non blocking way[100]. Using
>   the functions maillock and mailunlock provided by the
>   liblockfile* packages is the recommended way to
>   realize this.
> Looking at an strace of /usr/lib/sm.bin/mail.local it seems to use
> /usr/lib/i386-linux-gnu/liblockfile.so.1 and shows:
>   link("/var/mail/.lk10336dp639", "/var/mail/psz.lock") = 0
>   open("/var/mail/psz", O_WRONLY|O_APPEND) = 4
>   fcntl64(4, F_SETLKW, {type=F_WRLCK, whence=SEEK_CUR, start=0,
> len=0}) = 0 which seems the wrong order.
In mail.local.c:deliver(), line 1109, lockmbox() is called and in line
1268, flock() is called blockingly (without LOCK_NB).

So: yes, I think you are right and I think this is a violation of the
policy. Unfortunately, I have far too little knowledge about sendmail
and NFS-safe locking, so I cannot submit a patch.

It might be helpful to include some basic instructions for non-sendmail
users on how to reproduce the issue at hand, just in case someone comes
along who knows about file locking and is willing to dive into
sendmail :-).

-- 
Best regards,
Michael


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to