From 599cc3ec0a095317356b257b175e84e83e62458d Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 5 Mar 2013 11:25:53 +0100 Subject: [PATCH] cifs-utils: remove hard-coded path to 'systemd-ask-password' to close issue #353 --- pkgs/os-specific/linux/cifs-utils/default.nix | 2 ++ .../find-systemd-ask-password-via-path.patch | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/os-specific/linux/cifs-utils/find-systemd-ask-password-via-path.patch diff --git a/pkgs/os-specific/linux/cifs-utils/default.nix b/pkgs/os-specific/linux/cifs-utils/default.nix index 9e761b90a05..0f8801ef58e 100644 --- a/pkgs/os-specific/linux/cifs-utils/default.nix +++ b/pkgs/os-specific/linux/cifs-utils/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "0f619nw1163bcmfc83mmqj31qdkl68wfm81vynx3d8q0m0k1ll7i"; }; + patches = [ ./find-systemd-ask-password-via-path.patch ]; + makeFlags = "root_sbindir=$(out)/sbin"; meta = { diff --git a/pkgs/os-specific/linux/cifs-utils/find-systemd-ask-password-via-path.patch b/pkgs/os-specific/linux/cifs-utils/find-systemd-ask-password-via-path.patch new file mode 100644 index 00000000000..53b473c2822 --- /dev/null +++ b/pkgs/os-specific/linux/cifs-utils/find-systemd-ask-password-via-path.patch @@ -0,0 +1,22 @@ +diff -ubr cifs-utils-5.9-orig/mount.cifs.c cifs-utils-5.9/mount.cifs.c +--- cifs-utils-5.9-orig/mount.cifs.c 2013-03-05 10:53:19.375464790 +0100 ++++ cifs-utils-5.9/mount.cifs.c 2013-03-05 11:21:06.602624390 +0100 +@@ -1634,7 +1634,7 @@ + } + + /* +- * If systemd is running and /bin/systemd-ask-password -- ++ * If systemd is running and systemd-ask-password -- + * is available, then use that else fallback on getpass(..) + * + * Returns: @input or NULL on error +@@ -1657,7 +1657,7 @@ + FILE *ask_pass_fp = NULL; + + cmd = ret = NULL; +- if (asprintf(&cmd, "/bin/systemd-ask-password \"%s\"", prompt) >= 0) { ++ if (asprintf(&cmd, "systemd-ask-password \"%s\"", prompt) >= 0) { + ask_pass_fp = popen (cmd, "re"); + free (cmd); + } +Only in cifs-utils-5.9/: mount.cifs.c.orig