public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 910209a1e506e2ca70083ba02d3fd2bf1f8fbbc2
Date: Mon, 29 Apr 2013 10:23:04 +0200	[thread overview]
Message-ID: <20130429082305.F291A20135@argus.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 4594 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  910209a1e506e2ca70083ba02d3fd2bf1f8fbbc2 (commit)
       via  ab4cf06cff961d50dbe1ac5ff37d1aaa6299e8a6 (commit)
      from  9a883f3f53819fcf0f7de3c6596451cfbc3bcd60 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 910209a1e506e2ca70083ba02d3fd2bf1f8fbbc2
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Mon Apr 29 10:22:29 2013 +0200

    Add ovpnmain.cgi to core update 68.

commit ab4cf06cff961d50dbe1ac5ff37d1aaa6299e8a6
Author: Alexander Marx <amarx(a)ipfire.org>
Date:   Sun Apr 28 05:47:50 2013 +0200

    OpenVPN: Bugfix 10357, now when chaning an VPN N2N or editing an old one the ports are checked.

-----------------------------------------------------------------------

Summary of changes:
 config/rootfiles/core/68/filelists/files |  1 +
 html/cgi-bin/ovpnmain.cgi                | 19 +++++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

Difference in files:
diff --git a/config/rootfiles/core/68/filelists/files b/config/rootfiles/core/68/filelists/files
index ad6864a..bfd6746 100644
--- a/config/rootfiles/core/68/filelists/files
+++ b/config/rootfiles/core/68/filelists/files
@@ -2,6 +2,7 @@ etc/system-release
 etc/issue
 etc/modprobe.d/blacklist
 srv/web/ipfire/cgi-bin/connections.cgi
+srv/web/ipfire/cgi-bin/ovpnmain.cgi
 srv/web/ipfire/cgi-bin/services.cgi
 srv/web/ipfire/html/themes/ipfire/include/style.css
 srv/web/ipfire/html/themes/ipfire/include/functions.pl
diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index cbaecd9..1cfade6 100644
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2011  IPFire Team  <info(a)ipfire.org>                     #
+# Copyright (C) 2007-2013  IPFire Team  <info(a)ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -3498,18 +3498,25 @@ if ($cgiparams{'TYPE'} eq 'host') {
 ###
 
 if ($cgiparams{'TYPE'} eq 'net') {
-		
-    if ($cgiparams{'DEST_PORT'} eq  $vpnsettings{'DDEST_PORT'}) {
+	if ($cgiparams{'DEST_PORT'} eq  $vpnsettings{'DDEST_PORT'}) {
 			$errormessage = $Lang::tr{'openvpn destination port used'};
 			unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
 	    rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
       goto VPNCONF_ERROR;			
 		}
-    
-    if ($cgiparams{'DEST_PORT'} eq  '') {
+    #Bugfix 10357
+    foreach my $key (sort keys %confighash){
+		if ( ($confighash{$key}[22] eq $cgiparams{'DEST_PORT'} && $cgiparams{'NAME'} ne $confighash{$key}[1]) || ($confighash{$key}[29] eq $cgiparams{'DEST_PORT'} && $cgiparams{'NAME'} ne $confighash{$key}[1])){
 			$errormessage = $Lang::tr{'openvpn destination port used'};
 			unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
 	    rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
+      goto VPNCONF_ERROR;	
+		}
+	}
+    if ($cgiparams{'DEST_PORT'} eq  '') {
+			$errormessage = $Lang::tr{'invalid port'};
+			unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
+	    rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
       goto VPNCONF_ERROR;			
 		}
 
@@ -3920,7 +3927,7 @@ if ($cgiparams{'TYPE'} eq 'net') {
 	    }
 	}
 
-        # Save the config
+    # Save the config
 	my $key = $cgiparams{'KEY'};
 	
 	if (! $key) {


hooks/post-receive
--
IPFire 2.x development tree

                 reply	other threads:[~2013-04-29  8:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130429082305.F291A20135@argus.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox