1dotlock(1)                       User Manuals                       dotlock(1)
2
3
4

NAME

6       lbdb_dotlock - Lock mail spool files.
7

SYNOPSIS

9       lbdb_dotlock [-t|-f|-u|-d] [-r retries] file
10

DESCRIPTION

12       dotlock  implements  the traditional mail spool file locking method: To
13       lock file, a file named file.lock is created.
14

OPTIONS

16       -t     Just try.  dotlock won't actually lock a file,  but  inform  the
17              invoking process if it's at all possible to lock file.
18
19       -f     Force  the lock.  If another process holds a lock on file longer
20              than a certain amount of time, dotlock will break that  lock  by
21              removing the lockfile.
22
23       -u     Unlock.  dotlock will remove file.lock.
24
25       -d     Delete.   dotlock  will lock file, remove it if it has length 0,
26              and afterwards remove file.lock.
27
28       -r retries
29              This command line option tells dotlock to  try  locking  retries
30              times  before  giving up or (if invoked with the -f command line
31              option) break a lock.  The default value is  5.   dotlock  waits
32              one second between successive locking attempts.
33

FILES

35       file.lock
36              The lock file dotlock generates.
37

SEE ALSO

39       fcntl(2), flock(2), lockfile(1), lbdb-fetchaddr(1)
40

DIAGNOSTICS

42       dotlock gives all diagnostics in its return values:
43
44       0 - DL_EX_OK
45              The program was successful.
46
47       1 - DL_EX_ERROR
48              An  unspecified  error such as bad command line parameters, lack
49              of system memory and the like has occurred.
50
51       3 - DL_EX_EXIST
52              The user wants to lock a file which has been locked  by  another
53              process already.  If dotlock is invoked with the -f command line
54              option, dotlock won't generate this error, but break other  pro‐
55              cesses' locks.
56
57       4 - DL_EX_NEED_RPIVS
58              This  return  value only occurs if dotlock has been invoked with
59              the -t command line option.  It means that dotlock will have  to
60              use its group mail privileges to lock file.
61
62       5 - DL_EX_IMPOSSIBLE
63              This  return  value only occurs if dotlock has been invoked with
64              the -t command line option.  It means that dotlock is unable  to
65              lock file.
66

NOTES

68       dotlock tries to implement an NFS-safe dotlocking method which was bor‐
69       rowed from lockfile(1).
70
71       If the user can't open file for reading  with  his  normal  privileges,
72       dotlock will return the DL_EX_ERROR exit value to avoid certain attacks
73       against other users' spool files. The code carefully avoids race condi‐
74       tions  when  checking permissions; for details of all this see the com‐
75       ments in dotlock.c.
76

HISTORY

78       dotlock is part of the Mutt mail user agent package.  It has been  cre‐
79       ated to avoid running mutt with group mail privileges.
80

AUTHOR

82       Thomas Roessler <roessler@guug.de>
83
84
85
86Unix                             JANUARY 2016                       dotlock(1)
Impressum