From 60a2fc1fec78f2653b3ef71b24ec8ae72b99d38b Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 24 Feb 2014 01:07:57 +0100 Subject: [PATCH] openssl: Fix Windows compat in cert-file.patch. In Windows there is no get(e)uid() call available, so the build fails. The patch now checks whether OPENSSL_SYS_WINDOWS is defined and only uses those calls if _not_ on Windows. Signed-off-by: aszlig --- pkgs/development/libraries/openssl/cert-file.patch | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/openssl/cert-file.patch b/pkgs/development/libraries/openssl/cert-file.patch index 6b7a60e9026..26b51c0295e 100644 --- a/pkgs/development/libraries/openssl/cert-file.patch +++ b/pkgs/development/libraries/openssl/cert-file.patch @@ -12,7 +12,7 @@ diff -ru -x '*~' openssl-1.0.0e-orig/crypto/x509/x509_def.c openssl-1.0.0e/crypt #include "cryptlib.h" #include #include -@@ -71,7 +75,19 @@ +@@ -71,7 +75,25 @@ { return(X509_CERT_DIR); } const char *X509_get_default_cert_file(void) @@ -23,9 +23,15 @@ diff -ru -x '*~' openssl-1.0.0e-orig/crypto/x509/x509_def.c openssl-1.0.0e/crypt + if (!init) { + init = 1; + char * s = getenv("OPENSSL_X509_CERT_FILE"); -+ if (s && getuid() == geteuid()) { -+ strncpy(buf, s, sizeof(buf)); -+ buf[sizeof(buf) - 1] = 0; ++ if (s) { ++#ifndef OPENSSL_SYS_WINDOWS ++ if (getuid() == geteuid()) { ++#endif ++ strncpy(buf, s, sizeof(buf)); ++ buf[sizeof(buf) - 1] = 0; ++#ifndef OPENSSL_SYS_WINDOWS ++ } ++#endif + } + } + return buf;