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

NAME

6       pam_set_data,  pam_get_data  - PAM routines to maintain module specific
7       state
8

SYNOPSIS

10       cc [ flag ... ] file ... -lpam [ library ... ]
11       #include <security/pam_appl.h>
12
13
14
15       int pam_set_data(pam_handle_t *pamh,
16            const char *module_data_name, void *data,
17            void  (*cleanup) (pam_handle_t *pamh, void *data,
18            int pam_end_status));
19
20
21       int pam_get_data(const pam_handle_t *pamh,
22            const char *module_data_name, const void **data);
23
24

DESCRIPTION

26       The pam_set_data() and pam_get_data() functions allow PAM service  mod‐
27       ules  to access and update module specific information as needed. These
28       functions should not be used by applications.
29
30
31       The pam_set_data() function stores module specific data within the  PAM
32       handle  pamh.  The  module_data_name  argument  uniquely identifies the
33       data, and the data  argument  represents  the  actual  data.  The  mod‐
34       ule_data_name argument should be unique across all services.
35
36
37       The  cleanup  function frees up any memory used by the data after it is
38       no longer needed, and is invoked by  pam_end().  The  cleanup  function
39       takes as its arguments a pointer to the  PAM handle, pamh, a pointer to
40       the actual data, data, and a status code,  pam_end_status.  The  status
41       code determines exactly what state information needs to be  purged.
42
43
44       If  pam_set_data()  is  called  and  module data already exists  from a
45       prior call to  pam_set_data() under the same module_data_name, then the
46       existing  data  is  replaced  by the new data, and the existing cleanup
47       function is replaced by the new cleanup function.
48
49
50       The pam_get_data() function retrieves module-specific  data  stored  in
51       the  PAM handle, pamh, identified by the unique name, module_data_name.
52       The data argument is assigned the address of the  requested  data.  The
53       data  retrieved by pam_get_data() should not be modified or freed.  The
54       data will be released by pam_end().
55

RETURN VALUES

57       In addition to the return values listed  in  pam(3PAM),  the  following
58       value may also be returned:
59
60       PAM_NO_MODULE_DATA    No module specific data is present.
61
62

ATTRIBUTES

64       See attributes(5) for description of the following attributes:
65
66
67
68
69       ┌─────────────────────────────┬─────────────────────────────┐
70       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
71       ├─────────────────────────────┼─────────────────────────────┤
72       │Interface Stability          │ Stable                      │
73       ├─────────────────────────────┼─────────────────────────────┤
74       │MT-Level                     │MT-Safe with exceptions      │
75       └─────────────────────────────┴─────────────────────────────┘
76

SEE ALSO

78       pam(3PAM), pam_end(3PAM), libpam(3LIB), attributes(5)
79

NOTES

81       The  interfaces  in   libpam are MT-Safe only if each thread within the
82       multithreaded application uses its own  PAM handle.
83
84
85
86SunOS 5.11                        13 Oct 1998               pam_set_data(3PAM)
Impressum