about summary refs log tree commit diff
path: root/pkgs/development/libraries/openldap
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-04-28 23:06:31 +0200
committerFlorian Klink <flokli@flokli.de>2021-04-28 23:22:05 +0200
commit3466530d666b699171f78e437576d0903be5431b (patch)
treebb82bd3d25b8cebc934c486bd731c24f7ab8d37c /pkgs/development/libraries/openldap
parent6b14de16225eadc9042a3778f139f8239126fcdf (diff)
openldap: Enable argon2 hash support by default
argon2 is the recommended password hashing function, and the module is
included with OpenLDAP contrib.

This change enables argon2 hashes by default in our OpenLDAP package.

The install command for argon2 needs to be install-lib, as it otherwise
tries to install manpages to /usr, which fails.
Diffstat (limited to 'pkgs/development/libraries/openldap')
-rw-r--r--pkgs/development/libraries/openldap/default.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix
index 39831a3baf084..fe4704341ef5c 100644
--- a/pkgs/development/libraries/openldap/default.nix
+++ b/pkgs/development/libraries/openldap/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, openssl, db, groff, libtool
+{ lib, stdenv, fetchurl, openssl, db, groff, libtool, libsodium
 , withCyrusSasl ? true
 , cyrus_sasl
 }:
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ groff ];
 
-  buildInputs = [ openssl cyrus_sasl db libtool ];
+  buildInputs = [ openssl cyrus_sasl db libsodium libtool ];
 
   # Disable install stripping as it breaks cross-compiling.
   # We strip binaries anyway in fixupPhase.
@@ -46,6 +46,7 @@ stdenv.mkDerivation rec {
   postBuild = ''
     make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/sha2
     make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/pbkdf2
+    make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/argon2
   '';
 
   doCheck = false; # needs a running LDAP server
@@ -54,6 +55,9 @@ stdenv.mkDerivation rec {
     "sysconfdir=$(out)/etc"
     "localstatedir=$(out)/var"
     "moduledir=$(out)/lib/modules"
+    # The argon2 module hardcodes /usr/bin/install as the path for the
+    # `install` binary, which is overridden here.
+    "INSTALL=install"
   ];
 
   # 1. Libraries left in the build location confuse `patchelf --shrink-rpath`
@@ -76,6 +80,7 @@ stdenv.mkDerivation rec {
   postInstall = ''
     make $installFlags install -C contrib/slapd-modules/passwd/sha2
     make $installFlags install -C contrib/slapd-modules/passwd/pbkdf2
+    make $installFlags install-lib -C contrib/slapd-modules/passwd/argon2
     chmod +x "$out"/lib/*.{so,dylib}
   '';