sssd: fix tests issues (#446589)

Changed files
+25 -1
nixos
modules
services
misc
pkgs
os-specific
-1
nixos/modules/services/misc/sssd.nix
···
description = "Contents of {file}`sssd.conf`.";
default = ''
[sssd]
-
config_file_version = 2
services = nss, pam
domains = shadowutils
+12
pkgs/os-specific/linux/sssd/default.nix
···
lib,
stdenv,
fetchFromGitHub,
+
replaceVars,
autoreconfHook,
makeWrapper,
glibc,
···
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>
···
--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
pkgs/os-specific/linux/sssd/fix-ldb-modules-path.patch
···
+
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;