summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorlethalman <lucabru@src.gnome.org>2015-07-04 17:28:36 +0200
committerlethalman <lucabru@src.gnome.org>2015-07-04 17:28:36 +0200
commita4c7a594cc80b83d687fdab4339d60077b840bea (patch)
treedae8141086fbd105611e9e52e7995d1c15447b94 /pkgs
parent2bd811155ecc1249b19c8602c8fd88d92d85d7af (diff)
parent5a5587ba6d209ac19857274a76b7e07450af527f (diff)
downloadnixlib-a4c7a594cc80b83d687fdab4339d60077b840bea.tar
nixlib-a4c7a594cc80b83d687fdab4339d60077b840bea.tar.gz
nixlib-a4c7a594cc80b83d687fdab4339d60077b840bea.tar.bz2
nixlib-a4c7a594cc80b83d687fdab4339d60077b840bea.tar.lz
nixlib-a4c7a594cc80b83d687fdab4339d60077b840bea.tar.xz
nixlib-a4c7a594cc80b83d687fdab4339d60077b840bea.tar.zst
nixlib-a4c7a594cc80b83d687fdab4339d60077b840bea.zip
Merge pull request #8636 from ts468/upstream.pam_mount
pam_mount: fix PATH issue
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/os-specific/linux/pam_mount/default.nix10
-rw-r--r--pkgs/os-specific/linux/pam_mount/insert_utillinux_path_hooks.patch30
2 files changed, 38 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/pam_mount/default.nix b/pkgs/os-specific/linux/pam_mount/default.nix
index 0cf41276153f..a4f52517df4b 100644
--- a/pkgs/os-specific/linux/pam_mount/default.nix
+++ b/pkgs/os-specific/linux/pam_mount/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake, pkgconfig, libtool, pam, libHX, utillinux, libxml2, pcre, perl, openssl, cryptsetup }:
+{ stdenv, fetchurl, autoconf, automake, pkgconfig, libtool, pam, libHX, libxml2, pcre, perl, openssl, cryptsetup, utillinux }:
 
 stdenv.mkDerivation rec {
   name = "pam_mount-2.15";
@@ -10,12 +10,18 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ autoconf automake pkgconfig libtool pam libHX utillinux libxml2 pcre perl openssl cryptsetup ];
 
-  preConfigure = "sh autogen.sh --prefix=$out";
+  patches = [ ./insert_utillinux_path_hooks.patch ];
+
+  preConfigure = ''
+    substituteInPlace src/mtcrypt.c --replace @@NIX_UTILLINUX@@ ${utillinux}/bin
+    sh autogen.sh --prefix=$out
+    '';
 
   makeFlags = "DESTDIR=$(out)";
 
   # Probably a hack, but using DESTDIR and PREFIX makes everything work!
   postInstall = ''
+    mkdir -p $out
     cp -r $out/$out/* $out
     rm -r $out/nix
     '';
diff --git a/pkgs/os-specific/linux/pam_mount/insert_utillinux_path_hooks.patch b/pkgs/os-specific/linux/pam_mount/insert_utillinux_path_hooks.patch
new file mode 100644
index 000000000000..6d9da05da295
--- /dev/null
+++ b/pkgs/os-specific/linux/pam_mount/insert_utillinux_path_hooks.patch
@@ -0,0 +1,30 @@
+diff -uNr pam_mount-2.15_old/src/mtcrypt.c pam_mount-2.15/src/mtcrypt.c
+--- pam_mount-2.15_old/src/mtcrypt.c	2015-07-04 16:00:12.917943336 +0200
++++ pam_mount-2.15/src/mtcrypt.c	2015-07-04 16:03:45.685302493 +0200
+@@ -534,7 +534,7 @@
+ 
+ 	/* candidate for replacement by some libmount calls, I guess. */
+ 	argk = 0;
+-	mount_args[argk++] = "mount";
++	mount_args[argk++] = "@@NIX_UTILLINUX@@/mount";
+ 	if (opt->fstype != NULL) {
+ 		mount_args[argk++] = "-t";
+ 		mount_args[argk++] = opt->fstype;
+@@ -668,7 +668,7 @@
+ 
+ 	if (!opt->no_update)
+ 		pmt_smtab_remove(mntpt, SMTABF_MOUNTPOINT);
+-	rmt_args[argk++] = "mount";
++	rmt_args[argk++] = "@@NIX_UTILLINUX@@/mount";
+ 	rmt_args[argk++] = "-o";
+ 	rmt_args[argk++] = opt->extra_opts;
+ 	rmt_args[argk++] = mntpt;
+@@ -749,7 +749,7 @@
+ 		pmt_smtab_remove(mountpoint, SMTABF_MOUNTPOINT);
+ 	pmt_cmtab_remove(mountpoint);
+ 
+-	umount_args[argk++] = "umount";
++	umount_args[argk++] = "@@NIX_UTILLINUX@@/umount";
+ 	umount_args[argk++] = "-i";
+ 	umount_args[argk++] = mountpoint;
+ 	umount_args[argk]   = NULL;