1pam_sm_setcred(3PAM)         PAM Library Functions        pam_sm_setcred(3PAM)
2
3
4

NAME

6       pam_sm_setcred - service provider implementation for pam_setcred
7

SYNOPSIS

9       cc [ flag ... ] file ... -lpam [ library ... ]
10       #include <security/pam_appl.h>
11       #include <security/pam_modules.h>
12
13
14
15       int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc,
16            const char **argv);
17
18

DESCRIPTION

20       In  response  to  a call to pam_setcred(3PAM), the  PAM framework calls
21       pam_sm_setcred() from the modules listed in the pam.conf(4) file.   The
22       authentication  provider  supplies  the back-end functionality for this
23       interface function.
24
25
26       The pam_sm_setcred() function is called to set the credentials  of  the
27       current  user associated with the authentication handle, pamh. The fol‐
28       lowing flags may be set in the flags field.  Note that the  first  four
29       flags are mutually exclusive:
30
31       PAM_ESTABLISH_CRED       Set  user  credentials  for the authentication
32                                service.
33
34
35       PAM_DELETE_CRED          Delete user credentials  associated  with  the
36                                authentication service.
37
38
39       PAM_REINITIALIZE_CRED    Reinitialize user credentials.
40
41
42       PAM_REFRESH_CRED         Extend lifetime of user credentials.
43
44
45       PAM_SILENT               Authentication  service  should  not  generate
46                                messages
47
48
49
50       If no flag is set,  PAM_ESTABLISH _CRED is used as the default.
51
52
53       The argc argument represents the number of  module  options  passed  in
54       from  the  configuration  file  pam.conf(4).  argv specifies the module
55       options, which are interpreted and processed by the authentication ser‐
56       vice.   If  an unknown option is passed to the  module, an error should
57       be logged and the option ignored.
58
59
60       If the  PAM_SILENT flag is not set, then pam_sm_setcred() should  print
61       any  failure status from the corresponding  pam_sm_authenticate() func‐
62       tion using the conversation function.
63
64
65       The authentication status (success or reason for failure) is  saved  as
66       module-specific  state  in the authentication handle by the authentica‐
67       tion module. The status should be retrieved using  pam_get_data(),  and
68       used to determine if user credentials should be set.
69

RETURN VALUES

71       Upon  successful  completion,  PAM_SUCCESS should be returned. The fol‐
72       lowing values may also be returned upon error:
73
74       PAM_CRED_UNAVAIL    Underlying authentication service can not  retrieve
75                           user credentials.
76
77
78       PAM_CRED_EXPIRED    User credentials have expired.
79
80
81       PAM_USER_UNKNOWN    User unknown to the authentication service.
82
83
84       PAM_CRED_ERR        Failure in setting user credentials.
85
86
87       PAM_IGNORE          Ignore  underlying authentication module regardless
88                           of whether the control flag  is  required,optional,
89                           or  sufficient.
90
91

ATTRIBUTES

93       See attributes(5) for description of the following attributes:
94
95
96
97
98       ┌─────────────────────────────┬─────────────────────────────┐
99       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
100       ├─────────────────────────────┼─────────────────────────────┤
101       │Interface Stability          │ Stable                      │
102       ├─────────────────────────────┼─────────────────────────────┤
103       │MT-Level                     │MT-Safe with exceptions      │
104       └─────────────────────────────┴─────────────────────────────┘
105

SEE ALSO

107       pam(3PAM),    pam_authenticate(3PAM),    pam_get_data(3PAM)    pam_set‐
108       cred(3PAM),   pam_sm_authenticate(3PAM),   libpam(3LIB),   pam.conf(4),
109       attributes(5)
110

NOTES

112       The  pam_sm_setcred()  function  is passed the same module options that
113       are used by pam_sm_authenticate().
114
115
116       The interfaces in  libpam are MT-Safe only if each  thread  within  the
117       multithreaded application uses its own  PAM handle.
118
119
120       If  the  PAM_REPOSITORY  item_type is set and a service module does not
121       recognize the type, the service module does not  process  any  informa‐
122       tion,  and  returns  PAM_IGNORE. If the PAM_REPOSITORY item_type is not
123       set, a service module performs its default action.
124
125
126
127SunOS 5.11                        18 Nov 2003             pam_sm_setcred(3PAM)
Impressum