Attention is currently required from: Arne Schwabe.

Hello Arne Schwabe,

I'd like you to do a code review.
Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2229?usp=email

to review the following change.


Change subject: options: drop unreachable branches
......................................................................

options: drop unreachable branches

- The non-Windows --dhcp-option handler near --user/--group is
  shadowed by the generic one earlier in the chain, which already
  calls setenv_foreign_option().
- add_option() sets file to "[CMD-LINE]" when NULL, so the file-less
  "Unrecognized option" message is never printed.
- usage() never returns, so the --help parameter check never runs.
- parse_hash_fingerprint() never returns NULL.

Change-Id: I54c8bfcb14edf08292fa049c2275dcd518b7fc6b
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M src/openvpn/options.c
1 file changed, 3 insertions(+), 29 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/29/2229/1

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index e51ece7..5d0eb40 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -1156,13 +1156,6 @@
         }

         struct verify_hash_list *hash = parse_hash_fingerprint(line, nbytes, 
msglevel, gc);
-
-        if (!hash)
-        {
-            gc_free(&gc_temp);
-            return NULL;
-        }
-
         hash->next = ret;
         ret = hash;
     }
@@ -4071,11 +4064,6 @@
     {
         VERIFY_PERMISSION(OPT_P_GENERAL);
         usage();
-        if (p[1])
-        {
-            msg(msglevel, "--help does not accept any parameters");
-            goto err;
-        }
     }
     if (streq(p[0], "version") && !p[1])
     {
@@ -6651,11 +6639,6 @@
         VERIFY_PERMISSION(OPT_P_GENERAL);
         options->groupname = p[1];
     }
-    else if (streq(p[0], "dhcp-option") && p[1] && !p[3])
-    {
-        VERIFY_PERMISSION(OPT_P_DHCPDNS);
-        setenv_foreign_option(options, p[1], p[2], es);
-    }
     else if (streq(p[0], "route-method") && p[1] && !p[2])
     {
         VERIFY_PERMISSION(OPT_P_ROUTE_EXTRAS);
@@ -7784,18 +7767,9 @@
     }
     else
     {
-        const msglvl_t msglevel_unknown = msglevel_unknown_option(options, 
p[0], msglevel_fc);
-        if (file)
-        {
-            msg(msglevel_unknown,
-                "Unrecognized option or missing or extra parameter(s) in 
%s:%d: %s (%s)", file,
-                line, p[0], PACKAGE_VERSION);
-        }
-        else
-        {
-            msg(msglevel_unknown, "Unrecognized option or missing or extra 
parameter(s): --%s (%s)",
-                p[0], PACKAGE_VERSION);
-        }
+        msg(msglevel_unknown_option(options, p[0], msglevel_fc),
+            "Unrecognized option or missing or extra parameter(s) in %s:%d: %s 
(%s)", file, line,
+            p[0], PACKAGE_VERSION);
     }
 err:
     gc_free(&gc);

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2229?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I54c8bfcb14edf08292fa049c2275dcd518b7fc6b
Gerrit-Change-Number: 2229
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to