1pam_setcred(3PAM) PAM Library Functions pam_setcred(3PAM)
2
3
4
6 pam_setcred - modify or delete user credentials for an authentication
7 service
8
10 cc [ flag ... ] file ... -lpam [ library ... ]
11 #include <security/pam_appl.h>
12
13
14
15 int pam_setcred(pam_handle_t *pamh, int flags);
16
17
19 The pam_setcred() function is used to establish, modify, or delete user
20 credentials. It is typically called after the user has been authenti‐
21 cated and after a session has been validated. See pam_authenti‐
22 cate(3PAM) and pam_acct_mgmt(3PAM).
23
24
25 The user is specified by a prior call to pam_start() or pam_set_item(),
26 and is referenced by the authentication handle, pamh. The following
27 flags may be set in the flags field. Note that the first four flags
28 are mutually exclusive:
29
30 PAM_ESTABLISH_CRED Set user credentials for an authentication
31 service.
32
33
34 PAM_DELETE_CRED Delete user credentials associated with an
35 authentication service.
36
37
38 PAM_REINITIALIZE_CRED Reinitialize user credentials.
39
40
41 PAM_REFRESH_CRED Extend lifetime of user credentials.
42
43
44 PAM_SILENT Authentication service should not generate any
45 messages.
46
47
48
49 If no flag is set, PAM_ESTABLISH_CRED is used as the default.
50
52 Upon success, pam_setcred() returns PAM_SUCCESS. In addition to the
53 error return values described in pam(3PAM) the following values may be
54 returned upon error:
55
56 PAM_CRED_UNAVAIL Underlying authentication service can not retrieve
57 user credentials unavailable.
58
59
60 PAM_CRED_EXPIRED User credentials expired.
61
62
63 PAM_USER_UNKNOWN User unknown to underlying authentication service.
64
65
66 PAM_CRED_ERR Failure setting user credentials.
67
68
70 See attributes(5) for description of the following attributes:
71
72
73
74
75 ┌─────────────────────────────┬─────────────────────────────┐
76 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
77 ├─────────────────────────────┼─────────────────────────────┤
78 │Interface Stability │ Committed │
79 ├─────────────────────────────┼─────────────────────────────┤
80 │MT-Level │MT-Safe with exceptions │
81 └─────────────────────────────┴─────────────────────────────┘
82
84 pam(3PAM), pam_acct_mgmt(3PAM), pam_authenticate(3PAM),
85 pam_set_item(3PAM), pam_start(3PAM), libpam(3LIB), attributes(5)
86
88 The interfaces in libpam are MT-Safe only if each thread within the
89 multithreaded application uses its own PAM handle.
90
91
92
93SunOS 5.11 10 Jan 2008 pam_setcred(3PAM)