aboutsummaryrefslogtreecommitdiff
path: root/manage.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-20 10:16:41 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-20 10:16:41 +0000
commitdd1047f52119bbe78bd0f2c9452c9965c4bdf0dc (patch)
tree1675b676ff3f477d365940dd8a39578fed97ef62 /manage.c
parentChangeLog edit (diff)
downloadopenvpn-dd1047f52119bbe78bd0f2c9452c9965c4bdf0dc.tar.xz
Some changes to GET_USER_PASS_NEED_OK flag to
get_user_pass. (1) Allow an additional longer prompt string to be passed to the management interface client, in addition to the request type string. (2) Allow the management interface client to return a string, usually "ok" or "cancel" as the third argument to "needok" command. (3) Renamed "ok" command in management interface to "needok". (4) Edited management-notes.txt to reflect new needok feature. (5) See init.c:125 for new code example. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@694 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'manage.c')
-rw-r--r--manage.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/manage.c b/manage.c
index d17d9ce..89e115e 100644
--- a/manage.c
+++ b/manage.c
@@ -74,8 +74,9 @@ man_help ()
msg (M_CLIENT, "log [on|off] [N|all] : Turn on/off realtime log display");
msg (M_CLIENT, " + show last N lines or 'all' for entire history.");
msg (M_CLIENT, "mute [n] : Set log mute level to n, or show level if n is absent.");
+ msg (M_CLIENT, "needok type action : Enter confirmation for NEED-OK request of 'type',");
+ msg (M_CLIENT, " where action = 'ok' or 'cancel'.");
msg (M_CLIENT, "net : (Windows only) Show network info and routing table.");
- msg (M_CLIENT, "ok type : Enter confirmation for NEED-OK request.");
msg (M_CLIENT, "password type p : Enter password p for a queried OpenVPN password.");
msg (M_CLIENT, "signal s : Send signal s to daemon,");
msg (M_CLIENT, " s = SIGHUP|SIGTERM|SIGUSR1|SIGUSR2.");
@@ -527,10 +528,10 @@ man_query_password (struct management *man, const char *type, const char *string
}
static void
-man_query_need_ok (struct management *man, const char *type)
+man_query_need_ok (struct management *man, const char *type, const char *action)
{
const bool needed = ((man->connection.up_query_mode == UP_QUERY_NEED_OK) && man->connection.up_query_type);
- man_query_user_pass (man, type, "ok", needed, "ok-confirmation", man->connection.up_query.password, USER_PASS_LEN);
+ man_query_user_pass (man, type, action, needed, "needok-confirmation", man->connection.up_query.password, USER_PASS_LEN);
}
static void
@@ -721,10 +722,10 @@ man_dispatch_command (struct management *man, struct status_output *so, const ch
if (man_need (man, p, 2, 0))
man_query_password (man, p[1], p[2]);
}
- else if (streq (p[0], "ok"))
+ else if (streq (p[0], "needok"))
{
- if (man_need (man, p, 1, 0))
- man_query_need_ok (man, p[1]);
+ if (man_need (man, p, 2, 0))
+ man_query_need_ok (man, p[1], p[2]);
}
else if (streq (p[0], "net"))
{
@@ -1789,6 +1790,9 @@ management_query_user_pass (struct management *man,
type,
alert_type);
+ if (flags & GET_USER_PASS_NEED_OK)
+ buf_printf (&alert_msg, " MSG:%s", up->username);
+
man_wait_for_client_connection (man, &signal_received, 0, MWCC_PASSWORD_WAIT);
if (signal_received)
ret = false;