[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fixes for running on centos7 under docker


Hi,
 These small fixes are needed for running the testsuite under docker
and under centos7.

regards,
Nikos
From a3e50b74d4af5711b4a4ade95cca5f291b70e2a2 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@xxxxxxxxxx>
Date: Thu, 12 Apr 2018 17:03:06 +0200
Subject: [PATCH 1/2] torture_path_expand_tilde_unix: use getpwuid() if no env
 variables

This allows operating under environments where the username variables
are not present.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@xxxxxxxxxx>
---
 tests/unittests/torture_misc.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/unittests/torture_misc.c b/tests/unittests/torture_misc.c
index de84c4a3..8a6eb87f 100644
--- a/tests/unittests/torture_misc.c
+++ b/tests/unittests/torture_misc.c
@@ -1,5 +1,6 @@
 #include "config.h"
 
+#include <unistd.h>
 #include <sys/types.h>
 #ifndef _WIN32
 
@@ -129,7 +130,14 @@ static void torture_path_expand_tilde_unix(void **state) {
     if (user == NULL){
         user = getenv("LOGNAME");
     }
-    assert_non_null(user);
+    /* in certain CIs there no such variables */
+    if (!user){
+        struct passwd *pw = getpwuid(getuid());
+        if (pw){
+            user = pw->pw_name;
+        }
+    }
+
     home = getenv("HOME");
     assert_non_null(home);
     snprintf(h, 256 - 1, "%s/.ssh", home);
-- 
2.14.3

From 00cdfddd4fa4e73e72156a5f0ccba24c573e6af3 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@xxxxxxxxxx>
Date: Fri, 13 Apr 2018 10:23:04 +0200
Subject: [PATCH 2/2] kex1: use libcrypto-compat.h for RSA_get0_key under
 openssl

Signed-off-by: Nikos Mavrogiannopoulos <nmav@xxxxxxxxxx>
---
 src/kex1.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/kex1.c b/src/kex1.c
index ead206b4..671b5b38 100644
--- a/src/kex1.c
+++ b/src/kex1.c
@@ -37,6 +37,10 @@
 #include "libssh/wrapper.h"
 #include "libssh/dh.h"
 
+#if defined HAVE_LIBCRYPTO
+#include "libcrypto-compat.h"
+#endif
+
 /* SSHv1 functions */
 
 /* makes a STRING contating 3 strings : ssh-rsa1,e and n */
-- 
2.14.3


Follow-Ups:
Re: fixes for running on centos7 under dockerAndreas Schneider <asn@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org