Unverified Commit 9e538263 authored by Masum Reza's avatar Masum Reza Committed by GitHub
Browse files

sssd: fix tests issues (#446589)

parents 5d4e8136 979a95c4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ in
        description = "Contents of {file}`sssd.conf`.";
        default = ''
          [sssd]
          config_file_version = 2
          services = nss, pam
          domains = shadowutils

+12 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  stdenv,
  fetchFromGitHub,
  replaceVars,
  autoreconfHook,
  makeWrapper,
  glibc,
@@ -72,8 +73,18 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-JN4GVx5rBfNBLaMpLcKgyd+CyNDafz85BXUcfg5kDXQ=";
  };

  patches = [
    (replaceVars ./fix-ldb-modules-path.patch {
      inherit ldb;
      out = null; # will be replaced in postPatch https://github.com/NixOS/nixpkgs/pull/446589#discussion_r2384899857
    })
  ];

  postPatch = ''
    patchShebangs ./sbus_generate.sh.in

    substituteInPlace src/confdb/confdb.c \
      --replace-fail "@out@" "${placeholder "out"}"
  '';

  # Something is looking for <libxml/foo.h> instead of <libxml2/libxml/foo.h>
@@ -101,6 +112,7 @@ stdenv.mkDerivation (finalAttrs: {
      --with-xml-catalog-path=''${SGML_CATALOG_FILES%%:*}
      --with-ldb-lib-dir=$out/modules/ldb
      --with-nscd=${glibc.bin}/sbin/nscd
      --with-sssd-user=root
    )
  ''
  + lib.optionalString withSudo ''
+13 −0
Original line number Diff line number Diff line
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index 8c19142..7865684 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -775,6 +775,8 @@ int confdb_init(TALLOC_CTX *mem_ctx,
     int ret = EOK;
     mode_t old_umask;
 
+    setenv("LDB_MODULES_PATH", "@out@/modules/ldb:@ldb@/modules/ldb", 1);
+
     if (cdb_ctx == NULL) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Bad argument\n");
         return EFAULT;