aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-11-04 02:37:39 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-11-04 02:37:39 +0000
commitd19b079b40fdaa6e5e467991999367af146353f6 (patch)
tree135ad30a36d4ca30f3d99e05815cb8cbb214937a
parentsvn merge -r 770:771 $SO/trunk/openvpn (diff)
downloadopenvpn-d19b079b40fdaa6e5e467991999367af146353f6.tar.xz
Allow blank passwords to be passed via the management interface.
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@773 e7ae566f-a301-0410-adde-c780ea21d3b5
-rw-r--r--ChangeLog2
-rw-r--r--manage.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2db24fd..0179dd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@ $Id$
2005.11.xx -- Version 2.1-beta7
+* Allow blank passwords to be passed via the management
+ interface.
* Fixed bug where --server directive in --dev tap mode
claimed that it would support subnets of /30 or less
but actually would only accept /29 or less.
diff --git a/manage.c b/manage.c
index a645b02..6937a2c 100644
--- a/manage.c
+++ b/manage.c
@@ -52,6 +52,9 @@
#define MANAGEMENT_ECHO_FLAGS 0
#endif
+/* tag for blank username/password */
+static const char blank_up[] = "[[BLANK]]";
+
struct management *management; /* GLOBAL */
/* static forward declarations */
@@ -525,6 +528,8 @@ man_query_password (struct management *man, const char *type, const char *string
const bool needed = ((man->connection.up_query_mode == UP_QUERY_USER_PASS
|| man->connection.up_query_mode == UP_QUERY_PASS)
&& man->connection.up_query_type);
+ if (!string[0]) /* allow blank passwords to be passed through using the blank_up tag */
+ string = blank_up;
man_query_user_pass (man, type, string, needed, "password", man->connection.up_query.password, USER_PASS_LEN);
}
@@ -1828,6 +1833,10 @@ management_query_user_pass (struct management *man,
man->persist.standalone_disabled = standalone_disabled_save;
man->persist.special_state_msg = NULL;
+ /* pass through blank passwords */
+ if (!strcmp (man->connection.up_query.password, blank_up))
+ CLEAR (man->connection.up_query.password);
+
/*
* Transfer u/p to return object, zero any record
* we hold in the management object.