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. bd767b27c85b2c6992cac38781b7bb78a03b694a
Date: Thu, 04 Jun 2015 17:53:40 +0200	[thread overview]
Message-ID: <20150604155340.3D4D422308@argus.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 4189 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  bd767b27c85b2c6992cac38781b7bb78a03b694a (commit)
       via  e528fb2c7352bf8f2b5c2bc3e298bfa4c34b9d31 (commit)
       via  bd33c332275ccb041a908c6e53ba78a1fa82f900 (commit)
      from  557d986cbb406369e0c253879e25f7c21f442830 (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 bd767b27c85b2c6992cac38781b7bb78a03b694a
Author: Lars Schuhmacher <larsen007(a)web.de>
Date:   Thu Jun 4 00:58:49 2015 +0200

    ipsec.conf: Include ipsec.user.conf and ipsec.user-post.conf
    
    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(a)web.de>
    Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>

commit e528fb2c7352bf8f2b5c2bc3e298bfa4c34b9d31
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Wed Jun 3 18:00:13 2015 +0200

    rebuildhosts: Don't break when RED not online
    
    The hosts file was not regenerated when RED was not connected
    which should not be happening.
    
    This patch checks if the file exists. If not, the gateway
    line will not be written to /etc/hosts.

commit bd33c332275ccb041a908c6e53ba78a1fa82f900
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Wed Jun 3 17:55:55 2015 +0200

    rebuildhosts: Fix SEGV when not online
    
    Fixes #10867

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

Summary of changes:
 html/cgi-bin/vpnmain.cgi      | 14 ++++++++++++--
 src/misc-progs/rebuildhosts.c | 20 ++++++++------------
 2 files changed, 20 insertions(+), 14 deletions(-)

Difference in files:
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);
diff --git a/src/misc-progs/rebuildhosts.c b/src/misc-progs/rebuildhosts.c
index 21c5236..f77c2df 100644
--- a/src/misc-progs/rebuildhosts.c
+++ b/src/misc-progs/rebuildhosts.c
@@ -79,18 +79,13 @@ int main(int argc, char *argv[])
 	freekeyvalues(kv);
 	kv = NULL;
 
-	if (!(gw = fopen(CONFIG_ROOT "/red/remote-ipaddress", "r")))
-	{
+	if ((gw = fopen(CONFIG_ROOT "/red/remote-ipaddress", "r"))) {
+		if (fgets(gateway, STRING_SIZE, gw) == NULL) {
+			fprintf(stderr, "Couldn't read remote-ipaddress\n");
+			exit(1);
+		}
+	} else {
 		fprintf(stderr, "Couldn't open remote-ipaddress file\n");
-		fclose(gw);
-		gw = NULL;
-		exit(1);
-	}
-
-	if (fgets(gateway, STRING_SIZE, gw) == NULL)
-	{
-		fprintf(stderr, "Couldn't read remote-ipaddress\n");
-		exit(1);
 	}
 
 	if (!(fd = fopen(CONFIG_ROOT "/main/hosts", "r")))
@@ -112,7 +107,8 @@ int main(int argc, char *argv[])
 	else
 		fprintf(hosts, "%s\t%s\n",address,hostname);
 
-	fprintf(hosts, "%s\tgateway\n",gateway);
+	if (strlen(gateway) > 0)
+		fprintf(hosts, "%s\tgateway\n", gateway);
 
 	while (fgets(buffer, STRING_SIZE, fd))
 	{


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

                 reply	other threads:[~2015-06-04 15:53 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=20150604155340.3D4D422308@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