Subject: Troubles with "dot locks"

From: Federico Giannici <[email-masked]>
Date: Tue, 24 Aug 1999 16:07:03 +0200

I have installed the ipop3d and imapd servers since about a week.
They are installed in a UNIX PC, with OpenBSD 2.5 i386.

They seam to work ok, but I have some problem with the "dot locks" (the
ones into the /tmp directory).

>From time to time (about a couple times a day) a dot-lock file remains
into the /tmp directory while the associated process no longer exists.

Obviously this is really bad because the user can no longer read his
email...

Now I have two questions:

1) Is this behaviour normal? What I could try to solve it?

2) Assuming that the flock() function is perfect, what is the reason to
use these "dot locks"?
Isn't the flock() mechanism sufficient?

Thanks,
___________________________________________________
    __
   |-                      [email-masked]
   |ederico Giannici      http://www.neomedia.it

        Amministratore unico - NEOMEDIA sas
___________________________________________________
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Tue, 24 Aug 1999 07:19:31 -0700 (PDT)

> 1) Is this behaviour normal? What I could try to solve it?

No, it is not normal for a user to be locked out.

Did you modify the source code?  In particular, did you change lock file
protection from its default 0666?  Certain sorcerer's apprentices advocate
doing this; if you followed their (incorrect) advice that could be the cause.

> 2) Assuming that the flock() function is perfect, what is the reason to

Please read the file imap-4.6/docs/locking for an explanation.

> Isn't the flock() mechanism sufficient?

Not it is not.  Two separate and independent lock states are required for
proper and safe operation.

---

From: Mark Crispin <[email-masked]>
Date: Tue, 24 Aug 1999 07:53:17 -0700 (PDT)

On Tue, 24 Aug 1999, Federico Giannici wrote:
> The only difference from what is written into the docs is that my
> /usr/tmp is 0644 instead of 01777.
> 
> Is /usr/tmp used in any way?

/usr/tmp is used by many implementations of tmpfile().  It should be
01777.

---

From: Federico Giannici <[email-masked]>
Date: Tue, 24 Aug 1999 16:50:43 +0200

Mark Crispin wrote:
> Did you modify the source code?

I made only a very little modification, but in server_login() for a
custom password checking...

> In particular, did you change lock file

Absolutely not!

> Please read the file imap-4.6/docs/locking for an explanation.

I already read it, but it only says that this third mechanism is
necessary but doesn'y say why!
What cannot you do with flock()?

> proper and safe operation.

Ok, so I have to make it work...
But how???

Thanks,