Skip to contentSkip to conversation

Use getpassphrase on Solaris/illumos

PATCH New Alexander Pyhalov 1 participant 1 message Dec 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use getpassphrase on Solaris/illumos

This is a patch against release/2.3 branch.

Signature · 4 lines
С уважением,
Александр Пыхалов,
программист отдела телекоммуникационной инфраструктуры
управления информационно-коммуникационной инфраструктуры ЮФУ

From 4dfe7d9740b2a96a8dbd5f74d43408582ebc9403 Mon Sep 17 00:00:00 2001
From: Alexander Pyhalov <[email protected]...>
Date: Fri, 9 Dec 2016 13:36:50 +0300
Subject: [PATCH] Use getpassphrase on Solaris/illumos

---
 src/openvpn/console.c | 5 +++++
 1 file changed, 5 insertions(+)
src/openvpn/console.c +5 -0
index 86331a1..c0f4c8a 100644
@@ -241,7 +241,12 @@ get_console_input (const char *prompt, const bool echo, char *input, const int c
     }
   else
     {
+#ifdef __sun
+      /* On Solaris/illumos getpass() returns up to 8 symbols */
+      char *gp = getpassphrase (prompt);
+#else
       char *gp = getpass (prompt);
+#endif
       if (gp)
 	{
 	  strncpynt (input, gp, capacity);
Signature · 1 line
2.9.2