plaisthos has uploaded this change for review. ( 
http://gerrit.openvpn.net/c/openvpn/+/1967?usp=email )


Change subject: Assume termios.h is available on all non Windows platforms
......................................................................

Assume termios.h is available on all non Windows platforms

Checking for something that is available on all (non Windows) platforms
is not very useful. So just always use termios.h

Change-Id: I09b055f15e35614eab112ff69166c6985f8770da
Signed-off-by: Arne Schwabe <[email protected]>
---
M configure.ac
M src/openvpn/console_builtin.c
M src/openvpn/options.c
3 files changed, 8 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/67/1967/1

diff --git a/configure.ac b/configure.ac
index 1fa0e63..195116f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -459,7 +459,7 @@
        sys/time.h sys/ioctl.h sys/stat.h \
        sys/mman.h sys/file.h sys/wait.h \
        libgen.h stropts.h \
-       syslog.h pwd.h grp.h termios.h \
+       syslog.h pwd.h grp.h \
        sys/sockio.h sys/uio.h \
        poll.h sys/epoll.h err.h \
 ])
diff --git a/src/openvpn/console_builtin.c b/src/openvpn/console_builtin.c
index 9c8d72a..10369283 100644
--- a/src/openvpn/console_builtin.c
+++ b/src/openvpn/console_builtin.c
@@ -37,7 +37,7 @@
 #include "buffer.h"
 #include "misc.h"

-#ifdef HAVE_TERMIOS_H
+#ifndef _WIN32
 #include <termios.h>
 #endif

@@ -134,10 +134,7 @@
     return false;
 }

-#endif /* _WIN32 */
-
-
-#ifdef HAVE_TERMIOS_H
+#else

 /**
  * Open the current console TTY for read/write operations
@@ -176,7 +173,7 @@
     }
 }

-#endif /* HAVE_TERMIOS_H */
+#endif


 /**
@@ -197,10 +194,8 @@
     ASSERT(capacity > 0);
     input[0] = '\0';

-#if defined(_WIN32)
+#ifdef _WIN32
     return get_console_input_win32(prompt, echo, input, capacity);
-#elif !defined(HAVE_TERMIOS_H)
-    msg(M_FATAL, "Sorry, but I can't get console input on this OS (%s)", 
prompt);
 #else
     bool restore_tty = false;
     bool ret = false;
@@ -261,7 +256,7 @@

     close_tty(fp);
     return ret;
-#endif /* if defined(_WIN32) */
+#endif
 }

 /**
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 3c5a249..8ce625b 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -4305,7 +4305,7 @@
         }
     }
 #ifdef ENABLE_MANAGEMENT
-    else if (streq(p[0], "management") && p[1] && p[2] && !p[4])
+    else if (streq(p[0], "management") && p[1] && p[2] && (!p[4] || 
streq(p[2], "unix-script"))
     {
         VERIFY_PERMISSION(OPT_P_GENERAL);
         if (streq(p[2], "unix"))
@@ -4320,7 +4320,7 @@

         options->management_addr = p[1];
         options->management_port = p[2];
-        if (p[3])
+        if (p[3] && !(options->management_flags & MF_UNIX_SOCK_SCRIPT))
         {
             options->management_user_pass = p[3];
         }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1967?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09b055f15e35614eab112ff69166c6985f8770da
Gerrit-Change-Number: 1967
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to