diff --git a/rust/build.rs b/rust/build.rs index 5d1b869c9fb..fc0dfaf20eb 100644 --- a/rust/build.rs +++ b/rust/build.rs @@ -1,21 +1,6 @@ use std::env; fn main() { - // Re-export the Target OS, so that Himmelblaud has access to this at - // runtime. - if &env::var("CARGO_CFG_TARGET_OS").unwrap() != "none" { - println!( - "cargo:rustc-env=TARGET_OS={}", - &env::var("CARGO_CFG_TARGET_OS").unwrap() - ); - } else { - println!( - "cargo:rustc-env=TARGET_OS={}", - &env::var("CARGO_CFG_TARGET_FAMILY").unwrap() - ); - } - println!("cargo:rerun-if-changed-env=TARGET"); - if let Some(vers) = version::samba_version_string() { println!("cargo:rustc-env=CARGO_PKG_VERSION={}", vers); } diff --git a/rust/himmelblaud/src/himmelblaud/himmelblaud_pam_auth.rs b/rust/himmelblaud/src/himmelblaud/himmelblaud_pam_auth.rs index ab45f38b022..c1cd64f8fd6 100644 --- a/rust/himmelblaud/src/himmelblaud/himmelblaud_pam_auth.rs +++ b/rust/himmelblaud/src/himmelblaud/himmelblaud_pam_auth.rs @@ -710,16 +710,17 @@ impl Resolver { token: &UnixUserToken, ) -> Result<(), Box> { /* If not already joined, join the domain now. */ - let os = env::var("TARGET_OS").map_err(|e| { + let attrs = EnrollAttrs::new( + self.realm.clone(), + None, + Some(env::consts::OS.to_string()), + None, + None, + ) + .map_err(|e| { DBG_ERR!("{:?}", e); Box::new(NT_STATUS_LOGON_FAILURE) })?; - let attrs = - EnrollAttrs::new(self.realm.clone(), None, Some(os), None, None) - .map_err(|e| { - DBG_ERR!("{:?}", e); - Box::new(NT_STATUS_LOGON_FAILURE) - })?; let mut tpm = self.hsm.lock().await; match self .client