git.iko.soy/typeable/nixpkgs
on master help sign in
pam_mount: fix PATH issue
commit5a5587ba6d209ac19857274a76b7e07450af527f authorThomas Strobel <ts468@cam.ac.uk> dateSat 4 Jul 2015, 16:30 (11 years ago) parent8722e54
2 files changed+38−2
pkgs/os-specific/linux/pam_mount/default.nix+8−2 pkgs/os-specific/linux/pam_mount/insert_utillinux_path_hooks.patch+30
pkgs/os-specific/linux/pam_mount/default.nix+8−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, autoconf, automake, pkgconfig, libtool, pam, libHX, utillinux, libxml2, pcre, perl, openssl, cryptsetup }:
1+{ stdenv, fetchurl, autoconf, automake, pkgconfig, libtool, pam, libHX, libxml2, pcre, perl, openssl, cryptsetup, utillinux }:
22
33stdenv.mkDerivation rec {
44 name = "pam_mount-2.15";
@@ -10,12 +10,18 @@ stdenv.mkDerivation rec {
1010
1111 buildInputs = [ autoconf automake pkgconfig libtool pam libHX utillinux libxml2 pcre perl openssl cryptsetup ];
1212
13− preConfigure = "sh autogen.sh --prefix=$out";
13+ patches = [ ./insert_utillinux_path_hooks.patch ];
14+
15+ preConfigure = ''
16+ substituteInPlace src/mtcrypt.c --replace @@NIX_UTILLINUX@@ ${utillinux}/bin
17+ sh autogen.sh --prefix=$out
18+ '';
1419
1520 makeFlags = "DESTDIR=$(out)";
1621
1722 # Probably a hack, but using DESTDIR and PREFIX makes everything work!
1823 postInstall = ''
24+ mkdir -p $out
1925 cp -r $out/$out/* $out
2026 rm -r $out/nix
2127 '';
pkgs/os-specific/linux/pam_mount/insert_utillinux_path_hooks.patchnew file+30
@@ -0,0 +1,30 @@
1+diff -uNr pam_mount-2.15_old/src/mtcrypt.c pam_mount-2.15/src/mtcrypt.c
2+--- pam_mount-2.15_old/src/mtcrypt.c 2015-07-04 16:00:12.917943336 +0200
3++++ pam_mount-2.15/src/mtcrypt.c 2015-07-04 16:03:45.685302493 +0200
4+@@ -534,7 +534,7 @@
5+
6+ /* candidate for replacement by some libmount calls, I guess. */
7+ argk = 0;
8+- mount_args[argk++] = "mount";
9++ mount_args[argk++] = "@@NIX_UTILLINUX@@/mount";
10+ if (opt->fstype != NULL) {
11+ mount_args[argk++] = "-t";
12+ mount_args[argk++] = opt->fstype;
13+@@ -668,7 +668,7 @@
14+
15+ if (!opt->no_update)
16+ pmt_smtab_remove(mntpt, SMTABF_MOUNTPOINT);
17+- rmt_args[argk++] = "mount";
18++ rmt_args[argk++] = "@@NIX_UTILLINUX@@/mount";
19+ rmt_args[argk++] = "-o";
20+ rmt_args[argk++] = opt->extra_opts;
21+ rmt_args[argk++] = mntpt;
22+@@ -749,7 +749,7 @@
23+ pmt_smtab_remove(mountpoint, SMTABF_MOUNTPOINT);
24+ pmt_cmtab_remove(mountpoint);
25+
26+- umount_args[argk++] = "umount";
27++ umount_args[argk++] = "@@NIX_UTILLINUX@@/umount";
28+ umount_args[argk++] = "-i";
29+ umount_args[argk++] = mountpoint;
30+ umount_args[argk] = NULL;