sslh: update to 1.18.

This commit is contained in:
Michael Gehring 2016-03-29 21:41:33 +02:00
parent ac38ff73bb
commit e37e7a8f5c
2 changed files with 4 additions and 108 deletions

View File

@ -1,104 +0,0 @@
diff --git Makefile Makefile
index ef77957..4d3857d 100644
--- Makefile
+++ Makefile
@@ -1,6 +1,8 @@
# Configuration
VERSION=$(shell ./genver.sh -r)
+ENABLE_REGEX=1
+USELIBPCRE=1
USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files)
USELIBWRAP?= # Use libwrap?
USELIBCAP= # Use libcap?
@@ -22,6 +24,15 @@ CFLAGS ?=-Wall -g $(CFLAGS_COV)
LIBS=
OBJS=common.o sslh-main.o probe.o
+ifneq ($(strip $(ENABLE_REGEX)),)
+ CPPFLAGS+=-DENABLE_REGEX
+endif
+
+ifneq ($(strip $(USELIBPCRE)),)
+ LIBS:=$(LIBS) -lpcre
+ CPPFLAGS+=-DLIBPCRE
+endif
+
ifneq ($(strip $(USELIBWRAP)),)
LIBS:=$(LIBS) -lwrap
CPPFLAGS+=-DLIBWRAP
diff --git probe.c probe.c
index 8cff937..1e8c060 100644
--- probe.c
+++ probe.c
@@ -21,7 +21,13 @@
#define _GNU_SOURCE
#include <stdio.h>
+#ifdef ENABLE_REGEX
+#ifdef LIBPCRE
+#include <pcreposix.h>
+#else
#include <regex.h>
+#endif
+#endif
#include <ctype.h>
#include "probe.h"
@@ -226,6 +232,7 @@ static int is_tls_protocol(const char *p, int len, struct proto *proto)
static int regex_probe(const char *p, int len, struct proto *proto)
{
+#ifdef ENABLE_REGEX
regex_t **probe = proto->data;
regmatch_t pos = { 0, len };
@@ -233,6 +240,11 @@ static int regex_probe(const char *p, int len, struct proto *proto)
/* try them all */;
return (*probe != NULL);
+#else
+ /* Should never happen as we check when loading config file */
+ fprintf(stderr, "FATAL: regex probe called but not built in\n");
+ exit(5);
+#endif
}
/*
diff --git sslh-main.c sslh-main.c
index 9cc8a06..be54698 100644
--- sslh-main.c
+++ sslh-main.c
@@ -25,7 +25,13 @@
#ifdef LIBCONFIG
#include <libconfig.h>
#endif
+#ifdef ENABLE_REGEX
+#ifdef LIBPCRE
+#include <pcreposix.h>
+#else
#include <regex.h>
+#endif
+#endif
#include "common.h"
#include "probe.h"
@@ -174,6 +180,7 @@ static int config_listen(config_t *config, struct addrinfo **listen)
#ifdef LIBCONFIG
static void setup_regex_probe(struct proto *p, config_setting_t* probes)
{
+#ifdef ENABLE_REGEX
int num_probes, errsize, i, res;
char *err;
const char * expr;
@@ -201,6 +208,10 @@ static void setup_regex_probe(struct proto *p, config_setting_t* probes)
exit(1);
}
}
+#else
+ fprintf(stderr, "line %d: regex probe specified but not compiled in\n", config_setting_source_line(probes));
+ exit(5);
+#endif
}
#endif

View File

@ -1,15 +1,15 @@
# Template file for 'sslh'
pkgname=sslh
version=1.17
revision=3
version=1.18
revision=1
hostmakedepends="perl"
makedepends="pcre-devel libconfig-devel libcap-devel"
short_desc="Applicative Protocol Multiplexer"
maintainer="Markus Berger <pulux@pf4sh.de>"
license="GPL-2"
homepage="http://www.rutschle.net/tech/sslh"
homepage="http://www.rutschle.net/tech/sslh.shtml"
distfiles="https://github.com/yrutschle/sslh/archive/v${version}.tar.gz"
checksum=b557c3bf75289d203353c25d92e34549a22f64510c48f7748c1c027748d51ad1
checksum=f6cabf0e0c575aed20d1de23d3d693f3921c21e270d85fecba1ad2a48f3afcef
do_build() {
sed -i 's|^MAN=sslh.8.gz|MAN=sslh.8|g' Makefile