Mercurial > crates > nonstick
annotate src/constants.rs @ 132:0b6a17f8c894
Get constant test working again with OpenPAM.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Wed, 02 Jul 2025 02:34:29 -0400 |
parents | a632a8874131 |
children | efbc235f01d3 |
rev | line source |
---|---|
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
1 //! Constants and enum values from the PAM library. |
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
2 |
87
05291b601f0a
Well and truly separate the Linux extensions.
Paul Fisher <paul@pfish.zone>
parents:
86
diff
changeset
|
3 // We have a lot of dumb casts that we just gotta do because of differences |
05291b601f0a
Well and truly separate the Linux extensions.
Paul Fisher <paul@pfish.zone>
parents:
86
diff
changeset
|
4 // between Linux-PAM and OpenPAM header files. |
05291b601f0a
Well and truly separate the Linux extensions.
Paul Fisher <paul@pfish.zone>
parents:
86
diff
changeset
|
5 #![allow(clippy::unnecessary_cast)] |
05291b601f0a
Well and truly separate the Linux extensions.
Paul Fisher <paul@pfish.zone>
parents:
86
diff
changeset
|
6 |
116
a12706e42c9d
Logging, macros, and building:
Paul Fisher <paul@pfish.zone>
parents:
113
diff
changeset
|
7 use crate::{linklist, man7, manbsd, xsso}; |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
8 use bitflags::bitflags; |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
9 use num_enum::{IntoPrimitive, TryFromPrimitive}; |
90
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
10 use std::error::Error; |
131
a632a8874131
Get all the Linux-PAM functions into libpam-sys, and get tests right.
Paul Fisher <paul@pfish.zone>
parents:
130
diff
changeset
|
11 use std::ffi::c_int; |
a632a8874131
Get all the Linux-PAM functions into libpam-sys, and get tests right.
Paul Fisher <paul@pfish.zone>
parents:
130
diff
changeset
|
12 use std::fmt; |
90
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
13 use std::fmt::{Display, Formatter}; |
71
58f9d2a4df38
Reorganize everything again???
Paul Fisher <paul@pfish.zone>
parents:
70
diff
changeset
|
14 use std::result::Result as StdResult; |
15
27730595f1ea
Adding pam-http module
Anthony Nowell <anthony@algorithmia.com>
parents:
diff
changeset
|
15 |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
16 /// Values for constants not provided by certain PAM implementations. |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
17 /// |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
18 /// **The values of these constants are deliberately selected _not_ to match |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
19 /// any PAM implementations. Applications should always use the symbolic value |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
20 /// and not a magic number.** |
85 | 21 mod pam_ffi { |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
22 pub use libpam_sys::*; |
92
5ddbcada30f2
Add the ability to log against a PAM handle.
Paul Fisher <paul@pfish.zone>
parents:
90
diff
changeset
|
23 |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
24 macro_rules! define { |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
25 ($(#[$attr:meta])* $($name:ident = $value:expr;)+) => { |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
26 define!( |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
27 @meta { $(#[$attr])* } |
113
178310336596
Fix up more constants, make things i32 rather than u32.
Paul Fisher <paul@pfish.zone>
parents:
108
diff
changeset
|
28 $(pub const $name: i32 = $value;)+ |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
29 ); |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
30 }; |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
31 (@meta $m:tt $($i:item)+) => { define!(@expand $($m $i)+); }; |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
32 (@expand $({ $(#[$m:meta])* } $i:item)+) => {$($(#[$m])* $i)+}; |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
33 } |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
34 |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
35 define!( |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
36 /// A fictitious constant for testing purposes. |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
37 #[cfg(not(feature = "link"))] |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
38 #[cfg_pam_impl(not("OpenPam"))] |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
39 PAM_BAD_CONSTANT = 513; |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
40 PAM_BAD_FEATURE = 514; |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
41 ); |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
42 |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
43 define!( |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
44 /// A fictitious constant for testing purposes. |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
45 #[cfg(not(feature = "link"))] |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
46 #[cfg_pam_impl(not(any("LinuxPam", "OpenPam")))] |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
47 PAM_BAD_ITEM = 515; |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
48 PAM_MODULE_UNKNOWN = 516; |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
49 ); |
90
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
50 |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
51 define!( |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
52 /// A fictitious constant for testing purposes. |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
53 #[cfg(not(feature = "link"))] |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
54 #[cfg_pam_impl(not("LinuxPam"))] |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
55 PAM_CONV_AGAIN = 517; |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
56 PAM_INCOMPLETE = 518; |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
57 ); |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
58 } |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
59 |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
60 bitflags! { |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
61 /// The available PAM flags. |
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
62 /// |
64
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
63 /// See `/usr/include/security/_pam_types.h` and |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
64 /// See `/usr/include/security/pam_modules.h` for more details. |
97
efe2f5f8b5b2
Implement "stateless" application-side PAM calls.
Paul Fisher <paul@pfish.zone>
parents:
92
diff
changeset
|
65 #[derive(Debug, Default, PartialEq)] |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
66 #[repr(transparent)] |
113
178310336596
Fix up more constants, make things i32 rather than u32.
Paul Fisher <paul@pfish.zone>
parents:
108
diff
changeset
|
67 pub struct Flags: c_int { |
64
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
68 /// The module should not generate any messages. |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
69 const SILENT = libpam_sys::PAM_SILENT; |
64
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
70 |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
71 /// The module should return [ErrorCode::AuthError] |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
72 /// if the user has an empty authentication token |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
73 /// rather than immediately accepting them. |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
74 const DISALLOW_NULL_AUTHTOK = libpam_sys::PAM_DISALLOW_NULL_AUTHTOK; |
64
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
75 |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
76 // Flag used for `set_credentials`. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
77 |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
78 /// Set user credentials for an authentication service. |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
79 const ESTABLISH_CREDENTIALS = libpam_sys::PAM_ESTABLISH_CRED; |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
80 /// Delete user credentials associated with |
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
81 /// an authentication service. |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
82 const DELETE_CREDENTIALS = libpam_sys::PAM_DELETE_CRED; |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
83 /// Reinitialize user credentials. |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
84 const REINITIALIZE_CREDENTIALS = libpam_sys::PAM_REINITIALIZE_CRED; |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
85 /// Extend the lifetime of user credentials. |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
86 const REFRESH_CREDENTIALS = libpam_sys::PAM_REFRESH_CRED; |
64
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
87 |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
88 // Flags used for password changing. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
89 |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
90 /// The password service should only update those passwords |
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
91 /// that have aged. If this flag is _not_ passed, |
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
92 /// the password service should update all passwords. |
64
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
93 /// |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
94 /// This flag is only used by `change_authtok`. |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
95 const CHANGE_EXPIRED_AUTHTOK = libpam_sys::PAM_CHANGE_EXPIRED_AUTHTOK; |
64
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
96 /// This is a preliminary check for password changing. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
97 /// The password should not be changed. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
98 /// |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
99 /// This is only used between PAM and a module. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
100 /// Applications may not use this flag. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
101 /// |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
102 /// This flag is only used by `change_authtok`. |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
103 const PRELIMINARY_CHECK = libpam_sys::PAM_PRELIM_CHECK; |
64
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
104 /// The password should actuallyPR be updated. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
105 /// This and [Self::PRELIMINARY_CHECK] are mutually exclusive. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
106 /// |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
107 /// This is only used between PAM and a module. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
108 /// Applications may not use this flag. |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
109 /// |
bbe84835d6db
More organization; add lots of docs.
Paul Fisher <paul@pfish.zone>
parents:
63
diff
changeset
|
110 /// This flag is only used by `change_authtok`. |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
111 const UPDATE_AUTHTOK = libpam_sys::PAM_UPDATE_AUTHTOK; |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
112 } |
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
113 } |
15
27730595f1ea
Adding pam-http module
Anthony Nowell <anthony@algorithmia.com>
parents:
diff
changeset
|
114 |
103
dfcd96a74ac4
write a truly prodigious amount of documentation
Paul Fisher <paul@pfish.zone>
parents:
97
diff
changeset
|
115 /// The PAM error return codes. |
dfcd96a74ac4
write a truly prodigious amount of documentation
Paul Fisher <paul@pfish.zone>
parents:
97
diff
changeset
|
116 /// |
dfcd96a74ac4
write a truly prodigious amount of documentation
Paul Fisher <paul@pfish.zone>
parents:
97
diff
changeset
|
117 /// These are returned by most PAM functions if an error of some kind occurs. |
dfcd96a74ac4
write a truly prodigious amount of documentation
Paul Fisher <paul@pfish.zone>
parents:
97
diff
changeset
|
118 /// |
dfcd96a74ac4
write a truly prodigious amount of documentation
Paul Fisher <paul@pfish.zone>
parents:
97
diff
changeset
|
119 /// Instead of being an error code, success is represented by an Ok [`Result`]. |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
120 /// |
103
dfcd96a74ac4
write a truly prodigious amount of documentation
Paul Fisher <paul@pfish.zone>
parents:
97
diff
changeset
|
121 /// # References |
dfcd96a74ac4
write a truly prodigious amount of documentation
Paul Fisher <paul@pfish.zone>
parents:
97
diff
changeset
|
122 /// |
116
a12706e42c9d
Logging, macros, and building:
Paul Fisher <paul@pfish.zone>
parents:
113
diff
changeset
|
123 #[doc = linklist!(pam: man7, manbsd)] |
103
dfcd96a74ac4
write a truly prodigious amount of documentation
Paul Fisher <paul@pfish.zone>
parents:
97
diff
changeset
|
124 /// - [X/SSO error code specification][xsso] |
dfcd96a74ac4
write a truly prodigious amount of documentation
Paul Fisher <paul@pfish.zone>
parents:
97
diff
changeset
|
125 /// |
116
a12706e42c9d
Logging, macros, and building:
Paul Fisher <paul@pfish.zone>
parents:
113
diff
changeset
|
126 #[doc = man7!(3 pam "RETURN_VALUES")] |
a12706e42c9d
Logging, macros, and building:
Paul Fisher <paul@pfish.zone>
parents:
113
diff
changeset
|
127 #[doc = manbsd!(3 pam "RETURN%20VALUES")] |
a12706e42c9d
Logging, macros, and building:
Paul Fisher <paul@pfish.zone>
parents:
113
diff
changeset
|
128 #[doc = xsso!("chap5.htm#tagcjh_06_02")] |
15
27730595f1ea
Adding pam-http module
Anthony Nowell <anthony@algorithmia.com>
parents:
diff
changeset
|
129 #[allow(non_camel_case_types, dead_code)] |
90
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
130 #[derive(Copy, Clone, Debug, PartialEq, TryFromPrimitive, IntoPrimitive)] |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
131 #[non_exhaustive] // C might give us anything! |
113
178310336596
Fix up more constants, make things i32 rather than u32.
Paul Fisher <paul@pfish.zone>
parents:
108
diff
changeset
|
132 #[repr(i32)] |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
133 pub enum ErrorCode { |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
134 OpenError = pam_ffi::PAM_OPEN_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
135 SymbolError = pam_ffi::PAM_SYMBOL_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
136 ServiceError = pam_ffi::PAM_SERVICE_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
137 SystemError = pam_ffi::PAM_SYSTEM_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
138 BufferError = pam_ffi::PAM_BUF_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
139 PermissionDenied = pam_ffi::PAM_PERM_DENIED, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
140 AuthenticationError = pam_ffi::PAM_AUTH_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
141 CredentialsInsufficient = pam_ffi::PAM_CRED_INSUFFICIENT, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
142 AuthInfoUnavailable = pam_ffi::PAM_AUTHINFO_UNAVAIL, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
143 UserUnknown = pam_ffi::PAM_USER_UNKNOWN, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
144 MaxTries = pam_ffi::PAM_MAXTRIES, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
145 NewAuthTokRequired = pam_ffi::PAM_NEW_AUTHTOK_REQD, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
146 AccountExpired = pam_ffi::PAM_ACCT_EXPIRED, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
147 SessionError = pam_ffi::PAM_SESSION_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
148 CredentialsUnavailable = pam_ffi::PAM_CRED_UNAVAIL, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
149 CredentialsExpired = pam_ffi::PAM_CRED_EXPIRED, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
150 CredentialsError = pam_ffi::PAM_CRED_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
151 NoModuleData = pam_ffi::PAM_NO_MODULE_DATA, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
152 ConversationError = pam_ffi::PAM_CONV_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
153 AuthTokError = pam_ffi::PAM_AUTHTOK_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
154 AuthTokRecoveryError = pam_ffi::PAM_AUTHTOK_RECOVERY_ERR, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
155 AuthTokLockBusy = pam_ffi::PAM_AUTHTOK_LOCK_BUSY, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
156 AuthTokDisableAging = pam_ffi::PAM_AUTHTOK_DISABLE_AGING, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
157 TryAgain = pam_ffi::PAM_TRY_AGAIN, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
158 Ignore = pam_ffi::PAM_IGNORE, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
159 Abort = pam_ffi::PAM_ABORT, |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
160 AuthTokExpired = pam_ffi::PAM_AUTHTOK_EXPIRED, |
108
e97534be35e3
Make some proc macros for doing cfg-like stuff for PAM impls.
Paul Fisher <paul@pfish.zone>
parents:
103
diff
changeset
|
161 #[cfg(feature = "basic-ext")] |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
162 ModuleUnknown = pam_ffi::PAM_MODULE_UNKNOWN, |
108
e97534be35e3
Make some proc macros for doing cfg-like stuff for PAM impls.
Paul Fisher <paul@pfish.zone>
parents:
103
diff
changeset
|
163 #[cfg(feature = "basic-ext")] |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
164 BadItem = pam_ffi::PAM_BAD_ITEM, |
108
e97534be35e3
Make some proc macros for doing cfg-like stuff for PAM impls.
Paul Fisher <paul@pfish.zone>
parents:
103
diff
changeset
|
165 #[cfg(feature = "linux-pam-ext")] |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
166 ConversationAgain = pam_ffi::PAM_CONV_AGAIN, |
108
e97534be35e3
Make some proc macros for doing cfg-like stuff for PAM impls.
Paul Fisher <paul@pfish.zone>
parents:
103
diff
changeset
|
167 #[cfg(feature = "linux-pam-ext")] |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
168 Incomplete = pam_ffi::PAM_INCOMPLETE, |
15
27730595f1ea
Adding pam-http module
Anthony Nowell <anthony@algorithmia.com>
parents:
diff
changeset
|
169 } |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
170 |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
171 /// A PAM-specific Result type with an [ErrorCode] error. |
71
58f9d2a4df38
Reorganize everything again???
Paul Fisher <paul@pfish.zone>
parents:
70
diff
changeset
|
172 pub type Result<T> = StdResult<T, ErrorCode>; |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
173 |
90
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
174 impl Display for ErrorCode { |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
175 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
176 match strerror((*self).into()) { |
90
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
177 Some(err) => f.write_str(err), |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
178 None => self.fmt_internal(f), |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
179 } |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
180 } |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
181 } |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
182 |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
183 impl Error for ErrorCode {} |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
184 |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
185 impl ErrorCode { |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
186 /// Converts this [Result] into a C-compatible result code. |
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
187 pub fn result_to_c<T>(value: Result<T>) -> c_int { |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
188 match value { |
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
189 Ok(_) => 0, // PAM_SUCCESS |
113
178310336596
Fix up more constants, make things i32 rather than u32.
Paul Fisher <paul@pfish.zone>
parents:
108
diff
changeset
|
190 Err(otherwise) => otherwise.into(), |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
191 } |
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
192 } |
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
193 |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
194 /// Converts a C result code into a [Result], with success as Ok. |
59
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
195 /// Invalid values are returned as a [Self::SystemError]. |
60
05cc2c27334f
The Big Refactor: clean up docs and exports.
Paul Fisher <paul@pfish.zone>
parents:
59
diff
changeset
|
196 pub fn result_from(value: c_int) -> Result<()> { |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
197 match value { |
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
198 0 => Ok(()), |
113
178310336596
Fix up more constants, make things i32 rather than u32.
Paul Fisher <paul@pfish.zone>
parents:
108
diff
changeset
|
199 value => Err(value.try_into().unwrap_or(Self::SystemError)), |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
200 } |
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
201 } |
90
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
202 |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
203 /// A basic Display implementation for if we don't link against PAM. |
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
204 fn fmt_internal(self, f: &mut Formatter<'_>) -> fmt::Result { |
131
a632a8874131
Get all the Linux-PAM functions into libpam-sys, and get tests right.
Paul Fisher <paul@pfish.zone>
parents:
130
diff
changeset
|
205 let n: c_int = self.into(); |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
206 write!(f, "PAM error: {self:?} ({n})") |
90
f6186e41399b
Miscellaneous fixes and cleanup:
Paul Fisher <paul@pfish.zone>
parents:
87
diff
changeset
|
207 } |
56
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
208 } |
daa2cde64601
Big big refactor. Probably should have been multiple changes.
Paul Fisher <paul@pfish.zone>
parents:
55
diff
changeset
|
209 |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
210 /// Gets a string version of an error message. |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
211 #[cfg(feature = "link")] |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
212 pub fn strerror(code: c_int) -> Option<&'static str> { |
131
a632a8874131
Get all the Linux-PAM functions into libpam-sys, and get tests right.
Paul Fisher <paul@pfish.zone>
parents:
130
diff
changeset
|
213 use std::ffi::CStr; |
130
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
214 use std::ptr; |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
215 // SAFETY: PAM impls don't care about the PAM handle and always return |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
216 // static strings. |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
217 let strerror = unsafe { libpam_sys::pam_strerror(ptr::null(), code as c_int) }; |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
218 // SAFETY: We just got this back from PAM and we checked if it's null. |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
219 (!strerror.is_null()) |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
220 .then(|| unsafe { CStr::from_ptr(strerror) }.to_str().ok()) |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
221 .flatten() |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
222 } |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
223 |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
224 /// Dummy implementation of strerror so that it always returns None. |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
225 #[cfg(not(feature = "link"))] |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
226 pub fn strerror(_: c_int) -> Option<&'static str> { |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
227 None |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
228 } |
80c07e5ab22f
Transfer over (almost) completely to using libpam-sys.
Paul Fisher <paul@pfish.zone>
parents:
116
diff
changeset
|
229 |
59
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
230 #[cfg(test)] |
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
231 mod tests { |
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
232 use super::*; |
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
233 |
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
234 #[test] |
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
235 fn test_enums() { |
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
236 assert_eq!(Ok(()), ErrorCode::result_from(0)); |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
237 assert_eq!( |
108
e97534be35e3
Make some proc macros for doing cfg-like stuff for PAM impls.
Paul Fisher <paul@pfish.zone>
parents:
103
diff
changeset
|
238 pam_ffi::PAM_SESSION_ERR as i32, |
e97534be35e3
Make some proc macros for doing cfg-like stuff for PAM impls.
Paul Fisher <paul@pfish.zone>
parents:
103
diff
changeset
|
239 ErrorCode::result_to_c::<()>(Err(ErrorCode::SessionError)) |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
240 ); |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
241 assert_eq!( |
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
242 Err(ErrorCode::Abort), |
84
a638a45e5f1f
do some real irritating i32/u32 juggling to make bindgen happy
Paul Fisher <paul@pfish.zone>
parents:
80
diff
changeset
|
243 ErrorCode::result_from(pam_ffi::PAM_ABORT as i32) |
80
5aa1a010f1e8
Start using PAM headers; improve owned/borrowed distinction.
Paul Fisher <paul@pfish.zone>
parents:
77
diff
changeset
|
244 ); |
59
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
245 assert_eq!(Err(ErrorCode::SystemError), ErrorCode::result_from(423)); |
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
246 } |
3f4a77aa88be
Fix string copyting and improve error situation.
Paul Fisher <paul@pfish.zone>
parents:
56
diff
changeset
|
247 } |