about summary refs log tree commit diff
path: root/pkgs/misc/emulators/wine
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2020-01-30 20:19:56 +0000
committerGitHub <noreply@github.com>2020-01-30 20:19:56 +0000
commitae929e63b44942be374a83079321fae1be5c6009 (patch)
tree527784f63068a204266a021a1d7c1ade5ff63ccc /pkgs/misc/emulators/wine
parent86f8732194f20c7073ee05a980abf87376071a83 (diff)
parentd4149412ce8cefba7fc2b1606f1bddba20f44844 (diff)
downloadnixlib-ae929e63b44942be374a83079321fae1be5c6009.tar
nixlib-ae929e63b44942be374a83079321fae1be5c6009.tar.gz
nixlib-ae929e63b44942be374a83079321fae1be5c6009.tar.bz2
nixlib-ae929e63b44942be374a83079321fae1be5c6009.tar.lz
nixlib-ae929e63b44942be374a83079321fae1be5c6009.tar.xz
nixlib-ae929e63b44942be374a83079321fae1be5c6009.tar.zst
nixlib-ae929e63b44942be374a83079321fae1be5c6009.zip
Merge pull request #78406 from helsinki-systems/wine-certs
wine: Look for root certs at $NIX_SSL_CERT_FILE
Diffstat (limited to 'pkgs/misc/emulators/wine')
-rw-r--r--pkgs/misc/emulators/wine/base.nix5
-rw-r--r--pkgs/misc/emulators/wine/cert-path.patch24
2 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/misc/emulators/wine/base.nix b/pkgs/misc/emulators/wine/base.nix
index 0b6eab70263f..025158b07173 100644
--- a/pkgs/misc/emulators/wine/base.nix
+++ b/pkgs/misc/emulators/wine/base.nix
@@ -68,6 +68,11 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
   ])
   ++ [ pkgs.xorg.libX11 pkgs.perl ]));
 
+  patches = [
+    # Also look for root certificates at $NIX_SSL_CERT_FILE
+    ./cert-path.patch
+  ];
+
   # Wine locates a lot of libraries dynamically through dlopen().  Add
   # them to the RPATH so that the user doesn't have to set them in
   # LD_LIBRARY_PATH.
diff --git a/pkgs/misc/emulators/wine/cert-path.patch b/pkgs/misc/emulators/wine/cert-path.patch
new file mode 100644
index 000000000000..da01a4778102
--- /dev/null
+++ b/pkgs/misc/emulators/wine/cert-path.patch
@@ -0,0 +1,24 @@
+diff --git a/dlls/crypt32/rootstore.c b/dlls/crypt32/rootstore.c
+index f795181..fb4926a 100644
+--- a/dlls/crypt32/rootstore.c
++++ b/dlls/crypt32/rootstore.c
+@@ -18,6 +18,7 @@
+ #include "config.h"
+ #include <stdarg.h>
+ #include <stdio.h>
++#include <stdlib.h> /* getenv */
+ #include <sys/types.h>
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+@@ -916,6 +917,11 @@ static void read_trusted_roots_from_known_locations(HCERTSTORE store)
+ 
+         for (i = 0; !ret && i < ARRAY_SIZE(CRYPT_knownLocations); i++)
+             ret = import_certs_from_path(CRYPT_knownLocations[i], from, TRUE);
++
++        char *nix_cert_file = getenv("NIX_SSL_CERT_FILE");
++        if (nix_cert_file != NULL)
++            ret = import_certs_from_path(nix_cert_file, from, TRUE);
++
+         check_and_store_certs(from, store);
+     }
+     CertCloseStore(from, 0);