Skip to content

Commit

Permalink
Remove the sssd build dependencies
Browse files Browse the repository at this point in the history
I had already extracted the sssd idmap code for
Samba. Merge that back into Himmelblau to remove
all the SSSD build dependencies.

Signed-off-by: David Mulder <dmulder@samba.org>
  • Loading branch information
dmulder committed Oct 8, 2024
1 parent a90c022 commit ff18883
Show file tree
Hide file tree
Showing 19 changed files with 3,945 additions and 161 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ jobs:
tpm-udev \
libtss2-dev \
libcap-dev \
libtalloc-dev \
libtevent-dev \
libldb-dev \
libdhash-dev \
libkrb5-dev \
libpcre2-dev \
libclang-13-dev \
autoconf \
gettext \
libdbus-1-dev
libdbus-1-dev \
libutf8proc-dev
- name: "Fetch submodules"
run: git submodule init && git submodule update
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ jobs:
tpm-udev \
libtss2-dev \
libcap-dev \
libtalloc-dev \
libtevent-dev \
libldb-dev \
libdhash-dev \
libkrb5-dev \
libpcre2-dev \
libclang-13-dev \
autoconf \
gettext \
libdbus-1-dev
libdbus-1-dev \
libutf8proc-dev
- name: "Fetch submodules"
run: git submodule init && git submodule update
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

8 changes: 4 additions & 4 deletions src/common/src/idprovider/himmelblau.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use himmelblau::auth::{
use himmelblau::discovery::EnrollAttrs;
use himmelblau::error::{ErrorResponse, MsalError, AUTH_PENDING, DEVICE_AUTH_FAIL, REQUIRES_MFA};
use himmelblau::graph::{DirectoryObject, Graph};
use idmap::SssIdmap;
use idmap::Idmap;
use kanidm_hsm_crypto::{LoadableIdentityKey, LoadableMsOapxbcRsaKey, PinValue, SealedData, Tpm};
use reqwest;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -85,7 +85,7 @@ impl HimmelblauMultiProvider {
Ok(config) => Arc::new(RwLock::new(config)),
Err(e) => return Err(anyhow!("{}", e)),
};
let idmap = match SssIdmap::new() {
let idmap = match Idmap::new() {
Ok(idmap) => Arc::new(RwLock::new(idmap)),
Err(e) => return Err(anyhow!("{:?}", e)),
};
Expand Down Expand Up @@ -390,7 +390,7 @@ pub struct HimmelblauProvider {
authority_host: String,
graph: Graph,
refresh_cache: RefreshCache,
idmap: Arc<RwLock<SssIdmap>>,
idmap: Arc<RwLock<Idmap>>,
}

impl HimmelblauProvider {
Expand All @@ -401,7 +401,7 @@ impl HimmelblauProvider {
domain: &str,
authority_host: &str,
graph: Graph,
idmap: &Arc<RwLock<SssIdmap>>,
idmap: &Arc<RwLock<Idmap>>,
) -> Result<Self, IdpError> {
Ok(HimmelblauProvider {
client: RwLock::new(client),
Expand Down
10 changes: 0 additions & 10 deletions src/idmap/.gitignore

This file was deleted.

6 changes: 3 additions & 3 deletions src/idmap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ name = "idmap"
path = "src/lib.rs"

[dependencies]
libc = "0.2.153"
tracing = { workspace = true }
uuid = { workspace = true }
libc.workspace = true
tracing.workspace = true
uuid.workspace = true

[build-dependencies]
cc = "1.0.97"
Expand Down
3 changes: 0 additions & 3 deletions src/idmap/autogen.sh

This file was deleted.

36 changes: 6 additions & 30 deletions src/idmap/build.rs
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
use std::env;
use std::io::{self, Write};
use std::path::Path;
use std::path::PathBuf;
use std::process::Command;

fn main() {
let autoreconf = Command::new("./autogen.sh")
.output()
.expect("Failed to configure sss_idmap");
if !autoreconf.status.success() {
io::stdout().write_all(&autoreconf.stdout).unwrap();
io::stderr().write_all(&autoreconf.stderr).unwrap();
panic!("Failed to configure sss_idmap");
}
io::stdout().write_all(&autoreconf.stdout).unwrap();
let configure = Command::new("./configure")
.output()
.expect("Failed to configure sss_idmap");
if !configure.status.success() {
io::stdout().write_all(&configure.stdout).unwrap();
io::stderr().write_all(&configure.stderr).unwrap();
panic!("Failed to configure sss_idmap");
}
io::stdout().write_all(&configure.stdout).unwrap();

cc::Build::new()
.file("sssd/src/lib/idmap/sss_idmap.c")
.file("sssd/src/lib/idmap/sss_idmap_conv.c")
.file("sssd/src/util/murmurhash3.c")
.include(Path::new("/usr/include/samba-4.0"))
.include(Path::new("sssd/src"))
.include(Path::new("./")) // for config.h
.file("src/sss_idmap.c")
.file("src/sss_idmap_conv.c")
.file("src/murmurhash3.c")
.warnings(false)
.compile("sss_idmap");

Expand All @@ -42,8 +17,7 @@ fn main() {
.blocklist_function("qecvt")
.blocklist_function("qecvt_r")
.blocklist_function("strtold")
.clang_arg("-I/usr/include/samba-4.0")
.header("wrapper.h")
.header("src/sss_idmap.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.generate()
.expect("Unable to generate bindings");
Expand All @@ -52,4 +26,6 @@ fn main() {
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
println!("cargo:rustc-link-lib=utf8proc");
println!("cargo:rustc-env=LD_LIBRARY_PATH=../../bin/shared/private/");
}
17 changes: 0 additions & 17 deletions src/idmap/configure.ac

This file was deleted.

Loading

0 comments on commit ff18883

Please sign in to comment.