1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

Fetch the target join os via std::env::consts

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
David Mulder 2024-08-23 15:27:51 -06:00
parent 0bcc209d94
commit d100aaf4bf
2 changed files with 8 additions and 22 deletions

View File

@ -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);
}

View File

@ -710,16 +710,17 @@ impl Resolver {
token: &UnixUserToken,
) -> Result<(), Box<NTSTATUS>> {
/* 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