Re: [exim-dev] mbx locking bug in CYGWIN

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: 田斌
CC: exim-dev
Subject: Re: [exim-dev] mbx locking bug in CYGWIN
On Tue, 15 Mar 2005, [gb2312] Ìï±ó wrote:

> MBX LOCKING
>
> If use_mbx_lock is set (this is supported only if SUPPORT_MBX is defined)
> then the rules used for locking in c-client are used. Exim takes out a shared
> lock on the mailbox file, and an exclusive lock on the file whose name is
> /tmp/.<device-number>.<inode-number>. The shared lock on the mailbox stops
> any other MBX client from getting an exclusive lock on it and expunging it.
> It also stops any other MBX client from unlinking the /tmp lock when it has
> finished with it.
>
> the problem is that the shared lock on the mailbox file deny the
> next writing op to the mailbox in CYGWIN. A permission denied error
> will occur during copy_mbx_message call becuase of the shared lock.
>
> and i think the shared lock doen't make sense, it should be a
> exclusive lock. maybe the shared lock behave well in linux or other
> OS, but how about if the filesystem is mounted with mandatory
> locking? i'm not familar with linux, and i'm just wondering.


The MBX locking rules are specifically defined by the folks who invented
the MBX mailbox format. The whole idea is to enable the use of shared
mailboxes. I have a document entitled

         UNIX Advisory File Locking Implications on c-client          
                    Mark Crispin, 28 November 1995                    


which describes the method, and also has a lot of detail about problems
with locking in different flavours of Unix. It is all a horrible mess
(the locking, I mean, not the document).

I am not surprised that problems arise with CYGWIN, but there is no way
that the MBX locking rules will be changed in Exim.

Why do you want to use MBX mailboxes, anyway? Is there some problem
with the default Berkeley mailbox format?

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book