summary refs log tree commit diff
path: root/pkgs/os-specific/linux/pam
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-12-30 16:25:16 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2019-12-30 16:25:16 -0500
commitf746d8eb6eb75e1e3ceec9ed38b6bbb3fc78a2c7 (patch)
tree97176226b27ea69cb1f559b232e6d600411e6ce2 /pkgs/os-specific/linux/pam
parentb9613385bca0a42649d78e2e2c7349143657a487 (diff)
downloadnixpkgs-f746d8eb6eb75e1e3ceec9ed38b6bbb3fc78a2c7.tar
nixpkgs-f746d8eb6eb75e1e3ceec9ed38b6bbb3fc78a2c7.tar.gz
nixpkgs-f746d8eb6eb75e1e3ceec9ed38b6bbb3fc78a2c7.tar.bz2
nixpkgs-f746d8eb6eb75e1e3ceec9ed38b6bbb3fc78a2c7.tar.lz
nixpkgs-f746d8eb6eb75e1e3ceec9ed38b6bbb3fc78a2c7.tar.xz
nixpkgs-f746d8eb6eb75e1e3ceec9ed38b6bbb3fc78a2c7.tar.zst
nixpkgs-f746d8eb6eb75e1e3ceec9ed38b6bbb3fc78a2c7.zip
linux-pam: set sconfigdir to /etc for usage at runtime
So users don’t need to override the $out/etc/security files, we need
to manually set this to /etc. Override it in the install phase so that
we still get the example $out/etc/security files .

Fixes #76713
Diffstat (limited to 'pkgs/os-specific/linux/pam')
-rw-r--r--pkgs/os-specific/linux/pam/default.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix
index d1a035d7448..e4429cc3bd7 100644
--- a/pkgs/os-specific/linux/pam/default.nix
+++ b/pkgs/os-specific/linux/pam/default.nix
@@ -44,9 +44,7 @@ stdenv.mkDerivation rec {
   # which is done by dlopening $out/lib/security/pam_foo.so
   # $out/etc was also missed: pam_env(login:session): Unable to open config file
 
-  preConfigure = ''
-    configureFlags="$configureFlags --includedir=$out/include/security"
-  '' + stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
+  preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
       # export ac_cv_search_crypt=no
       # (taken from Alpine linux, apparently insecure but also doesn't build O:))
       # disable insecure modules
@@ -54,6 +52,15 @@ stdenv.mkDerivation rec {
       sed -e 's/pam_rhosts//g' -i modules/Makefile.in
   '';
 
+  configureFlags = [
+    "--includedir=${placeholder "out"}/include/security"
+    "--enable-sconfigdir=/etc/security"
+  ];
+
+  installFlags = [
+    "SCONFIGDIR=${placeholder "out"}/etc/security"
+  ];
+
   doCheck = false; # fails
 
   meta = with stdenv.lib; {