4 .\" Copyright (C) 1996-8 Michael R. Elkins <me@cs.hmc.edu>
5 .\" Copyright (C) 1998-9 Thomas Roessler <roessler@does-not-exist.org>
7 .\" This program is free software; you can redistribute it and/or modify
8 .\" it under the terms of the GNU General Public License as published by
9 .\" the Free Software Foundation; either version 2 of the License, or
10 .\" (at your option) any later version.
12 .\" This program is distributed in the hope that it will be useful,
13 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
14 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 .\" GNU General Public License for more details.
17 .\" You should have received a copy of the GNU General Public License
18 .\" along with this program; if not, write to the Free Software
19 .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 .TH dotlock 1 "AUGUST 1999" Unix "User Manuals"
23 mutt_dotlock \- Lock mail spool files.
27 [-t|-f|-u|-d] [-p] [-r \fIretries\fP] \fIfile\fP
31 implements the traditional mail spool file locking method:
32 To lock \fIfile\fP, a file named \fIfile\fP.lock is
33 created. The program operates with group mail privileges
40 won't actually lock a file, but inform the invoking
41 process if it's at all possible to lock \fIfile\fP.
43 Force the lock. If another process holds a lock on
44 \fIfile\fP longer than a certain amount of time,
46 will break that lock by removing the lockfile.
50 will remove \fIfile\fP.lock.
54 will lock \fIfile\fP, remove it if it has length 0, and afterwards
55 remove \fIfile\fP.lock.
57 Use privileges. If given this option,
59 will operate with group mail privileges when creating and
61 .IP "-r \fIretries\fP"
62 This command line option tells
65 \fIretries\fP times before giving up or (if invoked with
68 command line option) break a lock. The default value is 5.
70 waits one second between successive locking attempts.
86 gives all diagnostics in its return values:
89 The program was successful.
92 An unspecified error such as bad command line parameters,
93 lack of system memory and the like has occured.
97 user wants to lock a file which has been locked by
98 another process already. If
104 won't generate this error, but break other processes'
107 .B "4 \- DL_EX_NEED_RPIVS"
108 This return value only occurs if
113 command line option. It means that
115 will have to use its group mail privileges to lock
118 .B "5 \- DL_EX_IMPOSSIBLE"
119 This return value only occurs if
121 has been invoked with the
123 command line option. It means that
125 is unable to lock \fIfile\fP even with group mail
130 tries to implement an NFS-safe dotlocking method which was
135 If the user can't open \fIfile\fP for reading with his
140 exit value to avoid certain attacks against other users'
141 spool files. The code carefully avoids race conditions
142 when checking permissions; for details of all this see the
143 comments in dotlock.c.
147 is part of the Mutt mail user agent package. It has been
148 created to avoid running mutt with group mail privileges.
150 Thomas Roessler <roessler@does-not-exist.org>