From 4af65c01a9c745f50b38d076a213030bc6127df2 Mon Sep 17 00:00:00 2001 From: David Spencer Date: Tue, 22 Dec 2015 10:36:55 +0000 Subject: network/aiccu: Patched to build with gnutls-3.4. Signed-off-by: David Spencer Signed-off-by: Robby Workman --- network/aiccu/03_no-quiet-gcc.patch | 16 +++++++++ network/aiccu/05_spelling-error.patch | 46 ++++++++++++++++++++++++++ network/aiccu/06_syslog_openlog.patch | 20 ++++++++++++ network/aiccu/07_allow_tunnels.patch | 61 +++++++++++++++++++++++++++++++++++ network/aiccu/08_setup_script.patch | 40 +++++++++++++++++++++++ network/aiccu/10_gnutls34.patch | 35 ++++++++++++++++++++ network/aiccu/aiccu.SlackBuild | 10 +++++- 7 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 network/aiccu/03_no-quiet-gcc.patch create mode 100644 network/aiccu/05_spelling-error.patch create mode 100644 network/aiccu/06_syslog_openlog.patch create mode 100644 network/aiccu/07_allow_tunnels.patch create mode 100644 network/aiccu/08_setup_script.patch create mode 100644 network/aiccu/10_gnutls34.patch diff --git a/network/aiccu/03_no-quiet-gcc.patch b/network/aiccu/03_no-quiet-gcc.patch new file mode 100644 index 0000000000..27d14addf9 --- /dev/null +++ b/network/aiccu/03_no-quiet-gcc.patch @@ -0,0 +1,16 @@ +It's better for us to see gcc output in the build log to ease debugging. +Quiet builds make that much harder. + +Index: aiccu-20070115/unix-console/Makefile +=================================================================== +--- aiccu-20070115.orig/unix-console/Makefile 2009-10-25 22:33:06.000000000 +0100 ++++ aiccu-20070115/unix-console/Makefile 2009-10-25 22:33:12.000000000 +0100 +@@ -26,7 +26,7 @@ + + #CFLAGS += $(CWARNS) -D_GNU_SOURCE -D_DEBUG -g3 -O0 + CFLAGS += $(CWARNS) -D_GNU_SOURCE +-CC = @gcc ++CC = gcc + RM = rm + + # Add -O3 when nothing is specified yet diff --git a/network/aiccu/05_spelling-error.patch b/network/aiccu/05_spelling-error.patch new file mode 100644 index 0000000000..832dbf9ce6 --- /dev/null +++ b/network/aiccu/05_spelling-error.patch @@ -0,0 +1,46 @@ +Fix some spelling errors to satisfy lintian + +--- aiccu.orig/common/aiccu_test.c ++++ aiccu/common/aiccu_test.c +@@ -133,7 +133,7 @@ + printf("### This confirms the reachability of the other side of the tunnel\n"); + printf("### If it doesn't reply then check your interface and routing tables\n"); + printf("### Don't forget to check your firewall of course\n"); +- printf("### If the previous test was succesful then this could be both\n"); ++ printf("### If the previous test was successful then this could be both\n"); + printf("### a firewalling and a routing/interface problem\n"); + printf("\n"); + system_arg(PING6, PINGCOUNT, hTunnel->sIPv6_POP); +--- aiccu.orig/common/common.c ++++ aiccu/common/common.c +@@ -484,7 +484,7 @@ + return false; + } + +- dolog(LOG_DEBUG, "TLS Handshake completed succesfully\n"); ++ dolog(LOG_DEBUG, "TLS Handshake completed successfully\n"); + + sock->tls_active = true; + return true; +--- aiccu.orig/common/tic.c ++++ aiccu/common/tic.c +@@ -517,8 +517,8 @@ + struct in6_addr ipv6_ll, ipv6_local; + char ll[100]; + +- /* Log that the fetch was succesful */ +- dolog(LOG_INFO, "Succesfully retrieved tunnel information for %s\n", sId); ++ /* Log that the fetch was successful */ ++ dolog(LOG_INFO, "Successfully retrieved tunnel information for %s\n", sId); + + /* + * Some TUN/TAP devices don't have any +@@ -652,7 +652,7 @@ + /* All went okay? */ + if (buf[0] == '2' && buf[1] == '0' && buf[2] == '2') + { +- dolog(LOG_INFO, "Succesfully retrieved POP information for %s\n", sId); ++ dolog(LOG_INFO, "Successfully retrieved POP information for %s\n", sId); + return pop; + } + diff --git a/network/aiccu/06_syslog_openlog.patch b/network/aiccu/06_syslog_openlog.patch new file mode 100644 index 0000000000..a3d1882d8d --- /dev/null +++ b/network/aiccu/06_syslog_openlog.patch @@ -0,0 +1,20 @@ +commit 0f7db943bef0488644dce11c2ba2d19c180d8650 +Author: Norman Rasmussen +Date: Sun Jan 10 21:43:44 2010 +0000 + + Initialize syslog so that we log with our PID as DAEMON. + +diff --git a/common/aiccu.c b/common/aiccu.c +index 9abb334..75aadc8 100755 +--- a/common/aiccu.c ++++ b/common/aiccu.c +@@ -58,6 +58,9 @@ bool aiccu_InitConfig() + int ret; + #define CAFILE "ca.pem" + #endif ++#ifndef _WIN32 ++ openlog(NULL, LOG_PID, LOG_DAEMON); ++#endif + /* Allocate & Initialize */ + g_aiccu = (struct AICCU_conf *)malloc(sizeof(*g_aiccu)); + if (!g_aiccu) return false; diff --git a/network/aiccu/07_allow_tunnels.patch b/network/aiccu/07_allow_tunnels.patch new file mode 100644 index 0000000000..ec1c1dade2 --- /dev/null +++ b/network/aiccu/07_allow_tunnels.patch @@ -0,0 +1,61 @@ +commit d7c4f7c0d34b80c188fa45228ca282fd8771a41d +Author: Norman Rasmussen +Date: Sun Jan 10 21:45:55 2010 +0000 + + Allow 'tunnels' mode when there's an already running instance. + +diff --git a/unix-console/main.c b/unix-console/main.c +index 8a4d9a9..388d988 100755 +--- a/unix-console/main.c ++++ b/unix-console/main.c +@@ -50,7 +50,7 @@ int sigrunning(int sig) + /* Close the file again */ + fclose(f); + +- /* If we can HUP it, it still runs */ ++ /* If we can signal it, it still runs */ + return (pid > 0 && kill(pid, sig) == 0 ? 1 : 0); + } + +@@ -302,20 +302,6 @@ int main(int argc, char *argv[]) + return -1; + } + +-#ifndef _WIN32 +- /* start or stop? */ +- if ( mode != A_TEST && +- mode != A_AUTOTEST) +- { +- /* Already running? */ +- if (sigrunning(mode == A_STOP ? SIGTERM : 0) == 1) +- { +- dolog(LOG_ERR, "Already running instance HUP'ed, exiting\n"); +- return 0; +- } +- } +-#endif +- + /* Verify required parameters */ + if (!g_aiccu->username || !g_aiccu->password) + { +@@ -331,6 +317,20 @@ int main(int argc, char *argv[]) + return ret == 0 ? -1 : 0; + } + ++#ifndef _WIN32 ++ /* start or stop? */ ++ if ( mode != A_TEST && ++ mode != A_AUTOTEST) ++ { ++ /* Already running? */ ++ if (sigrunning(mode == A_STOP ? SIGTERM : 0) == 1) ++ { ++ dolog(LOG_ERR, "Already running instance signaled, exiting\n"); ++ return 0; ++ } ++ } ++#endif ++ + /* Get our tunnel */ + hTunnel = get_tunnel(); + diff --git a/network/aiccu/08_setup_script.patch b/network/aiccu/08_setup_script.patch new file mode 100644 index 0000000000..26010f8097 --- /dev/null +++ b/network/aiccu/08_setup_script.patch @@ -0,0 +1,40 @@ +Author: Norman Rasmussen + + Make setupscript work and add teardownscript setting. + +--- aiccu.orig/common/aiccu.c ++++ aiccu/common/aiccu.c +@@ -212,9 +212,6 @@ + fprintf(f, "# Try to automatically login and setup the tunnel?\n"); + fprintf(f, "automatic %s\n", g_aiccu->automatic ? "true" : "false"); + fprintf(f, "\n"); +- fprintf(f, "# Script to run after setting up the interfaces (default: none)\n"); +- fprintf(f, "%ssetupscript %s\n", g_aiccu->setupscript ? "" : "#", g_aiccu->setupscript ? g_aiccu->setupscript : ""); +- fprintf(f, "\n"); + fprintf(f, "# TLS Required?\n"); + fprintf(f, "requiretls %s\n", g_aiccu->requiretls ? "true" : "false"); + fprintf(f, "\n"); +@@ -231,6 +228,9 @@ + fprintf(f, "# PID File\n"); + fprintf(f, "pidfile %s\n", g_aiccu->pidfile); + fprintf(f, "\n"); ++ fprintf(f, "# Script to run after setting up the interfaces (default: none)\n"); ++ fprintf(f, "%ssetupscript %s\n", g_aiccu->setupscript ? "" : "#", g_aiccu->setupscript ? g_aiccu->setupscript : ""); ++ fprintf(f, "\n"); + fprintf(f, "# Make heartbeats (default true)\n"); + fprintf(f, "# In general you don't want to turn this off\n"); + fprintf(f, "# Of course only applies to AYIYA and heartbeat tunnels not to static ones\n"); +--- aiccu.orig/unix-console/main.c ++++ aiccu/unix-console/main.c +@@ -471,6 +471,11 @@ + */ + if (aiccu_setup(hTunnel, true)) + { ++ if (g_aiccu->setupscript) ++ { ++ aiccu_exec("%s", g_aiccu->setupscript); ++ } ++ + /* We need to stay running when doing Heartbeat or AYIYA */ + if ( strcasecmp(hTunnel->sType, "6in4-heartbeat") == 0 || + strcasecmp(hTunnel->sType, "ayiya") == 0) diff --git a/network/aiccu/10_gnutls34.patch b/network/aiccu/10_gnutls34.patch new file mode 100644 index 0000000000..e8768eaa66 --- /dev/null +++ b/network/aiccu/10_gnutls34.patch @@ -0,0 +1,35 @@ +Description: GnuTLS 3.4 compat. + Use GnuTLS priority NORMAL:+CTYPE-OPENPGP instead of deprecated (and removed in GnuTLS 3.4) function gnutls_certificate_type_set_priority. +Author: Andreas Metzler +Bug-Debian: https://bugs.debian.org/624056 +Origin: vendor +Forwarded: no +Last-Update: 2015-07-25 + +--- aiccu-20070115.orig/common/common.c ++++ aiccu-20070115/common/common.c +@@ -271,8 +271,6 @@ TLSSOCKET sock_alloc(void); + TLSSOCKET sock_alloc(void) + { + #ifdef AICCU_GNUTLS +- /* Allow connections to servers that have OpenPGP keys as well */ +- const int cert_type_priority[3] = { GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 }; + int ret; + #endif /* AICCU_GNUTLS*/ + +@@ -297,11 +295,10 @@ TLSSOCKET sock_alloc(void) + } + + /* Use default priorities */ +- gnutls_set_default_priority(sock->session); +- /* XXX: Return value is not documented in GNUTLS documentation! */ +- +- gnutls_certificate_type_set_priority(sock->session, cert_type_priority); +- /* XXX: Return value is not documented in GNUTLS documentation! */ ++ /* Allow connections to servers that have OpenPGP keys as well */ ++ gnutls_priority_set_direct(sock->session, ++ "NORMAL:+CTYPE-OPENPGP", ++ NULL); + + /* Configure the x509 credentials for the current session */ + gnutls_credentials_set(sock->session, GNUTLS_CRD_CERTIFICATE, g_aiccu->tls_cred); diff --git a/network/aiccu/aiccu.SlackBuild b/network/aiccu/aiccu.SlackBuild index 6d0fe283b7..f7aea2100b 100644 --- a/network/aiccu/aiccu.SlackBuild +++ b/network/aiccu/aiccu.SlackBuild @@ -67,7 +67,15 @@ find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -o -perm 511 \) -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# Patches from Debian (thanks!) +patch -p1 < $CWD/03_no-quiet-gcc.patch +patch -p1 < $CWD/05_spelling-error.patch +patch -p1 < $CWD/06_syslog_openlog.patch +patch -p1 < $CWD/07_allow_tunnels.patch +patch -p1 < $CWD/08_setup_script.patch +patch -p1 < $CWD/10_gnutls34.patch CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ -- cgit v1.2.3-80-g2a13