version 1 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
dotlock |
|
|
2 |
!!!dotlock |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
FILES |
|
|
8 |
SEE ALSO |
|
|
9 |
DIAGNOSTICS |
|
|
10 |
NOTES |
|
|
11 |
HISTORY |
|
|
12 |
AUTHOR |
|
|
13 |
---- |
|
|
14 |
!!NAME |
|
|
15 |
|
|
|
16 |
|
|
|
17 |
mutt_dotlock - Lock mail spool files. |
|
|
18 |
!!SYNOPSIS |
|
|
19 |
|
|
|
20 |
|
|
|
21 |
__mutt_dotlock__ [[-t|-f|-u|-d] [[-p] [[-r ''retries''] |
|
|
22 |
''file'' |
|
|
23 |
!!DESCRIPTION |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
__mutt_dotlock__ implements the traditional mail spool |
|
|
27 |
file locking method: To lock ''file'', a file named |
|
|
28 |
''file''.lock is created. The program operates with group |
|
|
29 |
mail privileges if necessary. |
|
|
30 |
!!OPTIONS |
|
|
31 |
|
|
|
32 |
|
|
|
33 |
-t |
|
|
34 |
|
|
|
35 |
|
|
|
36 |
Just try. __mutt_dotlock__ won't actually lock a file, |
|
|
37 |
but inform the invoking process if it's at all possible to |
|
|
38 |
lock ''file''. |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
-f |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
Force the lock. If another process holds a lock on |
|
|
45 |
''file'' longer than a certain amount of time, |
|
|
46 |
__mutt_dotlock__ will break that lock by removing the |
|
|
47 |
lockfile. |
|
|
48 |
|
|
|
49 |
|
|
|
50 |
-u |
|
|
51 |
|
|
|
52 |
|
|
|
53 |
Unlock. __mutt_dotlock__ will remove |
|
|
54 |
''file''.lock. |
|
|
55 |
|
|
|
56 |
|
|
|
57 |
-d |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
Delete. __mutt_dotlock__ will lock ''file'', remove it |
|
|
61 |
if it has length 0, and afterwards remove |
|
|
62 |
''file''.lock. |
|
|
63 |
|
|
|
64 |
|
|
|
65 |
-p |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
Use privileges. If given this option, __mutt_dotlock__ |
|
|
69 |
will operate with group mail privileges when creating and |
|
|
70 |
deleting lock files. |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
-r ''retries'' |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
This command line option tells __mutt_dotlock__ to try |
|
|
77 |
locking ''retries'' times before giving up or (if invoked |
|
|
78 |
with the __-f__ command line option) break a lock. The |
|
|
79 |
default value is 5. __mutt_dotlock__ waits one second |
|
|
80 |
between successive locking attempts. |
|
|
81 |
!!FILES |
|
|
82 |
|
|
|
83 |
|
|
|
84 |
''file''.lock |
|
|
85 |
|
|
|
86 |
|
|
|
87 |
The lock file __mutt_dotlock__ generates. |
|
|
88 |
!!SEE ALSO |
|
|
89 |
|
|
|
90 |
|
|
|
91 |
fcntl(2), flock(2), lockfile(1), |
|
|
92 |
mutt(1) |
|
|
93 |
!!DIAGNOSTICS |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
__mutt_dotlock__ gives all diagnostics in its return |
|
|
97 |
values: |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
__0 - DL_EX_OK__ |
|
|
101 |
|
|
|
102 |
|
|
|
103 |
The program was successful. |
|
|
104 |
|
|
|
105 |
|
|
|
106 |
__1 - DL_EX_ERROR__ |
|
|
107 |
|
|
|
108 |
|
|
|
109 |
An unspecified error such as bad command line parameters, |
|
|
110 |
lack of system memory and the like has occured. |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
__3 - DL_EX_EXIST__ |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
The user wants to lock a file which has been locked by |
|
|
117 |
another process already. If __mutt_dotlock__ is invoked |
|
|
118 |
with the __-f__ command line option, __mutt_dotlock__ |
|
|
119 |
won't generate this error, but break other processes' |
|
|
120 |
locks. |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
__4 - DL_EX_NEED_RPIVS__ |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
This return value only occurs if __mutt_dotlock__ has |
|
|
127 |
been invoked with the __-t__ command line option. It |
|
|
128 |
means that __mutt_dotlock__ will have to use its group |
|
|
129 |
mail privileges to lock ''file''. |
|
|
130 |
|
|
|
131 |
|
|
|
132 |
__5 - DL_EX_IMPOSSIBLE__ |
|
|
133 |
|
|
|
134 |
|
|
|
135 |
This return value only occurs if __mutt_dotlock__ has |
|
|
136 |
been invoked with the __-t__ command line option. It |
|
|
137 |
means that __mutt_dotlock__ is unable to lock ''file'' |
|
|
138 |
even with group mail privileges. |
|
|
139 |
!!NOTES |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
__mutt_dotlock__ tries to implement an NFS-safe |
|
|
143 |
dotlocking method which was borrowed from __lockfile__ |
|
|
144 |
(1). |
|
|
145 |
|
|
|
146 |
|
|
|
147 |
If the user can't open ''file'' for reading with his |
|
|
148 |
normal privileges, __mutt_dotlock__ will return the |
|
|
149 |
__DL_EX_ERROR__ exit value to avoid certain attacks |
|
|
150 |
against other users' spool files. The code carefully avoids |
|
|
151 |
race conditions when checking permissions; for details of |
|
|
152 |
all this see the comments in dotlock.c. |
|
|
153 |
!!HISTORY |
|
|
154 |
|
|
|
155 |
|
|
|
156 |
__mutt_dotlock__ is part of the Mutt mail user agent |
|
|
157 |
package. It has been created to avoid running mutt with |
|
|
158 |
group mail privileges. |
|
|
159 |
!!AUTHOR |
|
|
160 |
|
|
|
161 |
|
|
|
162 |
Thomas Roessler |
|
|
163 |
---- |