mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +01:00
Resolve pam services not always having a tty (#3176)
This commit is contained in:
parent
770efa80f0
commit
78ced241eb
|
@ -106,7 +106,8 @@ pub enum PamAuthRequest {
|
|||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct PamServiceInfo {
|
||||
pub service: String,
|
||||
pub tty: String,
|
||||
// Somehow SDDM doesn't set this ...
|
||||
pub tty: Option<String>,
|
||||
// Only set if it really is a remote host?
|
||||
pub rhost: Option<String>,
|
||||
}
|
||||
|
@ -147,7 +148,7 @@ impl ClientRequest {
|
|||
"PamAuthenticateInit{{ account_id={} tty={} pam_secvice{} rhost={} }}",
|
||||
account_id,
|
||||
info.service,
|
||||
info.tty,
|
||||
info.tty.as_deref().unwrap_or(""),
|
||||
info.rhost.as_deref().unwrap_or("")
|
||||
),
|
||||
ClientRequest::PamAuthenticateStep(_) => "PamAuthenticateStep".to_string(),
|
||||
|
|
|
@ -256,7 +256,7 @@ impl PamHandle {
|
|||
tracing::debug!(?maybe_tty, ?maybe_rhost, ?maybe_service);
|
||||
|
||||
match (maybe_tty, maybe_rhost, maybe_service) {
|
||||
(Some(tty), rhost, Some(service)) => Ok(PamServiceInfo {
|
||||
(tty, rhost, Some(service)) => Ok(PamServiceInfo {
|
||||
service,
|
||||
tty,
|
||||
rhost,
|
||||
|
|
|
@ -67,7 +67,7 @@ async fn main() -> ExitCode {
|
|||
account_id: account_id.clone(),
|
||||
info: PamServiceInfo {
|
||||
service: "kanidm-unix".to_string(),
|
||||
tty: "/dev/null".to_string(),
|
||||
tty: None,
|
||||
rhost: None,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1086,7 +1086,7 @@ impl Resolver {
|
|||
|
||||
let pam_info = PamServiceInfo {
|
||||
service: "kanidm-unix-test".to_string(),
|
||||
tty: "/dev/null".to_string(),
|
||||
tty: Some("/dev/null".to_string()),
|
||||
rhost: None,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue