summary refs log tree commit diff
path: root/pkgs/tools/security/pass
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2016-09-03 06:05:56 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2016-09-03 06:07:15 +0200
commit493ab7b4fa3655b4765803b482e4725f6b1f7e88 (patch)
tree005a0f2202d11a47e15995add4d5f4c104ee256a /pkgs/tools/security/pass
parent1ed1ed210a096f2dea2a61f9e0952d812378548e (diff)
downloadnixpkgs-493ab7b4fa3655b4765803b482e4725f6b1f7e88.tar
nixpkgs-493ab7b4fa3655b4765803b482e4725f6b1f7e88.tar.gz
nixpkgs-493ab7b4fa3655b4765803b482e4725f6b1f7e88.tar.bz2
nixpkgs-493ab7b4fa3655b4765803b482e4725f6b1f7e88.tar.lz
nixpkgs-493ab7b4fa3655b4765803b482e4725f6b1f7e88.tar.xz
nixpkgs-493ab7b4fa3655b4765803b482e4725f6b1f7e88.tar.zst
nixpkgs-493ab7b4fa3655b4765803b482e4725f6b1f7e88.zip
pass: add patch to fix xclipboard handling
This is caused by our coreutils now being built as a single binary.
Diffstat (limited to 'pkgs/tools/security/pass')
-rw-r--r--pkgs/tools/security/pass/default.nix5
-rw-r--r--pkgs/tools/security/pass/set-correct-program-name-for-sleep.patch33
2 files changed, 36 insertions, 2 deletions
diff --git a/pkgs/tools/security/pass/default.nix b/pkgs/tools/security/pass/default.nix
index 534e06814e2..79f6a6c1c28 100644
--- a/pkgs/tools/security/pass/default.nix
+++ b/pkgs/tools/security/pass/default.nix
@@ -20,8 +20,9 @@ stdenv.mkDerivation rec {
   };
 
   patches =
-    [ ./program-name.patch ] ++
-    stdenv.lib.optional stdenv.isDarwin ./no-darwin-getopt.patch;
+    [ ./program-name.patch
+      ./set-correct-program-name-for-sleep.patch
+    ] ++ stdenv.lib.optional stdenv.isDarwin ./no-darwin-getopt.patch;
 
   buildInputs = [ makeWrapper ];
 
diff --git a/pkgs/tools/security/pass/set-correct-program-name-for-sleep.patch b/pkgs/tools/security/pass/set-correct-program-name-for-sleep.patch
new file mode 100644
index 00000000000..f00307307eb
--- /dev/null
+++ b/pkgs/tools/security/pass/set-correct-program-name-for-sleep.patch
@@ -0,0 +1,33 @@
+From 6ad29ae97263060c9ec95856e0d8ab18409108c0 Mon Sep 17 00:00:00 2001
+From: Franz Pletz <fpletz@fnordicwalking.de>
+Date: Sat, 3 Sep 2016 05:45:36 +0200
+Subject: [PATCH] Set correct program name for sleep
+
+---
+ src/password-store.sh | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src/password-store.sh b/src/password-store.sh
+index 63be840..ca47df3 100755
+--- a/src/password-store.sh
++++ b/src/password-store.sh
+@@ -133,11 +133,14 @@ clip() {
+ 	# variable. Specifically, it cannot store nulls nor (non-trivally) store
+ 	# trailing new lines.
+ 	local sleep_argv0="password store sleep on display $DISPLAY"
+-	pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5
++	pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5
+ 	local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | base64)"
+ 	echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard"
+ 	(
+-		( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
++		# Execute sleep as a child process of bash because it may be
++		# a symlink to a single binary version of coreutils or busybox
++		# which depends on argv0 correctly set to "sleep"
++		( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") )
+ 		local now="$(xclip -o -selection "$X_SELECTION" | base64)"
+ 		[[ $now != $(echo -n "$1" | base64) ]] && before="$now"
+ 
+-- 
+2.9.3
+