summary refs log tree commit diff
path: root/pkgs/development/libraries/openldap
diff options
context:
space:
mode:
authorDan Callaghan <djc@djc.id.au>2022-07-19 22:31:11 +1000
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-07-22 03:19:46 +0200
commitb30534eb02796423cec9fbda8f7aea535c932e3e (patch)
treed9da8a735e78fc2563a401e2fd3e9a21907cc174 /pkgs/development/libraries/openldap
parentdf9f22a8b836e783a0826ed629054462c94c41a1 (diff)
downloadnixpkgs-b30534eb02796423cec9fbda8f7aea535c932e3e.tar
nixpkgs-b30534eb02796423cec9fbda8f7aea535c932e3e.tar.gz
nixpkgs-b30534eb02796423cec9fbda8f7aea535c932e3e.tar.bz2
nixpkgs-b30534eb02796423cec9fbda8f7aea535c932e3e.tar.lz
nixpkgs-b30534eb02796423cec9fbda8f7aea535c932e3e.tar.xz
nixpkgs-b30534eb02796423cec9fbda8f7aea535c932e3e.tar.zst
nixpkgs-b30534eb02796423cec9fbda8f7aea535c932e3e.zip
openldap: load client config from /etc, not the nix store
We want Openldap clients to load /etc/ldap.conf at runtime, not
${pkgs.openldap}/etc/ldap.conf which is always a sample config.

Pass sysconfdir=/etc at compile time, so that /etc/krb5.conf is embedded
in the library as the path of its config file.

Pass sysconfdir=${out}/etc at install time, so that the sample configs
and schema files are correctly included in the build output.

This hack works because the Makefiles are not smart enough to notice
that the sysconfdir variable has changed across invocations -- because
nobody ever writes their Makefiles to be that smart. :-)

Fixes #181937.
Diffstat (limited to 'pkgs/development/libraries/openldap')
-rw-r--r--pkgs/development/libraries/openldap/default.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix
index 8d4820f33ff..f357b8d4b72 100644
--- a/pkgs/development/libraries/openldap/default.nix
+++ b/pkgs/development/libraries/openldap/default.nix
@@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
     "STRIP="  # Disable install stripping as it breaks cross-compiling. We strip binaries anyway in fixupPhase.
     "STRIP_OPTS="
     "prefix=${placeholder "out"}"
-    "sysconfdir=${placeholder "out"}/etc"
+    "sysconfdir=/etc"
     "systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
     # contrib modules require these
     "moduledir=${placeholder "out"}/lib/modules"
@@ -101,6 +101,7 @@ stdenv.mkDerivation rec {
 
   installFlags = [
     "prefix=${placeholder "out"}"
+    "sysconfdir=${placeholder "out"}/etc"
     "moduledir=${placeholder "out"}/lib/modules"
     "INSTALL=install"
   ];