]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove erroneous limitation on max number of args for --plugin
authorGert Doering <gert@greenie.muc.de>
Thu, 18 May 2017 19:13:11 +0000 (21:13 +0200)
committerGert Doering <gert@greenie.muc.de>
Sat, 20 May 2017 17:57:58 +0000 (19:57 +0200)
Commit 3d6a4cded2 introduced a maximum limit of possible arguments
for most options, to error out on config lines with too-many args.

Commit 82acf21634 extended the limit for "--plugin" to accept "one
mandatory, one optional" argument.

Both are wrong - "--plugin" can accept an arbitrary number of arguments,
but this is not directly obvious from options.c, one needs to check
plugins.c / plugin_option_list_add() and misc.c / make_extended_arg_array()
to see that.

Thus, remove the max limit for "--plugin" completely.

(Reported by SviMik on IRC)

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170518191311.4769-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14678.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 3f181eaa324892845e0857d80c154512d9e8c59c)

src/openvpn/options.c

index 4ce46b147f766bcb1eb09964286f3a9bfe1fd7d1..57818e132ac0cfdc995c402f65ec66c5ba1ebc9e 100644 (file)
@@ -5168,7 +5168,7 @@ add_option(struct options *options,
     }
 #endif /* ifdef ENABLE_MANAGEMENT */
 #ifdef ENABLE_PLUGIN
-    else if (streq(p[0], "plugin") && p[1] && !p[3])
+    else if (streq(p[0], "plugin") && p[1])
     {
         VERIFY_PERMISSION(OPT_P_PLUGIN);
         if (!options->plugin_list)