1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use libc::{c_char, c_int, c_void};
use types::*;
use raw::*;
#[inline]
pub unsafe fn start(service: *const c_char, user: *const c_char,
conversation: *const PamConversation, handle: *mut *mut PamHandle) -> PamReturnCode {
PamReturnCode::from_i32(pam_start(service, user, conversation, handle as *mut *const PamHandle))
}
#[inline]
pub unsafe fn end(handle: *mut PamHandle, status: c_int) -> PamReturnCode {
PamReturnCode::from_i32(pam_end(handle, status))
}
#[inline]
pub unsafe fn authenticate(handle: *mut PamHandle, flags: PamFlag) -> PamReturnCode {
PamReturnCode::from_i32(pam_authenticate(handle, flags as i32))
}
#[inline]
pub unsafe fn acct_mgmt(handle: *mut PamHandle, flags: PamFlag) -> PamReturnCode {
PamReturnCode::from_i32(pam_acct_mgmt(handle, flags as i32))
}
#[inline]
pub unsafe fn setcred(handle: *mut PamHandle, flags: PamFlag) -> PamReturnCode {
PamReturnCode::from_i32(pam_setcred(handle, flags as i32))
}
#[inline]
pub unsafe fn open_session(handle: *mut PamHandle, flags: PamFlag) -> PamReturnCode {
PamReturnCode::from_i32(pam_open_session(handle, flags as i32))
}
#[inline]
pub unsafe fn close_session(handle: *mut PamHandle, flags: PamFlag) -> PamReturnCode {
PamReturnCode::from_i32(pam_close_session(handle, flags as i32))
}
#[inline]
pub unsafe fn set_item(handle: *mut PamHandle, item_type: PamItemType, item: *const c_void) -> PamReturnCode {
PamReturnCode::from_i32(pam_set_item(handle, item_type as i32, item))
}
#[inline]
pub unsafe fn get_item(handle: *const PamHandle, item_type: PamItemType, item: *const *const c_void) -> PamReturnCode {
PamReturnCode::from_i32(pam_get_item(handle, item_type as i32, item))
}
#[inline]
pub unsafe fn putenv(handle: *mut PamHandle, name_value: *const c_char) -> PamReturnCode {
PamReturnCode::from_i32(pam_putenv(handle, name_value))
}
#[inline]
pub unsafe fn getenv(handle: *mut PamHandle, name: *const c_char) -> *const c_char {
pam_getenv(handle, name)
}