ovpnmain.cgi: Remove unnecessary check/error message

Message ID 20210907155309.1896-1-hofmann@leo-andres.de
State Accepted
Commit d5f11f4e27fe1fd7a24e198a3a382e596736ff40
Headers show
Series ovpnmain.cgi: Remove unnecessary check/error message | expand

Commit Message

Leo Hofmann Sept. 7, 2021, 3:53 p.m. UTC
This parameter can either be "host" or "net", but the existing check
only allows "net" entries. Since other entries are also valid but
don't require further action, this patch removes the error message.

Fixes: #12686

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
---
 html/cgi-bin/ovpnmain.cgi | 3 ---
 1 file changed, 3 deletions(-)

Comments

Michael Tremer Sept. 7, 2021, 3:58 p.m. UTC | #1
You are a star :)

Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>

-Michael

> On 7 Sep 2021, at 16:53, Leo-Andres Hofmann <hofmann@leo-andres.de> wrote:
> 
> This parameter can either be "host" or "net", but the existing check
> only allows "net" entries. Since other entries are also valid but
> don't require further action, this patch removes the error message.
> 
> Fixes: #12686
> 
> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
> ---
> html/cgi-bin/ovpnmain.cgi | 3 ---
> 1 file changed, 3 deletions(-)
> 
> diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
> index 3cd2f9381..2ebf384ed 100644
> --- a/html/cgi-bin/ovpnmain.cgi
> +++ b/html/cgi-bin/ovpnmain.cgi
> @@ -2183,9 +2183,6 @@ END
> 					&General::system("/usr/local/bin/openvpnctrl", "-kn2n", "$confighash{$cgiparams{'KEY'}}[1]");
> 					&writecollectdconf();
> 				}
> - 
> -			} else {
> -				$errormessage = $Lang::tr{'invalid key'};
> 			}
> 		}
>   }
> -- 
> 2.27.0.windows.1
>

Patch

diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index 3cd2f9381..2ebf384ed 100644
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -2183,9 +2183,6 @@  END
 					&General::system("/usr/local/bin/openvpnctrl", "-kn2n", "$confighash{$cgiparams{'KEY'}}[1]");
 					&writecollectdconf();
 				}
- 
-			} else {
-				$errormessage = $Lang::tr{'invalid key'};
 			}
 		}
   }