]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
options: fix inlining auth-gen-token-secret file
authorAntonio Quartulli <a@unstable.cc>
Fri, 8 May 2020 21:14:34 +0000 (23:14 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 11 May 2020 07:13:09 +0000 (09:13 +0200)
With commit ("convert *_inline attributes to bool") the logic for
signaling when a certain option is inline has been changed.
Due to an overlook, the auth-gen-token-secret was not converted, thus
making it impossible to be inlined.

Fix parsing logic and allow auth-gen-token-secret to be inlined as well.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20200508211434.27545-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19862.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c

index 56c9e411150f02ce65c62e0c3de4c85919b8eae9..2d2089e3be6598e053dd94ea84bc4320f578f21b 100644 (file)
@@ -6981,16 +6981,12 @@ add_option(struct options *options,
         }
 
     }
-    else if (streq(p[0], "auth-gen-token-secret") && p[1] && (!p[2]
-                                                              || (p[2] && streq(p[1], INLINE_FILE_TAG))))
+    else if (streq(p[0], "auth-gen-token-secret") && p[1] && !p[2])
     {
-        VERIFY_PERMISSION(OPT_P_GENERAL);
+        VERIFY_PERMISSION(OPT_P_GENERAL|OPT_P_INLINE);
         options->auth_token_secret_file = p[1];
+        options->auth_token_secret_file_inline = is_inline;
 
-        if (streq(p[1], INLINE_FILE_TAG) && p[2])
-        {
-            options->auth_token_secret_file_inline = p[2];
-        }
     }
     else if (streq(p[0], "client-connect") && p[1])
     {