1lckpwdf(3C) Standard C Library Functions lckpwdf(3C)
2
3
4
6 lckpwdf, ulckpwdf - manipulate shadow password database lock file
7
9 #include <shadow.h>
10
11 int lckpwdf(void);
12
13
14 int ulckpwdf(void);
15
16
18 The lckpwdf() and ulckpwdf() functions enable modification access to
19 the password databases through the lock file. A process first uses lck‐
20 pwdf() to lock the lock file, thereby gaining exclusive rights to mod‐
21 ify the /etc/passwd or /etc/shadow password database. See passwd(4)
22 and shadow(4). Upon completing modifications, a process should release
23 the lock on the lock file using ulckpwdf(). This mechanism prevents
24 simultaneous modification of the password databases. The lock file,
25 /etc/.pwd.lock, is used to coordinate modification access to the pass‐
26 word databases /etc/passwd and /etc/shadow.
27
29 If lckpwdf() is successful in locking the file within 15 seconds, it
30 returns 0. If unsuccessful (for example, /etc/.pwd.lock is already
31 locked), it returns −1.
32
33
34 If ulckpwdf() is successful in unlocking the file /etc/.pwd.lock, it
35 returns 0. If unsuccessful (for example, /etc/.pwd.lock is already
36 unlocked), it returns −1.
37
39 These routines are for internal use only; compatibility is not guaran‐
40 teed.
41
43 /etc/passwd password database
44
45
46 /etc/shadow shadow password database
47
48
49 /etc/.pwd.lock lock file
50
51
53 See attributes(5) for descriptions of the following attributes:
54
55
56
57
58 ┌─────────────────────────────┬─────────────────────────────┐
59 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
60 ├─────────────────────────────┼─────────────────────────────┤
61 │MT-Level │MT-Safe │
62 └─────────────────────────────┴─────────────────────────────┘
63
65 getpwnam(3C), getspnam(3C), passwd(4), shadow(4), attributes(5)
66
67
68
69SunOS 5.11 29 Dec 1996 lckpwdf(3C)