ipsec.conf: Include ipsec.user.conf and ipsec.user-post.conf

Message ID op.xzofgbpncahio0@honk.fritz.box
State Accepted
Delegated to: Michael Tremer
Headers

Message

Lars Schuhmacher June 4, 2015, 8:58 a.m. UTC
  Fix bug 10869 as the code has been removed by mistake by the
previous commit dfea4f86c22c83e07d0f4a6f2a02166229ecb120.
It also includes ipsec.user.conf only when it exists.

Signed-off-by: Lars Schuhmacher <larsen007@web.de>
---
  html/cgi-bin/vpnmain.cgi | 14 ++++++++++++--
  1 file changed, 12 insertions(+), 2 deletions(-)
  

Comments

Michael Tremer June 5, 2015, 1:53 a.m. UTC | #1
Hi,

thank you for sending this in. The patch looks good and I merged it
already as it is a pretty simple one.

However I had again trouble applying it right away. I do not really know
why. It must some sort of whitespace error because the patch applies
with patch --ignore-whitespace. So this wasn't a one-time error with the
last patch.

Best,
-Michael

On Thu, 2015-06-04 at 00:58 +0200, Larsen wrote:
> Fix bug 10869 as the code has been removed by mistake by the
> previous commit dfea4f86c22c83e07d0f4a6f2a02166229ecb120.
> It also includes ipsec.user.conf only when it exists.
> 
> Signed-off-by: Lars Schuhmacher <larsen007@web.de>
> ---
>   html/cgi-bin/vpnmain.cgi | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi
> index 9490076..218dafa 100644
> --- a/html/cgi-bin/vpnmain.cgi
> +++ b/html/cgi-bin/vpnmain.cgi
> @@ -253,8 +253,10 @@ sub writeipsecfiles {
>       print CONF "\n";
> 
>       # Add user includes to config file
> -    print CONF "include /etc/ipsec.user.conf\n";
> -    print CONF "\n";
> +    if (-e "/etc/ipsec.user.conf") {
> +        print CONF "include /etc/ipsec.user.conf\n";
> +        print CONF "\n";
> +    }
> 
>       print SECRETS "include /etc/ipsec.user.secrets\n";
> 
> @@ -407,6 +409,14 @@ sub writeipsecfiles {
> 
>   	print CONF "\n";
>       }#foreach key
> +
> +    # Add post user includes to config file
> +    # After the GUI-connections allows to patch connections.
> +    if (-e "/etc/ipsec.user-post.conf") {
> +        print CONF "include /etc/ipsec.user-post.conf\n";
> +        print CONF "\n";
> +    }
> +
>       print SECRETS $last_secrets if ($last_secrets);
>       close(CONF);
>       close(SECRETS);
  
Lars Schuhmacher June 5, 2015, 1:59 a.m. UTC | #2
On Thu, 04 Jun 2015 17:53:27 +0200, Michael Tremer  
<michael.tremer@ipfire.org> wrote:

> thank you for sending this in. The patch looks good and I merged it
> already as it is a pretty simple one.

thx!


> However I had again trouble applying it right away. I do not really know
> why. It must some sort of whitespace error because the patch applies
> with patch --ignore-whitespace. So this wasn't a one-time error with the
> last patch.

For testing purposes, could you please create a patch file from what you  
have just merged so I can compare your patch with the file that  
Tortoisegit created for me?


Lars