summaryrefslogtreecommitdiff
path: root/src/openvpn/manage.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-10-02 06:57:11 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-10-02 06:57:11 +0200
commit5196d94f84f23057406cb15be7c49a39a05f912d (patch)
treea47dad26e006bd9aa52e7de32c39d75965a2a98d /src/openvpn/manage.c
parent1cc61feca65e1593f3cbe69af692e31c3042a8a6 (diff)
parenta6daf938f5f616a4a67caa6580b0c99e9a8c3779 (diff)
Updated version 2.4.4 from 'upstream/2.4.4'
with Debian dir 140f8169d27cc56f891366cfbea8aff1659cd942
Diffstat (limited to 'src/openvpn/manage.c')
-rw-r--r--src/openvpn/manage.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
index c2e8dc7..88121a3 100644
--- a/src/openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -68,7 +68,7 @@ static void man_output_standalone(struct management *man, volatile int *signal_r
static void man_reset_client_socket(struct management *man, const bool exiting);
static void
-man_help()
+man_help(void)
{
msg(M_CLIENT, "Management Interface for %s", title_string);
msg(M_CLIENT, "Commands:");
@@ -1878,17 +1878,15 @@ man_connect(struct management *man)
#if UNIX_SOCK_SUPPORT
if (man->settings.flags & MF_UNIX_SOCK)
{
- msg(D_LINK_ERRORS,
- "MANAGEMENT: connect to unix socket %s failed: %s",
- sockaddr_unix_name(&man->settings.local_unix, "NULL"),
- strerror_ts(status, &gc));
+ msg(D_LINK_ERRORS | M_ERRNO,
+ "MANAGEMENT: connect to unix socket %s failed",
+ sockaddr_unix_name(&man->settings.local_unix, "NULL"));
}
else
#endif
- msg(D_LINK_ERRORS,
- "MANAGEMENT: connect to %s failed: %s",
- print_sockaddr(man->settings.local->ai_addr, &gc),
- strerror_ts(status, &gc));
+ msg(D_LINK_ERRORS | M_ERRNO,
+ "MANAGEMENT: connect to %s failed",
+ print_sockaddr(man->settings.local->ai_addr, &gc));
throw_signal_soft(SIGTERM, "management-connect-failed");
goto done;
}
@@ -2008,9 +2006,8 @@ man_io_error(struct management *man, const char *prefix)
if (!ignore_sys_error(err))
{
struct gc_arena gc = gc_new();
- msg(D_MANAGEMENT, "MANAGEMENT: TCP %s error: %s",
- prefix,
- strerror_ts(err, &gc));
+ msg(D_MANAGEMENT, "MANAGEMENT: TCP %s error: %s", prefix,
+ strerror(err));
gc_free(&gc);
return true;
}
@@ -3504,7 +3501,9 @@ management_query_user_pass(struct management *man,
*/
if (ret)
{
- man->connection.up_query.nocache = up->nocache; /* preserve caller's nocache setting */
+ /* preserve caller's settings */
+ man->connection.up_query.nocache = up->nocache;
+ man->connection.up_query.wait_for_push = up->wait_for_push;
*up = man->connection.up_query;
}
secure_memzero(&man->connection.up_query, sizeof(man->connection.up_query));
@@ -3516,7 +3515,7 @@ management_query_user_pass(struct management *man,
#ifdef MANAGMENT_EXTERNAL_KEY
-int
+static int
management_query_multiline(struct management *man,
const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
{
@@ -3592,7 +3591,7 @@ done:
return ret;
}
-char *
+static char *
/* returns allocated base64 signature */
management_query_multiline_flatten_newline(struct management *man,
const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
@@ -3621,7 +3620,7 @@ management_query_multiline_flatten_newline(struct management *man,
return result;
}
-char *
+static char *
/* returns allocated base64 signature */
management_query_multiline_flatten(struct management *man,
const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
@@ -4000,9 +3999,25 @@ log_history_ref(const struct log_history *h, const int index)
}
}
+void
+management_sleep(const int n)
+{
+ if (management)
+ {
+ management_event_loop_n_seconds(management, n);
+ }
+ else
+ {
+ sleep(n);
+ }
+}
+
#else /* ifdef ENABLE_MANAGEMENT */
-static void
-dummy(void)
+
+void
+management_sleep(const int n)
{
+ sleep(n);
}
+
#endif /* ENABLE_MANAGEMENT */