diff options
120 files changed, 2186 insertions, 4027 deletions
diff --git a/lang/lua-sha2/Makefile b/lang/lua-sha2/Makefile index 6a82334e7..a6b8b6b94 100644 --- a/lang/lua-sha2/Makefile +++ b/lang/lua-sha2/Makefile @@ -13,7 +13,7 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_URL:=https://code.google.com/p/sha2/ +PKG_SOURCE_URL:=https://github.com/lgierth/lua-sha2.git PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=02bd4bfdc806 PKG_LICENSE:=MIT diff --git a/lang/perl-dbi/Makefile b/lang/perl-dbi/Makefile index 263359128..71edd3a60 100644 --- a/lang/perl-dbi/Makefile +++ b/lang/perl-dbi/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=perl-dbi -PKG_VERSION:=1.633 +PKG_VERSION:=1.641 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TI/TIMB/ PKG_SOURCE:=DBI-$(PKG_VERSION).tar.gz -PKG_MD5SUM:=b4fe13b9a51c1446c5f3cf93e69a2044 +PKG_MD5SUM:=e77fd37fcf77fc88fde029c1b75ded54 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net> diff --git a/lang/perl-html-parser/Makefile b/lang/perl-html-parser/Makefile index 6baa88d82..07070f06d 100644 --- a/lang/perl-html-parser/Makefile +++ b/lang/perl-html-parser/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=perl-html-parser -PKG_VERSION:=3.71 +PKG_VERSION:=3.72 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS/ PKG_SOURCE:=HTML-Parser-$(PKG_VERSION).tar.gz -PKG_MD5SUM:=9128a45893097dfa3bf03301b19c5efe +PKG_MD5SUM:=eb7505e5f626913350df9dd4a03d54a8 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net> diff --git a/lang/perl-uri/Makefile b/lang/perl-uri/Makefile index 28164fd71..1f2565bf6 100644 --- a/lang/perl-uri/Makefile +++ b/lang/perl-uri/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=perl-uri -PKG_VERSION:=1.67 +PKG_VERSION:=1.74 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/ PKG_SOURCE:=URI-$(PKG_VERSION).tar.gz -PKG_MD5SUM:=d0ef53b6c63bcc02ba55f405c30741e3 +PKG_MD5SUM:=892f7183b178af40f205ba37128225db PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net> diff --git a/lang/perl-www-mechanize/Makefile b/lang/perl-www-mechanize/Makefile index 576424cd2..02e9203b1 100644 --- a/lang/perl-www-mechanize/Makefile +++ b/lang/perl-www-mechanize/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=perl-www-mechanize -PKG_VERSION:=1.74 +PKG_VERSION:=1.75 PKG_RELEASE:=1 PKG_SOURCE:=WWW-Mechanize-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/ -PKG_MD5SUM:=8ec615225037ac66a2d37f4e9693ef86 +PKG_MD5SUM:=9a4b9c8827f519908ef0a0d2b8ae96fa PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net> diff --git a/lang/php5/Makefile b/lang/php5/Makefile index 17314cfeb..8e0718664 100644 --- a/lang/php5/Makefile +++ b/lang/php5/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=php -PKG_VERSION:=5.6.17 +PKG_VERSION:=5.6.32 PKG_RELEASE:=1 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>, Michael Heimpold <mhei@heimpold.de> @@ -18,7 +18,7 @@ PKG_LICENSE_FILES:=LICENSE PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://www.php.net/distributions/ -PKG_MD5SUM:=5e080e4b7df5db24f1b64313f8114bd8 +PKG_MD5SUM:=660cd5bc0f16eaad655b7815c757aadc PKG_FIXUP:=libtool autoreconf PKG_BUILD_PARALLEL:=1 @@ -32,7 +32,7 @@ PHP5_MODULES = \ ftp \ gettext gd gmp \ hash \ - iconv \ + iconv intl \ json \ ldap \ mbstring mcrypt mysql mysqli \ @@ -98,6 +98,7 @@ endef define Package/php5-cli $(call Package/php5/Default) + DEPENDS+= +PACKAGE_php5-mod-intl:libstdcpp TITLE+= (CLI) endef @@ -108,6 +109,7 @@ endef define Package/php5-cgi $(call Package/php5/Default) + DEPENDS+= +PACKAGE_php5-mod-intl:libstdcpp TITLE+= (CGI & FastCGI) endef @@ -237,6 +239,12 @@ else CONFIGURE_ARGS+= --without-iconv endif +ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-intl),) + CONFIGURE_ARGS+= --enable-intl=shared +else + CONFIGURE_ARGS+= --disable-intl +endif + ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-json),) CONFIGURE_ARGS+= --enable-json=shared else @@ -258,7 +266,7 @@ else endif ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-mcrypt),) - CONFIGURE_ARGS+= --with-mcrypt=shared,"$(STAGING_DIR)/usr" + CONFIGURE_ARGS+= --with-mcrypt=shared,"$(STAGING_DIR)/usr" else CONFIGURE_ARGS+= --without-mcrypt endif @@ -543,6 +551,7 @@ $(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php5-mod-gettext:libintl-full $(eval $(call BuildModule,gmp,GMP,+PACKAGE_php5-mod-gmp:libgmp)) $(eval $(call BuildModule,hash,Hash)) $(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS))) +$(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php5-mod-intl:icu)) $(eval $(call BuildModule,json,JSON)) $(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php5-mod-ldap:libopenldap +PACKAGE_php5-mod-ldap:libsasl2)) $(eval $(call BuildModule,mbstring,MBString)) diff --git a/lang/php5/patches/102-debian_patches_use_embedded_timezonedb.patch b/lang/php5/patches/102-debian_patches_use_embedded_timezonedb.patch index bfbed435c..ea38b05a3 100644 --- a/lang/php5/patches/102-debian_patches_use_embedded_timezonedb.patch +++ b/lang/php5/patches/102-debian_patches_use_embedded_timezonedb.patch @@ -20,9 +20,9 @@ r1: initial revision --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c -@@ -18,8 +18,22 @@ - - /* $Id$ */ +@@ -22,8 +22,22 @@ + * THE SOFTWARE. + */ +#ifndef PATH_MAX +#define PATH_MAX 4096 @@ -43,7 +43,7 @@ r1: initial revision #include <stdio.h> #ifdef HAVE_LOCALE_H -@@ -32,8 +46,12 @@ +@@ -36,8 +50,12 @@ #include <strings.h> #endif @@ -56,7 +56,7 @@ r1: initial revision #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) # if defined(__LITTLE_ENDIAN__) -@@ -55,6 +73,11 @@ static int read_preamble(const unsigned +@@ -59,6 +77,11 @@ static int read_preamble(const unsigned { uint32_t version; @@ -68,7 +68,7 @@ r1: initial revision /* read ID */ version = (*tzf)[3] - '0'; *tzf += 4; -@@ -298,7 +321,406 @@ void timelib_dump_tzinfo(timelib_tzinfo +@@ -302,7 +325,406 @@ void timelib_dump_tzinfo(timelib_tzinfo } } @@ -476,7 +476,7 @@ r1: initial revision { int left = 0, right = tzdb->index_size - 1; #ifdef HAVE_SETLOCALE -@@ -337,21 +759,90 @@ static int seek_to_tz_position(const uns +@@ -341,21 +763,90 @@ static int seek_to_tz_position(const uns return 0; } @@ -568,7 +568,7 @@ r1: initial revision } static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz) -@@ -376,10 +867,12 @@ static void read_64bit_header(const unsi +@@ -380,10 +871,12 @@ static void read_64bit_header(const unsi timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb) { const unsigned char *tzf; @@ -582,7 +582,7 @@ r1: initial revision tmp = timelib_tzinfo_ctor(timezone); version = read_preamble(&tzf, tmp); -@@ -393,7 +886,34 @@ timelib_tzinfo *timelib_parse_tzfile(cha +@@ -397,7 +890,34 @@ timelib_tzinfo *timelib_parse_tzfile(cha skip_64bit_types(&tzf, tmp); skip_posix_string(&tzf, tmp); } diff --git a/lang/php5/patches/200-ext-opcache-fix-detection-of-shm-mmap.patch b/lang/php5/patches/200-ext-opcache-fix-detection-of-shm-mmap.patch index d2a1e91af..0576ed89f 100644 --- a/lang/php5/patches/200-ext-opcache-fix-detection-of-shm-mmap.patch +++ b/lang/php5/patches/200-ext-opcache-fix-detection-of-shm-mmap.patch @@ -18,8 +18,6 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de> ext/opcache/config.m4 | 122 ++----------------------------------------------- 1 file changed, 4 insertions(+), 118 deletions(-) -diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 -index b7e4835..7b6c0aa 100644 --- a/ext/opcache/config.m4 +++ b/ext/opcache/config.m4 @@ -11,127 +11,13 @@ if test "$PHP_OPCACHE" != "no"; then @@ -154,6 +152,3 @@ index b7e4835..7b6c0aa 100644 AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support) AC_TRY_RUN([ --- -1.7.10.4 - diff --git a/lang/php5/patches/950-Fix-dl-cross-compiling-issue.patch b/lang/php5/patches/950-Fix-dl-cross-compiling-issue.patch index 22122ec82..d6a777e27 100644 --- a/lang/php5/patches/950-Fix-dl-cross-compiling-issue.patch +++ b/lang/php5/patches/950-Fix-dl-cross-compiling-issue.patch @@ -55,5 +55,5 @@ + AC_MSG_RESULT("no") +]) - if test "$flock_type" == "unknown"; then + if test "$flock_type" = "unknown"; then AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no]) diff --git a/libs/apr/Makefile b/libs/apr/Makefile index 924db85b4..6fc938059 100644 --- a/libs/apr/Makefile +++ b/libs/apr/Makefile @@ -12,7 +12,7 @@ PKG_VERSION:=1.5.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://mirrors.ibiblio.org/apache/apr/ +PKG_SOURCE_URL:=https://archive.apache.org/dist/apr/ PKG_MD5SUM:=4e9769f3349fe11fc0a5e1b224c236aa PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> PKG_LICENSE:=Apache License diff --git a/libs/libdnet/Makefile b/libs/libdnet/Makefile index 08d3e20b3..b0980cefd 100644 --- a/libs/libdnet/Makefile +++ b/libs/libdnet/Makefile @@ -11,9 +11,9 @@ PKG_NAME:=libdnet PKG_VERSION:=1.12 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://libdnet.googlecode.com/files/ -PKG_MD5SUM:=9253ef6de1b5e28e9c9a62b882e44cc9 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/dugsong/libdnet/archive +PKG_MD5SUM:=d2f1b72eac2a1070959667e9e61dcf20 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -21,6 +21,8 @@ PKG_INSTALL:=1 PKG_LICENSE:=BSD PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org> +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION) + include $(INCLUDE_DIR)/package.mk define Package/libdnet diff --git a/libs/libesmtp/Makefile b/libs/libesmtp/Makefile index fa402c660..256d96399 100644 --- a/libs/libesmtp/Makefile +++ b/libs/libesmtp/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2008-2015 OpenWrt.org +# Copyright (C) 2008-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,14 +9,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libesmtp PKG_VERSION:=1.0.6 -PKG_RELEASE:=2 -PKG_MD5SUM:=c4fedc999b6c3820296b0eb92cc2e252 +PKG_RELEASE:=3 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch> PKG_LICENSE:=LGPL-2.0+ PKG_LICENSE_FILES:=COPYING -PKG_SOURCE_URL:=http://www.stafford.uklinux.net/libesmtp +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/tru7/libesmtp.git +PKG_SOURCE_VERSION=10e9a6df9f76da610941addf71b9a3cbf94f2e9f +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_BUILD_PARALLEL:=1 @@ -28,13 +30,10 @@ define Package/libesmtp SECTION:=libs CATEGORY:=Libraries TITLE:=A Library for Posting Electronic Mail - URL:=http://www.stafford.uklinux.net/libesmtp/ - DEPENDS:=+libpthread + URL:=https://github.com/tru7/libesmtp.git + DEPENDS:=+libpthread +libopenssl endef -CONFIGURE_ARGS += \ - --without-openssl - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libesmtp-config $(1)/usr/bin/ diff --git a/libs/libssh2/Makefile b/libs/libssh2/Makefile index 7951f63ef..5670d2279 100644 --- a/libs/libssh2/Makefile +++ b/libs/libssh2/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2015 OpenWrt.org +# Copyright (C) 2015 - 2018 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libssh2 PKG_VERSION:=1.6.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.libssh2.org/download +PKG_SOURCE_URL:=https://www.libssh2.org/download PKG_MD5SUM:=00aabd6e714a5f42a4fb82ace20db1dd PKG_INSTALL:=1 @@ -26,9 +26,9 @@ define Package/libssh2 SECTION:=libs CATEGORY:=Libraries TITLE:=SSH2 library - URL:=http://www.libssh2.org/ + URL:=https://www.libssh2.org/ DEPENDS:=+libopenssl +zlib - MAINTAINER:=Jiri Slachta <slachta@cesnet.cz> + MAINTAINER:=Jiri Slachta <jiri@slachta.eu> endef define Package/libssh2/description @@ -39,7 +39,8 @@ TARGET_CFLAGS += $(FPIC) CONFIGURE_ARGS += \ --disable-examples-build \ - --with-libssl-prefix=$(STAGING_DIR)/usr + --with-libssl-prefix=$(STAGING_DIR)/usr \ + --with-libz-prefix=$(STAGING_DIR)/usr define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include diff --git a/libs/libssh2/patches/0004-CVE-2016-0787.patch b/libs/libssh2/patches/0004-CVE-2016-0787.patch new file mode 100644 index 000000000..ffcc7fc03 --- /dev/null +++ b/libs/libssh2/patches/0004-CVE-2016-0787.patch @@ -0,0 +1,22 @@ +Description: CVE-2016-0787: Truncated Difffie-Hellman secret length + Convert bytes to bits in diffie_hellman_sha1. Otherwise we get far too + small numbers. +Origin: backport, http://www.libssh2.org/CVE-2016-0787.patch +Forwarded: not-needed +Author: Daniel Stenberg <daniel@haxx.se> +Reviewed-by: Salvatore Bonaccorso <carnil@debian.org> +Last-Update: 2016-02-18 +Applied-Upstream: 1.7.0 +--- + +--- a/src/kex.c ++++ b/src/kex.c +@@ -103,7 +103,7 @@ static int diffie_hellman_sha1(LIBSSH2_S + memset(&exchange_state->req_state, 0, sizeof(packet_require_state_t)); + + /* Generate x and e */ +- _libssh2_bn_rand(exchange_state->x, group_order, 0, -1); ++ _libssh2_bn_rand(exchange_state->x, group_order * 8 - 1, 0, -1); + _libssh2_bn_mod_exp(exchange_state->e, g, exchange_state->x, p, + exchange_state->ctx); + diff --git a/libs/libupnpp/Makefile b/libs/libupnpp/Makefile index 8c9071db5..9a7db84a2 100644 --- a/libs/libupnpp/Makefile +++ b/libs/libupnpp/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2014 OpenWrt.org +# Copyright (C) 2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libupnpp -PKG_VERSION:=0.9.0 +PKG_VERSION:=0.14.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads -PKG_MD5SUM:=ff218bbe2df6cf70b73843d951ef838e +PKG_MD5SUM:=1b10905a365fc6277e1d8ced77278666 PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com> PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING @@ -39,14 +39,13 @@ define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/libupnpp $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp-$(PKG_VERSION).so* $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.{so,la} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.la $(1)/usr/lib/ endef define Package/libupnpp/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp-$(PKG_VERSION).so.* $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.so $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.so.* $(1)/usr/lib/ endef $(eval $(call BuildPackage,libupnpp)) diff --git a/libs/libuv/Makefile b/libs/libuv/Makefile index c191c0eaa..95d4cef1e 100644 --- a/libs/libuv/Makefile +++ b/libs/libuv/Makefile @@ -16,7 +16,7 @@ PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org> PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://dist.libuv.org/dist/v$(PKG_VERSION)/ +PKG_SOURCE_URL:=https://dist.libuv.org/dist/v$(PKG_VERSION)/ PKG_MD5SUM:=654bf6783ac7fc10435c84ec86720a6e PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION) diff --git a/libs/libxslt/Makefile b/libs/libxslt/Makefile index df80b65b0..2d867c182 100644 --- a/libs/libxslt/Makefile +++ b/libs/libxslt/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2014 OpenWrt.org +# Copyright (C) 2014 - 2018 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libxslt PKG_VERSION:=1.1.28 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:= \ @@ -20,7 +20,7 @@ PKG_MD5SUM:=9667bf6f9310b957254fdcf6596600b7 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING -PKG_MAINTAINER:=Jiri Slachta <slachta@cesnet.cz> +PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu> PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -43,7 +43,7 @@ define Package/libexslt SECTION:=libs CATEGORY:=Libraries DEPENDS:=+libxslt - TITLE:=Gnome XSLT library Extention + TITLE:=Gnome XSLT library Extension URL:=http://xmlsoft.org/XSLT/EXSLT/ endef @@ -64,6 +64,7 @@ define Package/xsltproc/description endef CONFIGURE_ARGS+= \ + --disable-silent-rules \ --enable-shared \ --enable-static \ --without-python \ diff --git a/libs/libxslt/patches/0005-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch b/libs/libxslt/patches/0005-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch new file mode 100644 index 000000000..231338835 --- /dev/null +++ b/libs/libxslt/patches/0005-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch @@ -0,0 +1,48 @@ +From: Daniel Veillard <veillard@redhat.com> +Date: Wed, 30 Jan 2013 16:31:37 +0000 +Subject: Fix a couple of places where (f)printf parameters were broken + +As reported by Thomas Jarosch <thomas.jarosch@intra2net.com> +--- + python/libxslt.c | 10 +++++----- + xsltproc/xsltproc.c | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/python/libxslt.c b/python/libxslt.c +index 6a4f1c3..8dd6c78 100644 +--- a/python/libxslt.c ++++ b/python/libxslt.c +@@ -356,15 +356,15 @@ libxslt_xsltRegisterExtModuleElement(PyObject *self ATTRIBUTE_UNUSED, + PyObject *pyobj_element_f; + PyObject *pyobj_precomp_f; + +-#ifdef DEBUG_EXTENSIONS +- printf("libxslt_xsltRegisterExtModuleElement called\n", +- name, ns_uri); +-#endif +- + if (!PyArg_ParseTuple(args, (char *)"szOO:registerExtModuleElement", + &name, &ns_uri, &pyobj_precomp_f, &pyobj_element_f)) + return(NULL); + ++#ifdef DEBUG_EXTENSIONS ++ printf("libxslt_xsltRegisterExtModuleElement called: %s %s\n", ++ name, ns_uri); ++#endif ++ + if ((name == NULL) || (pyobj_element_f == NULL) || (pyobj_precomp_f == NULL)) { + py_retval = libxml_intWrap(-1); + return(py_retval); +diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c +index 9ec4b76..33beddf 100644 +--- a/xsltproc/xsltproc.c ++++ b/xsltproc/xsltproc.c +@@ -319,7 +319,7 @@ static void endTimer(char *format, ...) + va_start(ap, format); + vfprintf(stderr,format,ap); + va_end(ap); +- fprintf(stderr, " was not timed\n", msec); ++ fprintf(stderr, " was not timed\n"); + #else + /* We don't have gettimeofday, time or stdarg.h, what crazy world is + * this ?! diff --git a/libs/libxslt/patches/0006-Initialize-pseudo-random-number-generator-with-curre.patch b/libs/libxslt/patches/0006-Initialize-pseudo-random-number-generator-with-curre.patch new file mode 100644 index 000000000..2d38ba23a --- /dev/null +++ b/libs/libxslt/patches/0006-Initialize-pseudo-random-number-generator-with-curre.patch @@ -0,0 +1,56 @@ +From: Nils Werner <wernerns@iis.fraunhofer.de> +Date: Thu, 24 Jan 2013 18:44:03 +0000 +Subject: Initialize pseudo random number generator with current time or + optional command line parameter + +--- + xsltproc/xsltproc.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c +index 33beddf..7d1fe61 100644 +--- a/xsltproc/xsltproc.c ++++ b/xsltproc/xsltproc.c +@@ -514,6 +514,7 @@ static void usage(const char *name) { + printf("\t--maxdepth val : increase the maximum depth (default %d)\n", xsltMaxDepth); + printf("\t--maxvars val : increase the maximum variables (default %d)\n", xsltMaxVars); + printf("\t--maxparserdepth val : increase the maximum parser depth\n"); ++ printf("\t--seed-rand val : initialize pseudo random number generator with specific seed\n"); + #ifdef LIBXML_HTML_ENABLED + printf("\t--html: the input document is(are) an HTML file(s)\n"); + #endif +@@ -556,6 +557,7 @@ main(int argc, char **argv) + return (1); + } + ++ srand(time(NULL)); + xmlInitMemory(); + + LIBXML_TEST_VERSION +@@ -750,6 +752,15 @@ main(int argc, char **argv) + if (value > 0) + xmlParserMaxDepth = value; + } ++ } else if ((!strcmp(argv[i], "-seed-rand")) || ++ (!strcmp(argv[i], "--seed-rand"))) { ++ int value; ++ ++ i++; ++ if (sscanf(argv[i], "%d", &value) == 1) { ++ if (value > 0) ++ srand(value); ++ } + } else if ((!strcmp(argv[i],"-dumpextensions"))|| + (!strcmp(argv[i],"--dumpextensions"))) { + dumpextensions++; +@@ -786,6 +797,10 @@ main(int argc, char **argv) + (!strcmp(argv[i], "--maxparserdepth"))) { + i++; + continue; ++ } else if ((!strcmp(argv[i], "-seed-rand")) || ++ (!strcmp(argv[i], "--seed-rand"))) { ++ i++; ++ continue; + } else if ((!strcmp(argv[i], "-o")) || + (!strcmp(argv[i], "-output")) || + (!strcmp(argv[i], "--output"))) { diff --git a/libs/libxslt/patches/0007-EXSLT-function-str-replace-is-broken-as-is.patch b/libs/libxslt/patches/0007-EXSLT-function-str-replace-is-broken-as-is.patch new file mode 100644 index 000000000..6bb238d3a --- /dev/null +++ b/libs/libxslt/patches/0007-EXSLT-function-str-replace-is-broken-as-is.patch @@ -0,0 +1,38 @@ +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Mon, 1 Jul 2013 13:10:10 +0000 +Subject: EXSLT function str:replace() is broken as-is + +the str:replace() function is no longer usable without a transform +context. I take it from the bug report that it is not supposed to be used +from plain XPath but only from XSLT according to the EXSLT specification. + +However, the previous implementation used to work in XPath and is still +registered on an xmlXPathContext by the exsltStrXpathCtxtRegister() +function. When called from plain XPath, it results in a memory error in +line 526 (exsltStrReturnString()) of strings.c because xsltCreateRVT() +returns NULL as an error indicator due to a NULL transform context being +passed in, which was the return value from xsltXPathGetTransformContext() a +bit further up (and the code doesn't validate that). + +Since fixing the function looks impossible, best is to remove it. +--- + libexslt/strings.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/libexslt/strings.c b/libexslt/strings.c +index 045cc14..c0c7a18 100644 +--- a/libexslt/strings.c ++++ b/libexslt/strings.c +@@ -838,11 +838,7 @@ exsltStrXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix) + && !xmlXPathRegisterFuncNS(ctxt, + (const xmlChar *) "concat", + (const xmlChar *) EXSLT_STRINGS_NAMESPACE, +- exsltStrConcatFunction) +- && !xmlXPathRegisterFuncNS(ctxt, +- (const xmlChar *) "replace", +- (const xmlChar *) EXSLT_STRINGS_NAMESPACE, +- exsltStrReplaceFunction)) { ++ exsltStrConcatFunction)) { + return 0; + } + return -1; diff --git a/libs/libxslt/patches/0008-Fix-quoting-of-xlocale-test-program-in-configure.in.patch b/libs/libxslt/patches/0008-Fix-quoting-of-xlocale-test-program-in-configure.in.patch new file mode 100644 index 000000000..f6ba74cb6 --- /dev/null +++ b/libs/libxslt/patches/0008-Fix-quoting-of-xlocale-test-program-in-configure.in.patch @@ -0,0 +1,43 @@ +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Tue, 30 Jul 2013 11:57:28 +0000 +Subject: Fix quoting of xlocale test program in configure.in + +Double square brackets aren't needed anymore, probably due to the +changes in commit a2cd8a03. +--- + configure.in | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/configure.in b/configure.in +index 767e980..ac004fe 100644 +--- a/configure.in ++++ b/configure.in +@@ -196,21 +196,21 @@ typedef locale_t xsltLocale; + #endif + ]],[[ + xsltLocale locale; +- const char *src[[2]] = { "\xc3\x84rger", "Zeppelin" }; +- char *dst[[2]]; ++ const char *src[2] = { "\xc3\x84rger", "Zeppelin" }; ++ char *dst[2]; + size_t len, r; + int i; + + locale = newlocale(LC_COLLATE_MASK, "en_US.utf8", NULL); + if (locale == NULL) exit(1); + for (i=0; i<2; ++i) { +- len = strxfrm_l(NULL, src[[i]], 0, locale) + 1; +- dst[[i]] = malloc(len); +- if(dst[[i]] == NULL) exit(1); +- r = strxfrm_l(dst[[i]], src[[i]], len, locale); ++ len = strxfrm_l(NULL, src[i], 0, locale) + 1; ++ dst[i] = malloc(len); ++ if(dst[i] == NULL) exit(1); ++ r = strxfrm_l(dst[i], src[i], len, locale); + if(r >= len) exit(1); + } +- if (strcmp(dst[[0]], dst[[1]]) >= 0) exit(1); ++ if (strcmp(dst[0], dst[1]) >= 0) exit(1); + + exit(0); + return(0); diff --git a/libs/libxslt/patches/0009-Fix-for-type-confusion-in-preprocessing-attributes.patch b/libs/libxslt/patches/0009-Fix-for-type-confusion-in-preprocessing-attributes.patch new file mode 100644 index 000000000..9f2d7ac3f --- /dev/null +++ b/libs/libxslt/patches/0009-Fix-for-type-confusion-in-preprocessing-attributes.patch @@ -0,0 +1,29 @@ +From 7ca19df892ca22d9314e95d59ce2abdeff46b617 Mon Sep 17 00:00:00 2001 +From: Daniel Veillard <veillard@redhat.com> +Date: Thu, 29 Oct 2015 19:33:23 +0800 +Subject: [PATCH] Fix for type confusion in preprocessing attributes + +CVE-2015-7995 http://www.openwall.com/lists/oss-security/2015/10/27/10 +We need to check that the parent node is an element before dereferencing +its namespace +--- + libxslt/preproc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libxslt/preproc.c b/libxslt/preproc.c +index 0eb80a0..7f69325 100644 +--- a/libxslt/preproc.c ++++ b/libxslt/preproc.c +@@ -2249,7 +2249,8 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) { + } else if (IS_XSLT_NAME(inst, "attribute")) { + xmlNodePtr parent = inst->parent; + +- if ((parent == NULL) || (parent->ns == NULL) || ++ if ((parent == NULL) || ++ (parent->type != XML_ELEMENT_NODE) || (parent->ns == NULL) || + ((parent->ns != inst->ns) && + (!xmlStrEqual(parent->ns->href, inst->ns->href))) || + (!xmlStrEqual(parent->name, BAD_CAST "attribute-set"))) { +-- +2.8.1 + diff --git a/libs/libxslt/patches/0010-Always-initialize-EXSLT-month-and-day-to-1.patch b/libs/libxslt/patches/0010-Always-initialize-EXSLT-month-and-day-to-1.patch new file mode 100644 index 000000000..183cabb52 --- /dev/null +++ b/libs/libxslt/patches/0010-Always-initialize-EXSLT-month-and-day-to-1.patch @@ -0,0 +1,62 @@ +From 3309feb654036280d2355f8025150a69bfded6e2 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Sun, 3 Jan 2016 16:45:24 +0100 +Subject: [PATCH] Always initialize EXSLT month and day to 1 + +Fixes bug #757970 +https://bugzilla.gnome.org/show_bug.cgi?id=757970 +--- + libexslt/date.c | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +diff --git a/libexslt/date.c b/libexslt/date.c +index 9ca993c..272c61b 100644 +--- a/libexslt/date.c ++++ b/libexslt/date.c +@@ -667,6 +667,11 @@ exsltDateCreateDate (exsltDateType type) + } + memset (ret, 0, sizeof(exsltDateVal)); + ++ if (type != XS_DURATION) { ++ ret->value.date.mon = 1; ++ ret->value.date.day = 1; ++ } ++ + if (type != EXSLT_UNKNOWN) + ret->type = type; + +@@ -1395,10 +1400,10 @@ _exsltDateTruncateDate (exsltDateValPtr dt, exsltDateType type) + } + + if ((type & XS_GDAY) != XS_GDAY) +- dt->value.date.day = 0; ++ dt->value.date.day = 1; + + if ((type & XS_GMONTH) != XS_GMONTH) +- dt->value.date.mon = 0; ++ dt->value.date.mon = 1; + + if ((type & XS_GYEAR) != XS_GYEAR) + dt->value.date.year = 0; +@@ -1473,18 +1478,10 @@ _exsltDateAdd (exsltDateValPtr dt, exsltDateValPtr dur) + d = &(dt->value.date); + u = &(dur->value.dur); + +- /* normalization */ +- if (d->mon == 0) +- d->mon = 1; +- + /* normalize for time zone offset */ + u->sec -= (d->tzo * 60); /* changed from + to - (bug 153000) */ + d->tzo = 0; + +- /* normalization */ +- if (d->day == 0) +- d->day = 1; +- + /* month */ + carry = d->mon + u->mon; + r->mon = (unsigned int)MODULO_RANGE(carry, 1, 13); +-- +2.8.1 + diff --git a/libs/libxslt/patches/0011-Fix-use-after-free-in-xsltDocumentFunctionLoadDocume.patch b/libs/libxslt/patches/0011-Fix-use-after-free-in-xsltDocumentFunctionLoadDocume.patch new file mode 100644 index 000000000..aec622fb0 --- /dev/null +++ b/libs/libxslt/patches/0011-Fix-use-after-free-in-xsltDocumentFunctionLoadDocume.patch @@ -0,0 +1,105 @@ +From fc1ff481fd01e9a65a921c542fed68d8c965e8a3 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Thu, 25 Feb 2016 17:16:06 +0100 +Subject: [PATCH] Fix use-after-free in xsltDocumentFunctionLoadDocument + +Also fixes a memory leak in an unlikely error case. + +Fixes bug #758291 +https://bugzilla.gnome.org/show_bug.cgi?id=758291 +--- + libxslt/functions.c | 3 ++- + tests/docs/bug-185-data.xml | 5 +++++ + tests/docs/bug-185.xml | 2 ++ + tests/general/bug-185.err | 3 +++ + tests/general/bug-185.out | 0 + tests/general/bug-185.xsl | 14 ++++++++++++++ + 6 files changed, 26 insertions(+), 1 deletion(-) + create mode 100644 tests/docs/bug-185-data.xml + create mode 100644 tests/docs/bug-185.xml + create mode 100644 tests/general/bug-185.err + create mode 100644 tests/general/bug-185.out + create mode 100644 tests/general/bug-185.xsl + +diff --git a/libxslt/functions.c b/libxslt/functions.c +index 549649c..a5e7021 100644 +--- a/libxslt/functions.c ++++ b/libxslt/functions.c +@@ -180,7 +180,6 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI) + resObj = xmlXPtrEval(fragment, xptrctxt); + xmlXPathFreeContext(xptrctxt); + #endif +- xmlFree(fragment); + + if (resObj == NULL) + goto out_fragment; +@@ -204,6 +203,7 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI) + } + + valuePush(ctxt, resObj); ++ xmlFree(fragment); + return; + + out_object: +@@ -211,6 +211,7 @@ out_object: + + out_fragment: + valuePush(ctxt, xmlXPathNewNodeSet(NULL)); ++ xmlFree(fragment); + } + + /** +diff --git a/tests/docs/bug-185-data.xml b/tests/docs/bug-185-data.xml +new file mode 100644 +index 0000000..166ef17 +--- /dev/null ++++ b/tests/docs/bug-185-data.xml +@@ -0,0 +1,5 @@ ++<!DOCTYPE test [ <!ATTLIST A id ID #REQUIRED> ] > ++<test> ++ <A id="X"/> ++ <A id="Y"/> ++</test> +diff --git a/tests/docs/bug-185.xml b/tests/docs/bug-185.xml +new file mode 100644 +index 0000000..72bfdc4 +--- /dev/null ++++ b/tests/docs/bug-185.xml +@@ -0,0 +1,2 @@ ++<?xml-stylesheet href="poc.xsl" type="text/xsl"?> ++<in>bug-185-data.xml#xpointer(id('X')/range-to(id('Y')))</in> +diff --git a/tests/general/bug-185.err b/tests/general/bug-185.err +new file mode 100644 +index 0000000..d7bbe92 +--- /dev/null ++++ b/tests/general/bug-185.err +@@ -0,0 +1,3 @@ ++runtime error: file ./bug-185.xsl line 7 element copy-of ++document() : XPointer does not select a node set: #xpointer(id('X')/range-to(id('Y'))) ++no result for ./../docs/bug-185.xml +diff --git a/tests/general/bug-185.out b/tests/general/bug-185.out +new file mode 100644 +index 0000000..e69de29 +diff --git a/tests/general/bug-185.xsl b/tests/general/bug-185.xsl +new file mode 100644 +index 0000000..1c5c7d1 +--- /dev/null ++++ b/tests/general/bug-185.xsl +@@ -0,0 +1,14 @@ ++<?xml version="1.0" encoding="utf-8"?> ++<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> ++ <xsl:template match="in"> ++ <annotation> ++ <xsl:copy-of select="."/> ++ <value> ++ <xsl:copy-of select="document(.)"/> ++ </value> ++ </annotation> ++ </xsl:template> ++ <xsl:template match="@*|node()"> ++ <xsl:apply-templates/> ++ </xsl:template> ++</xsl:stylesheet> +-- +2.8.1 + diff --git a/libs/libxslt/patches/0012-Fix-xsltNumberFormatGetMultipleLevel.patch b/libs/libxslt/patches/0012-Fix-xsltNumberFormatGetMultipleLevel.patch new file mode 100644 index 000000000..871fcfbc3 --- /dev/null +++ b/libs/libxslt/patches/0012-Fix-xsltNumberFormatGetMultipleLevel.patch @@ -0,0 +1,171 @@ +From d182d8f6ba3071503d96ce17395c9d55871f0242 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Tue, 22 Mar 2016 18:20:01 +0100 +Subject: [PATCH] Fix xsltNumberFormatGetMultipleLevel + +Namespace nodes are actually an xmlNs, not an xmlNode. They must be +special-cased in xsltNumberFormatGetMultipleLevel to avoid an +out-of-bounds heap access. + +Move the test whether a node matches the "count" pattern to a separate +function to make the code more readable. As a side effect, we also +compare expanded names when walking up the ancestor axis, fixing an +insignificant bug. +--- + libxslt/numbers.c | 82 +++++++++++++++++++++++++++-------------------- + tests/docs/bug-186.xml | 4 +++ + tests/general/bug-186.out | 5 +++ + tests/general/bug-186.xsl | 7 ++++ + 4 files changed, 63 insertions(+), 35 deletions(-) + create mode 100644 tests/docs/bug-186.xml + create mode 100644 tests/general/bug-186.out + create mode 100644 tests/general/bug-186.xsl + +diff --git a/libxslt/numbers.c b/libxslt/numbers.c +index e3209e0..184ee6f 100644 +--- a/libxslt/numbers.c ++++ b/libxslt/numbers.c +@@ -532,6 +532,43 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data, + } + + static int ++xsltTestCompMatchCount(xsltTransformContextPtr context, ++ xmlNodePtr node, ++ xsltCompMatchPtr countPat, ++ xmlNodePtr cur) ++{ ++ if (countPat != NULL) { ++ return xsltTestCompMatchList(context, node, countPat); ++ } ++ else { ++ /* ++ * 7.7 Numbering ++ * ++ * If count attribute is not specified, then it defaults to the ++ * pattern that matches any node with the same node type as the ++ * current node and, if the current node has an expanded-name, with ++ * the same expanded-name as the current node. ++ */ ++ if (node->type != cur->type) ++ return 0; ++ if (node->type == XML_NAMESPACE_DECL) ++ /* ++ * Namespace nodes have no preceding siblings and no parents ++ * that are namespace nodes. This means that node == cur. ++ */ ++ return 1; ++ /* TODO: Skip node types without expanded names like text nodes. */ ++ if (!xmlStrEqual(node->name, cur->name)) ++ return 0; ++ if (node->ns == cur->ns) ++ return 1; ++ if ((node->ns == NULL) || (cur->ns == NULL)) ++ return 0; ++ return (xmlStrEqual(node->ns->href, cur->ns->href)); ++ } ++} ++ ++static int + xsltNumberFormatGetAnyLevel(xsltTransformContextPtr context, + xmlNodePtr node, + xsltCompMatchPtr countPat, +@@ -562,21 +599,8 @@ xsltNumberFormatGetAnyLevel(xsltTransformContextPtr context, + + while (cur != NULL) { + /* process current node */ +- if (countPat == NULL) { +- if ((node->type == cur->type) && +- /* FIXME: must use expanded-name instead of local name */ +- xmlStrEqual(node->name, cur->name)) { +- if ((node->ns == cur->ns) || +- ((node->ns != NULL) && +- (cur->ns != NULL) && +- (xmlStrEqual(node->ns->href, +- cur->ns->href) ))) +- cnt++; +- } +- } else { +- if (xsltTestCompMatchList(context, cur, countPat)) +- cnt++; +- } ++ if (xsltTestCompMatchCount(context, cur, countPat, node)) ++ cnt++; + if ((fromPat != NULL) && + xsltTestCompMatchList(context, cur, fromPat)) { + break; /* while */ +@@ -633,30 +657,18 @@ xsltNumberFormatGetMultipleLevel(xsltTransformContextPtr context, + xsltTestCompMatchList(context, ancestor, fromPat)) + break; /* for */ + +- if ((countPat == NULL && node->type == ancestor->type && +- xmlStrEqual(node->name, ancestor->name)) || +- xsltTestCompMatchList(context, ancestor, countPat)) { ++ if (xsltTestCompMatchCount(context, ancestor, countPat, node)) { + /* count(preceding-sibling::*) */ +- cnt = 0; +- for (preceding = ancestor; ++ cnt = 1; ++ for (preceding = ++ xmlXPathNextPrecedingSibling(parser, ancestor); + preceding != NULL; + preceding = + xmlXPathNextPrecedingSibling(parser, preceding)) { +- if (countPat == NULL) { +- if ((preceding->type == ancestor->type) && +- xmlStrEqual(preceding->name, ancestor->name)){ +- if ((preceding->ns == ancestor->ns) || +- ((preceding->ns != NULL) && +- (ancestor->ns != NULL) && +- (xmlStrEqual(preceding->ns->href, +- ancestor->ns->href) ))) +- cnt++; +- } +- } else { +- if (xsltTestCompMatchList(context, preceding, +- countPat)) +- cnt++; +- } ++ ++ if (xsltTestCompMatchCount(context, preceding, countPat, ++ node)) ++ cnt++; + } + array[amount++] = (double)cnt; + if (amount >= max) +diff --git a/tests/docs/bug-186.xml b/tests/docs/bug-186.xml +new file mode 100644 +index 0000000..424db6b +--- /dev/null ++++ b/tests/docs/bug-186.xml +@@ -0,0 +1,4 @@ ++<top xmlns:a="AAAA" xmlns:b="BBBB" xmlns:c="CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"> ++<foo/> ++<bar/> ++</top> +diff --git a/tests/general/bug-186.out b/tests/general/bug-186.out +new file mode 100644 +index 0000000..01a59f8 +--- /dev/null ++++ b/tests/general/bug-186.out +@@ -0,0 +1,5 @@ ++<?xml version="1.0"?> ++ ++1111 ++1111 ++ +diff --git a/tests/general/bug-186.xsl b/tests/general/bug-186.xsl +new file mode 100644 +index 0000000..9c491dd +--- /dev/null ++++ b/tests/general/bug-186.xsl +@@ -0,0 +1,7 @@ ++<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> ++ <xsl:template match="*/*"> ++ <xsl:for-each select="namespace::*"> ++ <xsl:number/> ++ </xsl:for-each> ++ </xsl:template> ++</xsl:stylesheet> +-- +2.8.1 + diff --git a/libs/libxslt/patches/0013-Round-xsl-number-values-to-nearest-integer.patch b/libs/libxslt/patches/0013-Round-xsl-number-values-to-nearest-integer.patch new file mode 100644 index 000000000..bed1b04ee --- /dev/null +++ b/libs/libxslt/patches/0013-Round-xsl-number-values-to-nearest-integer.patch @@ -0,0 +1,26 @@ +From 345e0bfb1c1131155a32dfbdfc8f78d1c602dc40 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Sun, 10 Apr 2016 12:50:02 +0200 +Subject: [PATCH] Round xsl:number values to nearest integer + +This matches XSLT 2.0 behavior. +--- + libxslt/numbers.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libxslt/numbers.c b/libxslt/numbers.c +index 184ee6f..eb087bc 100644 +--- a/libxslt/numbers.c ++++ b/libxslt/numbers.c +@@ -440,6 +440,8 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data, + for (i = 0; i < numbers_max; i++) { + /* Insert number */ + number = numbers[(numbers_max - 1) - i]; ++ /* Round to nearest like XSLT 2.0 */ ++ number = floor(number + 0.5); + if (i < tokens->nTokens) { + /* + * The "n"th format token will be used to format the "n"th +-- +2.8.1 + diff --git a/libs/libxslt/patches/0014-Handle-negative-xsl-number-values.patch b/libs/libxslt/patches/0014-Handle-negative-xsl-number-values.patch new file mode 100644 index 000000000..d5b54f4a5 --- /dev/null +++ b/libs/libxslt/patches/0014-Handle-negative-xsl-number-values.patch @@ -0,0 +1,51 @@ +From 69ec3da1b653024aca6515ddd4adc91919dd188e Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Sun, 10 Apr 2016 12:51:57 +0200 +Subject: [PATCH] Handle negative xsl:number values + +According to XSLT 2.0, negative values are a non-recoverable dynamic error. +Print an error message and treat negative values as zero. + +Fixes an OOB array access in xsltNumberFormatAlpha. +--- + libxslt/numbers.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/libxslt/numbers.c b/libxslt/numbers.c +index eb087bc..a3cabcf 100644 +--- a/libxslt/numbers.c ++++ b/libxslt/numbers.c +@@ -246,7 +246,7 @@ xsltNumberFormatAlpha(xmlBufferPtr buffer, + number--; + *(--pointer) = alpha_list[((int)fmod(number, alpha_size))]; + number /= alpha_size; +- if (fabs(number) < 1.0) ++ if (number < 1.0) + break; /* for */ + } + xmlBufferCCat(buffer, pointer); +@@ -442,6 +442,21 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data, + number = numbers[(numbers_max - 1) - i]; + /* Round to nearest like XSLT 2.0 */ + number = floor(number + 0.5); ++ /* ++ * XSLT 1.0 isn't clear on how to handle negative numbers, but XSLT ++ * 2.0 says: ++ * ++ * It is a non-recoverable dynamic error if any undiscarded item ++ * in the atomized sequence supplied as the value of the value ++ * attribute of xsl:number cannot be converted to an integer, or ++ * if the resulting integer is less than 0 (zero). ++ */ ++ if (number < 0.0) { ++ xsltTransformError(NULL, NULL, NULL, ++ "xsl-number : negative value\n"); ++ /* Recover by treating negative values as zero. */ ++ number = 0.0; ++ } + if (i < tokens->nTokens) { + /* + * The "n"th format token will be used to format the "n"th +-- +2.8.1 + diff --git a/libs/libxslt/patches/0015-Lower-bound-for-format-token-a.patch b/libs/libxslt/patches/0015-Lower-bound-for-format-token-a.patch new file mode 100644 index 000000000..e5149a9cc --- /dev/null +++ b/libs/libxslt/patches/0015-Lower-bound-for-format-token-a.patch @@ -0,0 +1,75 @@ +From 405034286fbdd6166229335b7203a41bf53b40fc Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Sun, 10 Apr 2016 13:11:31 +0200 +Subject: [PATCH] Lower bound for format token "a" + +Handle xsl:number with format "a" and value 0 according to XSLT 2.0. + +Fixes an OOB array access in xsltNumberFormatAlpha. +--- + libxslt/numbers.c | 33 ++++++++++++++++++++++++--------- + 1 file changed, 24 insertions(+), 9 deletions(-) + +diff --git a/libxslt/numbers.c b/libxslt/numbers.c +index a3cabcf..af52883 100644 +--- a/libxslt/numbers.c ++++ b/libxslt/numbers.c +@@ -227,7 +227,8 @@ xsltNumberFormatDecimal(xmlBufferPtr buffer, + } + + static void +-xsltNumberFormatAlpha(xmlBufferPtr buffer, ++xsltNumberFormatAlpha(xsltNumberDataPtr data, ++ xmlBufferPtr buffer, + double number, + int is_upper) + { +@@ -237,6 +238,26 @@ xsltNumberFormatAlpha(xmlBufferPtr buffer, + char *alpha_list; + double alpha_size = (double)(sizeof(alpha_upper_list) - 1); + ++ /* ++ * XSLT 1.0 isn't clear on how to handle zero, but XSLT 2.0 says: ++ * ++ * For all format tokens other than the first kind above (one that ++ * consists of decimal digits), there may be implementation-defined ++ * lower and upper bounds on the range of numbers that can be ++ * formatted using this format token; indeed, for some numbering ++ * sequences there may be intrinsic limits. [...] Numbers that fall ++ * outside this range must be formatted using the format token 1. ++ * ++ * The "a" token has an intrinsic lower limit of 1. ++ */ ++ if (number < 1.0) { ++ xsltNumberFormatDecimal(buffer, number, '0', 1, ++ data->digitsPerGroup, ++ data->groupingCharacter, ++ data->groupingCharacterLen); ++ return; ++ } ++ + /* Build buffer from back */ + pointer = &temp_string[sizeof(temp_string)]; + *(--pointer) = 0; +@@ -500,16 +521,10 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data, + + switch (token->token) { + case 'A': +- xsltNumberFormatAlpha(buffer, +- number, +- TRUE); +- ++ xsltNumberFormatAlpha(data, buffer, number, TRUE); + break; + case 'a': +- xsltNumberFormatAlpha(buffer, +- number, +- FALSE); +- ++ xsltNumberFormatAlpha(data, buffer, number, FALSE); + break; + case 'I': + xsltNumberFormatRoman(buffer, +-- +2.8.1 + diff --git a/libs/libxslt/patches/0016-Lower-and-upper-bound-for-format-token-i.patch b/libs/libxslt/patches/0016-Lower-and-upper-bound-for-format-token-i.patch new file mode 100644 index 000000000..d000c45cd --- /dev/null +++ b/libs/libxslt/patches/0016-Lower-and-upper-bound-for-format-token-i.patch @@ -0,0 +1,64 @@ +From 91d0540ac9beaa86719a05b749219a69baa0dd8d Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Sun, 10 Apr 2016 13:12:28 +0200 +Subject: [PATCH] Lower and upper bound for format token "i" + +Handle xsl:number with format "i" and value 0 according to XSLT 2.0. + +Also introduce an upper bound to fix a denial of service. +--- + libxslt/numbers.c | 25 ++++++++++++++++--------- + 1 file changed, 16 insertions(+), 9 deletions(-) + +diff --git a/libxslt/numbers.c b/libxslt/numbers.c +index af52883..e769c42 100644 +--- a/libxslt/numbers.c ++++ b/libxslt/numbers.c +@@ -274,11 +274,24 @@ xsltNumberFormatAlpha(xsltNumberDataPtr data, + } + + static void +-xsltNumberFormatRoman(xmlBufferPtr buffer, ++xsltNumberFormatRoman(xsltNumberDataPtr data, ++ xmlBufferPtr buffer, + double number, + int is_upper) + { + /* ++ * See discussion in xsltNumberFormatAlpha. Also use a reasonable upper ++ * bound to avoid denial of service. ++ */ ++ if (number < 1.0 || number > 5000.0) { ++ xsltNumberFormatDecimal(buffer, number, '0', 1, ++ data->digitsPerGroup, ++ data->groupingCharacter, ++ data->groupingCharacterLen); ++ return; ++ } ++ ++ /* + * Based on an example by Jim Walsh + */ + while (number >= 1000.0) { +@@ -527,16 +540,10 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data, + xsltNumberFormatAlpha(data, buffer, number, FALSE); + break; + case 'I': +- xsltNumberFormatRoman(buffer, +- number, +- TRUE); +- ++ xsltNumberFormatRoman(data, buffer, number, TRUE); + break; + case 'i': +- xsltNumberFormatRoman(buffer, +- number, +- FALSE); +- ++ xsltNumberFormatRoman(data, buffer, number, FALSE); + break; + default: + if (IS_DIGIT_ZERO(token->token)) { +-- +2.8.1 + diff --git a/libs/libxslt/patches/0017-Fix-double-free-in-libexslt-hash-functions.patch b/libs/libxslt/patches/0017-Fix-double-free-in-libexslt-hash-functions.patch new file mode 100644 index 000000000..eafdee169 --- /dev/null +++ b/libs/libxslt/patches/0017-Fix-double-free-in-libexslt-hash-functions.patch @@ -0,0 +1,62 @@ +From d8862309f08054218b28e2c8f5fb3cb2f650cac7 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Wed, 20 Apr 2016 14:35:43 +0200 +Subject: [PATCH] Fix double free in libexslt hash functions + +Thanks to Nicolas Gregoire for the report. + +Fixes bug #765271: + +https://bugzilla.gnome.org/show_bug.cgi?id=765271 +--- + libexslt/crypto.c | 15 +++------------ + tests/exslt/crypto/hash.1.out | 2 ++ + tests/exslt/crypto/hash.1.xml | 5 +++++ + 3 files changed, 10 insertions(+), 12 deletions(-) + +diff --git a/libexslt/crypto.c b/libexslt/crypto.c +index 6aa9dd2..e13db8b 100644 +--- a/libexslt/crypto.c ++++ b/libexslt/crypto.c +@@ -499,11 +499,8 @@ exsltCryptoMd4Function (xmlXPathParserContextPtr ctxt, int nargs) { + unsigned char hex[MD5_DIGEST_LENGTH * 2 + 1]; + + str_len = exsltCryptoPopString (ctxt, nargs, &str); +- if (str_len == 0) { +- xmlXPathReturnEmptyString (ctxt); +- xmlFree (str); ++ if (str_len == 0) + return; +- } + + PLATFORM_HASH (ctxt, PLATFORM_MD4, (const char *) str, str_len, + (char *) hash); +@@ -532,11 +529,8 @@ exsltCryptoMd5Function (xmlXPathParserContextPtr ctxt, int nargs) { + unsigned char hex[MD5_DIGEST_LENGTH * 2 + 1]; + + str_len = exsltCryptoPopString (ctxt, nargs, &str); +- if (str_len == 0) { +- xmlXPathReturnEmptyString (ctxt); +- xmlFree (str); ++ if (str_len == 0) + return; +- } + + PLATFORM_HASH (ctxt, PLATFORM_MD5, (const char *) str, str_len, + (char *) hash); +@@ -565,11 +559,8 @@ exsltCryptoSha1Function (xmlXPathParserContextPtr ctxt, int nargs) { + unsigned char hex[SHA1_DIGEST_LENGTH * 2 + 1]; + + str_len = exsltCryptoPopString (ctxt, nargs, &str); +- if (str_len == 0) { +- xmlXPathReturnEmptyString (ctxt); +- xmlFree (str); ++ if (str_len == 0) + return; +- } + + PLATFORM_HASH (ctxt, PLATFORM_SHA1, (const char *) str, str_len, + (char *) hash); +-- +2.8.1 + diff --git a/libs/libxslt/patches/0018-Fix-buffer-overflow-in-exsltDateFormat.patch b/libs/libxslt/patches/0018-Fix-buffer-overflow-in-exsltDateFormat.patch new file mode 100644 index 000000000..3125c3328 --- /dev/null +++ b/libs/libxslt/patches/0018-Fix-buffer-overflow-in-exsltDateFormat.patch @@ -0,0 +1,33 @@ +From 5d0c6565bab5b9b7efceb33b626916d22b4101a7 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Thu, 28 Apr 2016 17:34:27 +0200 +Subject: [PATCH] Fix buffer overflow in exsltDateFormat + +Long years can overflow a stack-based buffer on 64-bit platforms by +up to four bytes. + +Thanks to Nicolas Gregoire for the report. + +Fixes bug #765380: + +https://bugzilla.gnome.org/show_bug.cgi?id=765380 +--- + libexslt/date.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libexslt/date.c b/libexslt/date.c +index 272c61b..12c9919 100644 +--- a/libexslt/date.c ++++ b/libexslt/date.c +@@ -1283,7 +1283,7 @@ exsltDateFormat (const exsltDateValPtr dt) + } + + if (dt->type & XS_GYEAR) { +- xmlChar buf[20], *cur = buf; ++ xmlChar buf[100], *cur = buf; + + FORMAT_GYEAR(dt->value.date.year, cur); + if (dt->type == XS_GYEARMONTH) { +-- +2.8.1 + diff --git a/libs/libxslt/patches/0019-Fix-OOB-heap-read-in-xsltExtModuleRegisterDynamic.patch b/libs/libxslt/patches/0019-Fix-OOB-heap-read-in-xsltExtModuleRegisterDynamic.patch new file mode 100644 index 000000000..cddc2a68c --- /dev/null +++ b/libs/libxslt/patches/0019-Fix-OOB-heap-read-in-xsltExtModuleRegisterDynamic.patch @@ -0,0 +1,36 @@ +From 87c3d9ea214fc0503fd8130b6dd97431d69cc066 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Thu, 5 May 2016 15:12:48 +0200 +Subject: [PATCH] Fix OOB heap read in xsltExtModuleRegisterDynamic + +xsltExtModuleRegisterDynamic would read a byte before the start of a +string under certain circumstances. I looks like this piece code was +supposed to strip characters from the end of the extension name, but +it didn't have any effect. Don't read beyond the beginning of the +string and actually strip unwanted characters. + +Found with afl-fuzz and ASan. +--- + libxslt/extensions.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/libxslt/extensions.c b/libxslt/extensions.c +index 5ad73cb..ae6eef0 100644 +--- a/libxslt/extensions.c ++++ b/libxslt/extensions.c +@@ -367,8 +367,11 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI) + i++; + } + +- if (*(i - 1) == '_') ++ /* Strip underscores from end of string. */ ++ while (i > ext_name && *(i - 1) == '_') { ++ i--; + *i = '\0'; ++ } + + /* determine module directory */ + ext_directory = (xmlChar *) getenv("LIBXSLT_PLUGINS_PATH"); +-- +2.8.1 + diff --git a/libs/libxslt/patches/0020-Fix-heap-overread-in-xsltFormatNumberConversion.patch b/libs/libxslt/patches/0020-Fix-heap-overread-in-xsltFormatNumberConversion.patch new file mode 100644 index 000000000..60ead1522 --- /dev/null +++ b/libs/libxslt/patches/0020-Fix-heap-overread-in-xsltFormatNumberConversion.patch @@ -0,0 +1,31 @@ +From eb1030de31165b68487f288308f9d1810fed6880 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Fri, 10 Jun 2016 14:23:58 +0200 +Subject: [PATCH] Fix heap overread in xsltFormatNumberConversion + +An empty decimal-separator could cause a heap overread. This can be +exploited to leak a couple of bytes after the buffer that holds the +pattern string. + +Found with afl-fuzz and ASan. +--- + libxslt/numbers.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libxslt/numbers.c b/libxslt/numbers.c +index d1549b4..e78c46b 100644 +--- a/libxslt/numbers.c ++++ b/libxslt/numbers.c +@@ -1090,7 +1090,8 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self, + } + + /* We have finished the integer part, now work on fraction */ +- if (xsltUTF8Charcmp(the_format, self->decimalPoint) == 0) { ++ if ( (*the_format != 0) && ++ (xsltUTF8Charcmp(the_format, self->decimalPoint) == 0) ) { + format_info.add_decimal = TRUE; + the_format += xsltUTF8Size(the_format); /* Skip over the decimal */ + } +-- +2.10.2 + diff --git a/libs/libxslt/patches/0021-Check-for-integer-overflow-in-xsltAddTextString.patch b/libs/libxslt/patches/0021-Check-for-integer-overflow-in-xsltAddTextString.patch new file mode 100644 index 000000000..ea941db4c --- /dev/null +++ b/libs/libxslt/patches/0021-Check-for-integer-overflow-in-xsltAddTextString.patch @@ -0,0 +1,74 @@ +From 08ab2774b870de1c7b5a48693df75e8154addae5 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Thu, 12 Jan 2017 15:39:52 +0100 +Subject: [PATCH] Check for integer overflow in xsltAddTextString + +Limit buffer size in xsltAddTextString to INT_MAX. The issue can be +exploited to trigger an out of bounds write on 64-bit systems. + +Originally reported to Chromium: + +https://crbug.com/676623 +--- + libxslt/transform.c | 25 ++++++++++++++++++++++--- + libxslt/xsltInternals.h | 4 ++-- + 2 files changed, 24 insertions(+), 5 deletions(-) + +diff --git a/libxslt/transform.c b/libxslt/transform.c +index 519133fc..02bff34a 100644 +--- a/libxslt/transform.c ++++ b/libxslt/transform.c +@@ -813,13 +813,32 @@ xsltAddTextString(xsltTransformContextPtr ctxt, xmlNodePtr target, + return(target); + + if (ctxt->lasttext == target->content) { ++ int minSize; + +- if (ctxt->lasttuse + len >= ctxt->lasttsize) { ++ /* Check for integer overflow accounting for NUL terminator. */ ++ if (len >= INT_MAX - ctxt->lasttuse) { ++ xsltTransformError(ctxt, NULL, target, ++ "xsltCopyText: text allocation failed\n"); ++ return(NULL); ++ } ++ minSize = ctxt->lasttuse + len + 1; ++ ++ if (ctxt->lasttsize < minSize) { + xmlChar *newbuf; + int size; ++ int extra; ++ ++ /* Double buffer size but increase by at least 100 bytes. */ ++ extra = minSize < 100 ? 100 : minSize; ++ ++ /* Check for integer overflow. */ ++ if (extra > INT_MAX - ctxt->lasttsize) { ++ size = INT_MAX; ++ } ++ else { ++ size = ctxt->lasttsize + extra; ++ } + +- size = ctxt->lasttsize + len + 100; +- size *= 2; + newbuf = (xmlChar *) xmlRealloc(target->content,size); + if (newbuf == NULL) { + xsltTransformError(ctxt, NULL, target, +diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h +index 060b1783..5ad17719 100644 +--- a/libxslt/xsltInternals.h ++++ b/libxslt/xsltInternals.h +@@ -1754,8 +1754,8 @@ struct _xsltTransformContext { + * Speed optimization when coalescing text nodes + */ + const xmlChar *lasttext; /* last text node content */ +- unsigned int lasttsize; /* last text node size */ +- unsigned int lasttuse; /* last text node use */ ++ int lasttsize; /* last text node size */ ++ int lasttuse; /* last text node use */ + /* + * Per Context Debugging + */ +-- +2.11.0 + diff --git a/libs/mxml/Makefile b/libs/mxml/Makefile index 74cff413b..f7ee46729 100644 --- a/libs/mxml/Makefile +++ b/libs/mxml/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2014 OpenWrt.org +# Copyright (C) 2006-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mxml -PKG_VERSION:=2.8 +PKG_VERSION:=2.10 PKG_RELEASE:=1 -PKG_MD5SUM:=d85ee6d30de053581242c4a86e79a5d2 +PKG_MD5SUM:=8804c961a24500a95690ef287d150abe PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.msweet.org/files/project3/ +PKG_SOURCE_URL:=https://github.com/michaelrsweet/mxml/releases/download/release-$(PKG_VERSION)/ PKG_FIXUP:=autoreconf PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com> diff --git a/libs/neon/Makefile b/libs/neon/Makefile index 4d3bf8cf5..2cbcda42d 100644 --- a/libs/neon/Makefile +++ b/libs/neon/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=neon -PKG_VERSION:=0.30.0 +PKG_VERSION:=0.30.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.webdav.org/neon -PKG_MD5SUM:=fb60b3a124eeec441937a812c456fd94 +PKG_MD5SUM:=e28d77bf14032d7f5046b3930704ef41 PKG_INSTALL:=1 @@ -24,7 +24,7 @@ define Package/libneon CATEGORY:=Libraries TITLE:=HTTP and WebDAV client library URL:=http://www.webdav.org/neon/ - DEPENDS:=+libopenssl +libexpat + DEPENDS:=+libopenssl +libexpat +zlib MAINTAINER:=Federico Di Marco <fededim@gmail.com> endef diff --git a/libs/pcre/Makefile b/libs/pcre/Makefile index 1e041612b..3171d2f4b 100644 --- a/libs/pcre/Makefile +++ b/libs/pcre/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pcre -PKG_VERSION:=8.39 -PKG_RELEASE:=1 +PKG_VERSION:=8.41 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ -PKG_MD5SUM:=e3fca7650a0556a2647821679d81f585 +PKG_MD5SUM:=c160d22723b1670447341b08c58981c1 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> PKG_LICENSE:=BSD-3-Clause @@ -53,6 +53,7 @@ CONFIGURE_ARGS += \ --enable-utf8 \ --enable-unicode-properties \ --enable-pcre16 \ + --with-match-limit-recursion=16000 \ ifneq ($(CONFIG_PACKAGE_libpcrecpp),) CONFIGURE_ARGS+= --enable-cpp diff --git a/libs/postgresql/Makefile b/libs/postgresql/Makefile index 72b99b627..935394daf 100644 --- a/libs/postgresql/Makefile +++ b/libs/postgresql/Makefile @@ -15,9 +15,9 @@ PKG_LICENSE:=PostgreSQL PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=\ - http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v$(PKG_VERSION) \ - http://ftp.be.postgresql.org/postgresql/source/v$(PKG_VERSION) \ - ftp://ftp-archives.postgresql.org/pub/source/v$(PKG_VERSION) + https://ftp.postgresql.org/pub/source/v$(PKG_VERSION) \ + http://ftp.postgresql.org/pub/source/v$(PKG_VERSION) \ + ftp://ftp.postgresql.org/pub/source/v$(PKG_VERSION) PKG_MD5SUM:=1fe952c44ed26d7e6a335cf991a9c1c6 PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 diff --git a/libs/tiff/Makefile b/libs/tiff/Makefile index bccab8bf4..f080b2af2 100644 --- a/libs/tiff/Makefile +++ b/libs/tiff/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2014 OpenWrt.org +# Copyright (C) 2006-2018 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tiff -PKG_VERSION:=4.0.3 -PKG_RELEASE:=4 +PKG_VERSION:=4.0.9 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://download.osgeo.org/libtiff -PKG_MD5SUM:=051c1068e6a0627f461948c365290410 +PKG_MD5SUM:=54bad211279cc93eb4fca31ba9bfdc79 PKG_FIXUP:=autoreconf PKG_REMOVE_FILES:=autogen.sh aclocal.m4 @@ -31,7 +31,7 @@ include $(INCLUDE_DIR)/package.mk define Package/tiff/Default TITLE:=TIFF URL:=http://www.remotesensing.org/libtiff/ - MAINTAINER:=Jiri Slachta <slachta@cesnet.cz> + MAINTAINER:=Jiri Slachta <jiri@slachta.eu> endef define Package/libtiff diff --git a/libs/tiff/patches/001-autoconf-compat.patch b/libs/tiff/patches/001-autoconf-compat.patch index c7c0dfccd..b10286e06 100644 --- a/libs/tiff/patches/001-autoconf-compat.patch +++ b/libs/tiff/patches/001-autoconf-compat.patch @@ -9,9 +9,9 @@ ACLOCAL_AMFLAGS = -I m4 docfiles = \ -@@ -48,7 +48,7 @@ EXTRA_DIST = \ - - dist_doc_DATA = $(docfiles) +@@ -61,7 +61,7 @@ distcheck-hook: + rm -rf $(distdir)/_build/cmake + rm -rf $(distdir)/_inst/cmake -SUBDIRS = port libtiff tools build contrib test man html +SUBDIRS = port libtiff tools build contrib diff --git a/libs/tiff/patches/005-fix-ftell-macro.patch b/libs/tiff/patches/005-fix-ftell-macro.patch new file mode 100644 index 000000000..23e1e039a --- /dev/null +++ b/libs/tiff/patches/005-fix-ftell-macro.patch @@ -0,0 +1,11 @@ +--- a/libtiff/tiffiop.h ++++ b/libtiff/tiffiop.h +@@ -287,7 +287,7 @@ struct tiff { + */ + #if defined(HAVE_FSEEKO) + # define fseek(stream,offset,whence) fseeko(stream,offset,whence) +-# define ftell(stream,offset,whence) ftello(stream,offset,whence) ++# define ftell(stream) ftello(stream) + #endif + #endif + #if defined(__WIN32__) && \ diff --git a/libs/tiff/patches/010-CVE-2012-4564.patch b/libs/tiff/patches/010-CVE-2012-4564.patch deleted file mode 100644 index 7783353ee..000000000 --- a/libs/tiff/patches/010-CVE-2012-4564.patch +++ /dev/null @@ -1,31 +0,0 @@ -Index: tiff-4.0.3/tools/ppm2tiff.c -=================================================================== ---- tiff-4.0.3.orig/tools/ppm2tiff.c 2013-06-23 10:36:50.779629492 -0400 -+++ tiff-4.0.3/tools/ppm2tiff.c 2013-06-23 10:36:50.775629494 -0400 -@@ -89,6 +89,7 @@ - int c; - extern int optind; - extern char* optarg; -+ tmsize_t scanline_size; - - if (argc < 2) { - fprintf(stderr, "%s: Too few arguments\n", argv[0]); -@@ -237,8 +238,16 @@ - } - if (TIFFScanlineSize(out) > linebytes) - buf = (unsigned char *)_TIFFmalloc(linebytes); -- else -- buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out)); -+ else { -+ scanline_size = TIFFScanlineSize(out); -+ if (scanline_size != 0) -+ buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out)); -+ else { -+ fprintf(stderr, "%s: scanline size overflow\n",infile); -+ (void) TIFFClose(out); -+ exit(-2); -+ } -+ } - if (resolution > 0) { - TIFFSetField(out, TIFFTAG_XRESOLUTION, resolution); - TIFFSetField(out, TIFFTAG_YRESOLUTION, resolution); diff --git a/libs/tiff/patches/011-CVE-2013-1960.patch b/libs/tiff/patches/011-CVE-2013-1960.patch deleted file mode 100644 index 3bf15f190..000000000 --- a/libs/tiff/patches/011-CVE-2013-1960.patch +++ /dev/null @@ -1,146 +0,0 @@ -Index: tiff-4.0.3/tools/tiff2pdf.c -=================================================================== ---- tiff-4.0.3.orig/tools/tiff2pdf.c 2013-06-23 10:36:50.979629486 -0400 -+++ tiff-4.0.3/tools/tiff2pdf.c 2013-06-23 10:36:50.975629486 -0400 -@@ -3341,33 +3341,56 @@ - uint32 height){ - - tsize_t i=0; -- uint16 ri =0; -- uint16 v_samp=1; -- uint16 h_samp=1; -- int j=0; -- -- i++; -- -- while(i<(*striplength)){ -+ -+ while (i < *striplength) { -+ tsize_t datalen; -+ uint16 ri; -+ uint16 v_samp; -+ uint16 h_samp; -+ int j; -+ int ncomp; -+ -+ /* marker header: one or more FFs */ -+ if (strip[i] != 0xff) -+ return(0); -+ i++; -+ while (i < *striplength && strip[i] == 0xff) -+ i++; -+ if (i >= *striplength) -+ return(0); -+ /* SOI is the only pre-SOS marker without a length word */ -+ if (strip[i] == 0xd8) -+ datalen = 0; -+ else { -+ if ((*striplength - i) <= 2) -+ return(0); -+ datalen = (strip[i+1] << 8) | strip[i+2]; -+ if (datalen < 2 || datalen >= (*striplength - i)) -+ return(0); -+ } - switch( strip[i] ){ -- case 0xd8: -- /* SOI - start of image */ -+ case 0xd8: /* SOI - start of image */ - _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), 2); - *bufferoffset+=2; -- i+=2; - break; -- case 0xc0: -- case 0xc1: -- case 0xc3: -- case 0xc9: -- case 0xca: -+ case 0xc0: /* SOF0 */ -+ case 0xc1: /* SOF1 */ -+ case 0xc3: /* SOF3 */ -+ case 0xc9: /* SOF9 */ -+ case 0xca: /* SOF10 */ - if(no==0){ -- _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2); -- for(j=0;j<buffer[*bufferoffset+9];j++){ -- if( (buffer[*bufferoffset+11+(2*j)]>>4) > h_samp) -- h_samp = (buffer[*bufferoffset+11+(2*j)]>>4); -- if( (buffer[*bufferoffset+11+(2*j)] & 0x0f) > v_samp) -- v_samp = (buffer[*bufferoffset+11+(2*j)] & 0x0f); -+ _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2); -+ ncomp = buffer[*bufferoffset+9]; -+ if (ncomp < 1 || ncomp > 4) -+ return(0); -+ v_samp=1; -+ h_samp=1; -+ for(j=0;j<ncomp;j++){ -+ uint16 samp = buffer[*bufferoffset+11+(3*j)]; -+ if( (samp>>4) > h_samp) -+ h_samp = (samp>>4); -+ if( (samp & 0x0f) > v_samp) -+ v_samp = (samp & 0x0f); - } - v_samp*=8; - h_samp*=8; -@@ -3381,45 +3404,43 @@ - (unsigned char) ((height>>8) & 0xff); - buffer[*bufferoffset+6]= - (unsigned char) (height & 0xff); -- *bufferoffset+=strip[i+2]+2; -- i+=strip[i+2]+2; -- -+ *bufferoffset+=datalen+2; -+ /* insert a DRI marker */ - buffer[(*bufferoffset)++]=0xff; - buffer[(*bufferoffset)++]=0xdd; - buffer[(*bufferoffset)++]=0x00; - buffer[(*bufferoffset)++]=0x04; - buffer[(*bufferoffset)++]=(ri >> 8) & 0xff; - buffer[(*bufferoffset)++]= ri & 0xff; -- } else { -- i+=strip[i+2]+2; - } - break; -- case 0xc4: -- case 0xdb: -- _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2); -- *bufferoffset+=strip[i+2]+2; -- i+=strip[i+2]+2; -+ case 0xc4: /* DHT */ -+ case 0xdb: /* DQT */ -+ _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2); -+ *bufferoffset+=datalen+2; - break; -- case 0xda: -+ case 0xda: /* SOS */ - if(no==0){ -- _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2); -- *bufferoffset+=strip[i+2]+2; -- i+=strip[i+2]+2; -+ _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2); -+ *bufferoffset+=datalen+2; - } else { - buffer[(*bufferoffset)++]=0xff; - buffer[(*bufferoffset)++]= - (unsigned char)(0xd0 | ((no-1)%8)); -- i+=strip[i+2]+2; - } -- _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), (*striplength)-i-1); -- *bufferoffset+=(*striplength)-i-1; -+ i += datalen + 1; -+ /* copy remainder of strip */ -+ _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i]), *striplength - i); -+ *bufferoffset+= *striplength - i; - return(1); - default: -- i+=strip[i+2]+2; -+ /* ignore any other marker */ -+ break; - } -+ i += datalen + 1; - } -- - -+ /* failed to find SOS marker */ - return(0); - } - #endif diff --git a/libs/tiff/patches/012-CVE-2013-1961.patch b/libs/tiff/patches/012-CVE-2013-1961.patch deleted file mode 100644 index 2d1268ee9..000000000 --- a/libs/tiff/patches/012-CVE-2013-1961.patch +++ /dev/null @@ -1,768 +0,0 @@ -Index: tiff-4.0.3/contrib/dbs/xtiff/xtiff.c -=================================================================== ---- tiff-4.0.3.orig/contrib/dbs/xtiff/xtiff.c 2013-06-23 10:36:51.163629483 -0400 -+++ tiff-4.0.3/contrib/dbs/xtiff/xtiff.c 2013-06-23 10:36:51.147629484 -0400 -@@ -512,9 +512,9 @@ - Arg args[1]; - - if (tfMultiPage) -- sprintf(buffer, "%s - page %d", fileName, tfDirectory); -+ snprintf(buffer, sizeof(buffer), "%s - page %d", fileName, tfDirectory); - else -- strcpy(buffer, fileName); -+ snprintf(buffer, sizeof(buffer), "%s", fileName); - XtSetArg(args[0], XtNlabel, buffer); - XtSetValues(labelWidget, args, 1); - } -Index: tiff-4.0.3/libtiff/tif_dirinfo.c -=================================================================== ---- tiff-4.0.3.orig/libtiff/tif_dirinfo.c 2013-06-23 10:36:51.163629483 -0400 -+++ tiff-4.0.3/libtiff/tif_dirinfo.c 2013-06-23 10:36:51.147629484 -0400 -@@ -711,7 +711,7 @@ - * note that this name is a special sign to TIFFClose() and - * _TIFFSetupFields() to free the field - */ -- sprintf(fld->field_name, "Tag %d", (int) tag); -+ snprintf(fld->field_name, 32, "Tag %d", (int) tag); - - return fld; - } -Index: tiff-4.0.3/libtiff/tif_codec.c -=================================================================== ---- tiff-4.0.3.orig/libtiff/tif_codec.c 2013-06-23 10:36:51.163629483 -0400 -+++ tiff-4.0.3/libtiff/tif_codec.c 2013-06-23 10:36:51.151629482 -0400 -@@ -108,7 +108,8 @@ - const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); - char compression_code[20]; - -- sprintf( compression_code, "%d", tif->tif_dir.td_compression ); -+ snprintf(compression_code, sizeof(compression_code), "%d", -+ tif->tif_dir.td_compression ); - TIFFErrorExt(tif->tif_clientdata, tif->tif_name, - "%s compression support is not configured", - c ? c->name : compression_code ); -Index: tiff-4.0.3/tools/tiffdither.c -=================================================================== ---- tiff-4.0.3.orig/tools/tiffdither.c 2013-06-23 10:36:51.163629483 -0400 -+++ tiff-4.0.3/tools/tiffdither.c 2013-06-23 10:36:51.151629482 -0400 -@@ -260,7 +260,7 @@ - TIFFSetField(out, TIFFTAG_FILLORDER, fillorder); - else - CopyField(TIFFTAG_FILLORDER, shortv); -- sprintf(thing, "Dithered B&W version of %s", argv[optind]); -+ snprintf(thing, sizeof(thing), "Dithered B&W version of %s", argv[optind]); - TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing); - CopyField(TIFFTAG_PHOTOMETRIC, shortv); - CopyField(TIFFTAG_ORIENTATION, shortv); -Index: tiff-4.0.3/tools/rgb2ycbcr.c -=================================================================== ---- tiff-4.0.3.orig/tools/rgb2ycbcr.c 2013-06-23 10:36:51.163629483 -0400 -+++ tiff-4.0.3/tools/rgb2ycbcr.c 2013-06-23 10:36:51.151629482 -0400 -@@ -332,7 +332,8 @@ - TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); - { char buf[2048]; - char *cp = strrchr(TIFFFileName(in), '/'); -- sprintf(buf, "YCbCr conversion of %s", cp ? cp+1 : TIFFFileName(in)); -+ snprintf(buf, sizeof(buf), "YCbCr conversion of %s", -+ cp ? cp+1 : TIFFFileName(in)); - TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, buf); - } - TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion()); -Index: tiff-4.0.3/tools/tiff2pdf.c -=================================================================== ---- tiff-4.0.3.orig/tools/tiff2pdf.c 2013-06-23 10:36:51.163629483 -0400 -+++ tiff-4.0.3/tools/tiff2pdf.c 2013-06-23 10:36:51.151629482 -0400 -@@ -3630,7 +3630,9 @@ - char buffer[16]; - int buflen=0; - -- buflen=sprintf(buffer, "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff); -+ buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ", -+ t2p->pdf_majorversion&0xff, -+ t2p->pdf_minorversion&0xff); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7); - -@@ -3644,10 +3646,10 @@ - tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){ - - tsize_t written=0; -- char buffer[16]; -+ char buffer[32]; - int buflen=0; - -- buflen=sprintf(buffer, "%lu", (unsigned long)number); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); - written += t2pWriteFile(output, (tdata_t) buffer, buflen ); - written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); - -@@ -3686,13 +3688,13 @@ - written += t2pWriteFile(output, (tdata_t) "/", 1); - for (i=0;i<namelen;i++){ - if ( ((unsigned char)name[i]) < 0x21){ -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - nextchar=1; - } - if ( ((unsigned char)name[i]) > 0x7E){ -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - nextchar=1; -@@ -3700,57 +3702,57 @@ - if (nextchar==0){ - switch (name[i]){ - case 0x23: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x25: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x28: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x29: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x2F: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x3C: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x3E: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x5B: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x5D: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x7B: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; - case 0x7D: -- sprintf(buffer, "#%.2X", name[i]); -+ snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); - buffer[sizeof(buffer) - 1] = '\0'; - written += t2pWriteFile(output, (tdata_t) buffer, 3); - break; -@@ -3865,14 +3867,14 @@ - tsize_t t2p_write_pdf_stream_dict(tsize_t len, uint32 number, TIFF* output){ - - tsize_t written=0; -- char buffer[16]; -+ char buffer[32]; - int buflen=0; - - written += t2pWriteFile(output, (tdata_t) "/Length ", 8); - if(len!=0){ - written += t2p_write_pdf_stream_length(len, output); - } else { -- buflen=sprintf(buffer, "%lu", (unsigned long)number); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); - } -@@ -3913,10 +3915,10 @@ - tsize_t t2p_write_pdf_stream_length(tsize_t len, TIFF* output){ - - tsize_t written=0; -- char buffer[16]; -+ char buffer[32]; - int buflen=0; - -- buflen=sprintf(buffer, "%lu", (unsigned long)len); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)len); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "\n", 1); - -@@ -3930,7 +3932,7 @@ - tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output) - { - tsize_t written = 0; -- char buffer[16]; -+ char buffer[32]; - int buflen = 0; - - written += t2pWriteFile(output, -@@ -3969,7 +3971,6 @@ - written += t2p_write_pdf_string(t2p->pdf_datetime, output); - } - written += t2pWriteFile(output, (tdata_t) "\n/Producer ", 11); -- _TIFFmemset((tdata_t)buffer, 0x00, sizeof(buffer)); - snprintf(buffer, sizeof(buffer), "libtiff / tiff2pdf - %d", TIFFLIB_VERSION); - written += t2p_write_pdf_string(buffer, output); - written += t2pWriteFile(output, (tdata_t) "\n", 1); -@@ -4110,7 +4111,7 @@ - { - tsize_t written=0; - tdir_t i=0; -- char buffer[16]; -+ char buffer[32]; - int buflen=0; - - int page=0; -@@ -4118,7 +4119,7 @@ - (tdata_t) "<< \n/Type /Pages \n/Kids [ ", 26); - page = t2p->pdf_pages+1; - for (i=0;i<t2p->tiff_pagecount;i++){ -- buflen=sprintf(buffer, "%d", page); -+ buflen=snprintf(buffer, sizeof(buffer), "%d", page); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); - if ( ((i+1)%8)==0 ) { -@@ -4133,8 +4134,7 @@ - } - } - written += t2pWriteFile(output, (tdata_t) "] \n/Count ", 10); -- _TIFFmemset(buffer, 0x00, 16); -- buflen=sprintf(buffer, "%d", t2p->tiff_pagecount); -+ buflen=snprintf(buffer, sizeof(buffer), "%d", t2p->tiff_pagecount); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " \n>> \n", 6); - -@@ -4149,28 +4149,28 @@ - - unsigned int i=0; - tsize_t written=0; -- char buffer[16]; -+ char buffer[256]; - int buflen=0; - - written += t2pWriteFile(output, (tdata_t) "<<\n/Type /Page \n/Parent ", 24); -- buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_pages); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); - written += t2pWriteFile(output, (tdata_t) "/MediaBox [", 11); -- buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x1); -+ buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.x1); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " ", 1); -- buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y1); -+ buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.y1); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " ", 1); -- buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x2); -+ buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.x2); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " ", 1); -- buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y2); -+ buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.y2); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "] \n", 3); - written += t2pWriteFile(output, (tdata_t) "/Contents ", 10); -- buflen=sprintf(buffer, "%lu", (unsigned long)(object + 1)); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(object + 1)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); - written += t2pWriteFile(output, (tdata_t) "/Resources << \n", 15); -@@ -4178,15 +4178,13 @@ - written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12); - for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount;i++){ - written += t2pWriteFile(output, (tdata_t) "/Im", 3); -- buflen = sprintf(buffer, "%u", t2p->pdf_page+1); -+ buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "_", 1); -- buflen = sprintf(buffer, "%u", i+1); -+ buflen = snprintf(buffer, sizeof(buffer), "%u", i+1); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " ", 1); -- buflen = sprintf( -- buffer, -- "%lu", -+ buflen = snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); -@@ -4198,12 +4196,10 @@ - } else { - written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12); - written += t2pWriteFile(output, (tdata_t) "/Im", 3); -- buflen = sprintf(buffer, "%u", t2p->pdf_page+1); -+ buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " ", 1); -- buflen = sprintf( -- buffer, -- "%lu", -+ buflen = snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); -@@ -4212,9 +4208,7 @@ - if(t2p->tiff_transferfunctioncount != 0) { - written += t2pWriteFile(output, (tdata_t) "/ExtGState <<", 13); - t2pWriteFile(output, (tdata_t) "/GS1 ", 5); -- buflen = sprintf( -- buffer, -- "%lu", -+ buflen = snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)(object + 3)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); -@@ -4587,7 +4581,7 @@ - if(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount>0){ - for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount; i++){ - box=t2p->tiff_tiles[t2p->pdf_page].tiles_tiles[i].tile_box; -- buflen=sprintf(buffer, -+ buflen=snprintf(buffer, sizeof(buffer), - "q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d_%ld Do Q\n", - t2p->tiff_transferfunctioncount?"/GS1 gs ":"", - box.mat[0], -@@ -4602,7 +4596,7 @@ - } - } else { - box=t2p->pdf_imagebox; -- buflen=sprintf(buffer, -+ buflen=snprintf(buffer, sizeof(buffer), - "q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d Do Q\n", - t2p->tiff_transferfunctioncount?"/GS1 gs ":"", - box.mat[0], -@@ -4627,59 +4621,48 @@ - TIFF* output){ - - tsize_t written=0; -- char buffer[16]; -+ char buffer[32]; - int buflen=0; - - written += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output); - written += t2pWriteFile(output, - (tdata_t) "/Type /XObject \n/Subtype /Image \n/Name /Im", - 42); -- buflen=sprintf(buffer, "%u", t2p->pdf_page+1); -+ buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - if(tile != 0){ - written += t2pWriteFile(output, (tdata_t) "_", 1); -- buflen=sprintf(buffer, "%lu", (unsigned long)tile); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)tile); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - } - written += t2pWriteFile(output, (tdata_t) "\n/Width ", 8); -- _TIFFmemset((tdata_t)buffer, 0x00, 16); - if(tile==0){ -- buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_width); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_width); - } else { - if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){ -- buflen=sprintf( -- buffer, -- "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth); - } else { -- buflen=sprintf( -- buffer, -- "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth); - } - } - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "\n/Height ", 9); -- _TIFFmemset((tdata_t)buffer, 0x00, 16); - if(tile==0){ -- buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_length); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_length); - } else { - if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){ -- buflen=sprintf( -- buffer, -- "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength); - } else { -- buflen=sprintf( -- buffer, -- "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); - } - } - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "\n/BitsPerComponent ", 19); -- _TIFFmemset((tdata_t)buffer, 0x00, 16); -- buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample); -+ buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "\n/ColorSpace ", 13); - written += t2p_write_pdf_xobject_cs(t2p, output); -@@ -4723,11 +4706,10 @@ - t2p->pdf_colorspace ^= T2P_CS_PALETTE; - written += t2p_write_pdf_xobject_cs(t2p, output); - t2p->pdf_colorspace |= T2P_CS_PALETTE; -- buflen=sprintf(buffer, "%u", (0x0001 << t2p->tiff_bitspersample)-1 ); -+ buflen=snprintf(buffer, sizeof(buffer), "%u", (0x0001 << t2p->tiff_bitspersample)-1 ); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " ", 1); -- _TIFFmemset(buffer, 0x00, 16); -- buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_palettecs ); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_palettecs ); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R ]\n", 7); - return(written); -@@ -4761,10 +4743,10 @@ - X_W /= Y_W; - Z_W /= Y_W; - Y_W = 1.0F; -- buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W); -+ buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "/Range ", 7); -- buflen=sprintf(buffer, "[%d %d %d %d] \n", -+ buflen=snprintf(buffer, sizeof(buffer), "[%d %d %d %d] \n", - t2p->pdf_labrange[0], - t2p->pdf_labrange[1], - t2p->pdf_labrange[2], -@@ -4780,26 +4762,26 @@ - tsize_t t2p_write_pdf_transfer(T2P* t2p, TIFF* output){ - - tsize_t written=0; -- char buffer[16]; -+ char buffer[32]; - int buflen=0; - - written += t2pWriteFile(output, (tdata_t) "<< /Type /ExtGState \n/TR ", 25); - if(t2p->tiff_transferfunctioncount == 1){ -- buflen=sprintf(buffer, "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)(t2p->pdf_xrefcount + 1)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); - } else { - written += t2pWriteFile(output, (tdata_t) "[ ", 2); -- buflen=sprintf(buffer, "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)(t2p->pdf_xrefcount + 1)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); -- buflen=sprintf(buffer, "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)(t2p->pdf_xrefcount + 2)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); -- buflen=sprintf(buffer, "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)(t2p->pdf_xrefcount + 3)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); -@@ -4821,7 +4803,7 @@ - written += t2pWriteFile(output, (tdata_t) "/FunctionType 0 \n", 17); - written += t2pWriteFile(output, (tdata_t) "/Domain [0.0 1.0] \n", 19); - written += t2pWriteFile(output, (tdata_t) "/Range [0.0 1.0] \n", 18); -- buflen=sprintf(buffer, "/Size [%u] \n", (1<<t2p->tiff_bitspersample)); -+ buflen=snprintf(buffer, sizeof(buffer), "/Size [%u] \n", (1<<t2p->tiff_bitspersample)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "/BitsPerSample 16 \n", 19); - written += t2p_write_pdf_stream_dict(((tsize_t)1)<<(t2p->tiff_bitspersample+1), 0, output); -@@ -4848,7 +4830,7 @@ - tsize_t t2p_write_pdf_xobject_calcs(T2P* t2p, TIFF* output){ - - tsize_t written=0; -- char buffer[128]; -+ char buffer[256]; - int buflen=0; - - float X_W=0.0; -@@ -4916,16 +4898,16 @@ - written += t2pWriteFile(output, (tdata_t) "<< \n", 4); - if(t2p->pdf_colorspace & T2P_CS_CALGRAY){ - written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12); -- buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W); -+ buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "/Gamma 2.2 \n", 12); - } - if(t2p->pdf_colorspace & T2P_CS_CALRGB){ - written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12); -- buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W); -+ buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "/Matrix ", 8); -- buflen=sprintf(buffer, "[%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f] \n", -+ buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f] \n", - X_R, Y_R, Z_R, - X_G, Y_G, Z_G, - X_B, Y_B, Z_B); -@@ -4944,11 +4926,11 @@ - tsize_t t2p_write_pdf_xobject_icccs(T2P* t2p, TIFF* output){ - - tsize_t written=0; -- char buffer[16]; -+ char buffer[32]; - int buflen=0; - - written += t2pWriteFile(output, (tdata_t) "[/ICCBased ", 11); -- buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_icccs); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_icccs); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " 0 R] \n", 7); - -@@ -4958,11 +4940,11 @@ - tsize_t t2p_write_pdf_xobject_icccs_dict(T2P* t2p, TIFF* output){ - - tsize_t written=0; -- char buffer[16]; -+ char buffer[32]; - int buflen=0; - - written += t2pWriteFile(output, (tdata_t) "/N ", 3); -- buflen=sprintf(buffer, "%u \n", t2p->tiff_samplesperpixel); -+ buflen=snprintf(buffer, sizeof(buffer), "%u \n", t2p->tiff_samplesperpixel); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) "/Alternate ", 11); - t2p->pdf_colorspace ^= T2P_CS_ICCBASED; -@@ -5027,7 +5009,7 @@ - tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t tile, T2P* t2p, TIFF* output){ - - tsize_t written=0; -- char buffer[16]; -+ char buffer[32]; - int buflen=0; - - if(t2p->pdf_compression==T2P_COMPRESS_NONE){ -@@ -5042,41 +5024,33 @@ - written += t2pWriteFile(output, (tdata_t) "<< /K -1 ", 9); - if(tile==0){ - written += t2pWriteFile(output, (tdata_t) "/Columns ", 9); -- buflen=sprintf(buffer, "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_width); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " /Rows ", 7); -- buflen=sprintf(buffer, "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_length); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - } else { - if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){ - written += t2pWriteFile(output, (tdata_t) "/Columns ", 9); -- buflen=sprintf( -- buffer, -- "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - } else { - written += t2pWriteFile(output, (tdata_t) "/Columns ", 9); -- buflen=sprintf( -- buffer, -- "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - } - if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){ - written += t2pWriteFile(output, (tdata_t) " /Rows ", 7); -- buflen=sprintf( -- buffer, -- "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - } else { - written += t2pWriteFile(output, (tdata_t) " /Rows ", 7); -- buflen=sprintf( -- buffer, -- "%lu", -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - } -@@ -5103,21 +5077,17 @@ - if(t2p->pdf_compressionquality%100){ - written += t2pWriteFile(output, (tdata_t) "/DecodeParms ", 13); - written += t2pWriteFile(output, (tdata_t) "<< /Predictor ", 14); -- _TIFFmemset(buffer, 0x00, 16); -- buflen=sprintf(buffer, "%u", t2p->pdf_compressionquality%100); -+ buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_compressionquality%100); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " /Columns ", 10); -- _TIFFmemset(buffer, 0x00, 16); -- buflen = sprintf(buffer, "%lu", -+ buflen = snprintf(buffer, sizeof(buffer), "%lu", - (unsigned long)t2p->tiff_width); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " /Colors ", 9); -- _TIFFmemset(buffer, 0x00, 16); -- buflen=sprintf(buffer, "%u", t2p->tiff_samplesperpixel); -+ buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_samplesperpixel); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " /BitsPerComponent ", 19); -- _TIFFmemset(buffer, 0x00, 16); -- buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample); -+ buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) ">>\n", 3); - } -@@ -5137,16 +5107,16 @@ - tsize_t t2p_write_pdf_xreftable(T2P* t2p, TIFF* output){ - - tsize_t written=0; -- char buffer[21]; -+ char buffer[64]; - int buflen=0; - uint32 i=0; - - written += t2pWriteFile(output, (tdata_t) "xref\n0 ", 7); -- buflen=sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount + 1)); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount + 1)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); - written += t2pWriteFile(output, (tdata_t) " \n0000000000 65535 f \n", 22); - for (i=0;i<t2p->pdf_xrefcount;i++){ -- sprintf(buffer, "%.10lu 00000 n \n", -+ snprintf(buffer, sizeof(buffer), "%.10lu 00000 n \n", - (unsigned long)t2p->pdf_xrefoffsets[i]); - written += t2pWriteFile(output, (tdata_t) buffer, 20); - } -@@ -5170,17 +5140,14 @@ - snprintf(t2p->pdf_fileid + i, 9, "%.8X", rand()); - - written += t2pWriteFile(output, (tdata_t) "trailer\n<<\n/Size ", 17); -- buflen = sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount+1)); -+ buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount+1)); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); -- _TIFFmemset(buffer, 0x00, 32); - written += t2pWriteFile(output, (tdata_t) "\n/Root ", 7); -- buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_catalog); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_catalog); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); -- _TIFFmemset(buffer, 0x00, 32); - written += t2pWriteFile(output, (tdata_t) " 0 R \n/Info ", 12); -- buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_info); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_info); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); -- _TIFFmemset(buffer, 0x00, 32); - written += t2pWriteFile(output, (tdata_t) " 0 R \n/ID[<", 11); - written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid, - sizeof(t2p->pdf_fileid) - 1); -@@ -5188,9 +5155,8 @@ - written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid, - sizeof(t2p->pdf_fileid) - 1); - written += t2pWriteFile(output, (tdata_t) ">]\n>>\nstartxref\n", 16); -- buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_startxref); -+ buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_startxref); - written += t2pWriteFile(output, (tdata_t) buffer, buflen); -- _TIFFmemset(buffer, 0x00, 32); - written += t2pWriteFile(output, (tdata_t) "\n%%EOF\n", 7); - - return(written); -Index: tiff-4.0.3/tools/tiff2ps.c -=================================================================== ---- tiff-4.0.3.orig/tools/tiff2ps.c 2013-06-23 10:36:51.163629483 -0400 -+++ tiff-4.0.3/tools/tiff2ps.c 2013-06-23 10:36:51.155629481 -0400 -@@ -1781,8 +1781,8 @@ - imageOp = "imagemask"; - - (void)strcpy(im_x, "0"); -- (void)sprintf(im_y, "%lu", (long) h); -- (void)sprintf(im_h, "%lu", (long) h); -+ (void)snprintf(im_y, sizeof(im_y), "%lu", (long) h); -+ (void)snprintf(im_h, sizeof(im_h), "%lu", (long) h); - tile_width = w; - tile_height = h; - if (TIFFIsTiled(tif)) { -@@ -1803,7 +1803,7 @@ - } - if (tile_height < h) { - fputs("/im_y 0 def\n", fd); -- (void)sprintf(im_y, "%lu im_y sub", (unsigned long) h); -+ (void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h); - } - } else { - repeat_count = tf_numberstrips; -@@ -1815,7 +1815,7 @@ - fprintf(fd, "/im_h %lu def\n", - (unsigned long) tile_height); - (void)strcpy(im_h, "im_h"); -- (void)sprintf(im_y, "%lu im_y sub", (unsigned long) h); -+ (void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h); - } - } - -Index: tiff-4.0.3/tools/tiffcrop.c -=================================================================== ---- tiff-4.0.3.orig/tools/tiffcrop.c 2013-06-23 10:36:51.163629483 -0400 -+++ tiff-4.0.3/tools/tiffcrop.c 2013-06-23 10:36:51.159629481 -0400 -@@ -2077,7 +2077,7 @@ - return 1; - } - -- sprintf (filenum, "-%03d%s", findex, export_ext); -+ snprintf(filenum, sizeof(filenum), "-%03d%s", findex, export_ext); - filenum[14] = '\0'; - strncat (exportname, filenum, 15); - } -@@ -2230,8 +2230,8 @@ - - /* dump.infilename is guaranteed to be NUL termimated and have 20 bytes - fewer than PATH_MAX */ -- memset (temp_filename, '\0', PATH_MAX + 1); -- sprintf (temp_filename, "%s-read-%03d.%s", dump.infilename, dump_images, -+ snprintf(temp_filename, sizeof(temp_filename), "%s-read-%03d.%s", -+ dump.infilename, dump_images, - (dump.format == DUMP_TEXT) ? "txt" : "raw"); - if ((dump.infile = fopen(temp_filename, dump.mode)) == NULL) - { -@@ -2249,8 +2249,8 @@ - - /* dump.outfilename is guaranteed to be NUL termimated and have 20 bytes - fewer than PATH_MAX */ -- memset (temp_filename, '\0', PATH_MAX + 1); -- sprintf (temp_filename, "%s-write-%03d.%s", dump.outfilename, dump_images, -+ snprintf(temp_filename, sizeof(temp_filename), "%s-write-%03d.%s", -+ dump.outfilename, dump_images, - (dump.format == DUMP_TEXT) ? "txt" : "raw"); - if ((dump.outfile = fopen(temp_filename, dump.mode)) == NULL) - { -Index: tiff-4.0.3/tools/tiff2bw.c -=================================================================== ---- tiff-4.0.3.orig/tools/tiff2bw.c 2013-06-23 10:36:51.163629483 -0400 -+++ tiff-4.0.3/tools/tiff2bw.c 2013-06-23 10:36:51.159629481 -0400 -@@ -205,7 +205,7 @@ - } - } - TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); -- sprintf(thing, "B&W version of %s", argv[optind]); -+ snprintf(thing, sizeof(thing), "B&W version of %s", argv[optind]); - TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing); - TIFFSetField(out, TIFFTAG_SOFTWARE, "tiff2bw"); - outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out)); diff --git a/libs/tiff/patches/013-CVE-2013-4231.patch b/libs/tiff/patches/013-CVE-2013-4231.patch deleted file mode 100644 index c26bd856c..000000000 --- a/libs/tiff/patches/013-CVE-2013-4231.patch +++ /dev/null @@ -1,17 +0,0 @@ -Description: Buffer overflow in gif2tiff -Bug: http://bugzilla.maptools.org/show_bug.cgi?id=2450 -Bug-Debian: http://bugs.debian.org/719303 - -Index: tiff-4.0.3/tools/gif2tiff.c -=================================================================== ---- tiff-4.0.3.orig/tools/gif2tiff.c 2013-08-22 11:46:11.960846910 -0400 -+++ tiff-4.0.3/tools/gif2tiff.c 2013-08-22 11:46:11.956846910 -0400 -@@ -333,6 +333,8 @@ - int status = 1; - - datasize = getc(infile); -+ if (datasize > 12) -+ return 0; - clear = 1 << datasize; - eoi = clear + 1; - avail = clear + 2; diff --git a/libs/tiff/patches/014-CVE-2013-4232.patch b/libs/tiff/patches/014-CVE-2013-4232.patch deleted file mode 100644 index 0d80ff3b0..000000000 --- a/libs/tiff/patches/014-CVE-2013-4232.patch +++ /dev/null @@ -1,18 +0,0 @@ -Description: use after free in tiff2pdf -Bug: http://bugzilla.maptools.org/show_bug.cgi?id=2449 -Bug-Debian: http://bugs.debian.org/719303 - -Index: tiff-4.0.3/tools/tiff2pdf.c -=================================================================== ---- tiff-4.0.3.orig/tools/tiff2pdf.c 2013-08-22 11:46:37.292847242 -0400 -+++ tiff-4.0.3/tools/tiff2pdf.c 2013-08-22 11:46:37.292847242 -0400 -@@ -2461,7 +2461,8 @@ - (unsigned long) t2p->tiff_datasize, - TIFFFileName(input)); - t2p->t2p_error = T2P_ERR_ERROR; -- _TIFFfree(buffer); -+ _TIFFfree(buffer); -+ return(0); - } else { - buffer=samplebuffer; - t2p->tiff_datasize *= t2p->tiff_samplesperpixel; diff --git a/libs/tiff/patches/015-CVE-2013-4244.patch b/libs/tiff/patches/015-CVE-2013-4244.patch deleted file mode 100644 index 0a77a0c4d..000000000 --- a/libs/tiff/patches/015-CVE-2013-4244.patch +++ /dev/null @@ -1,18 +0,0 @@ -Description: OOB write in gif2tiff -Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=996468 - -Index: tiff-4.0.3/tools/gif2tiff.c -=================================================================== ---- tiff-4.0.3.orig/tools/gif2tiff.c 2013-08-24 11:17:13.546447901 -0400 -+++ tiff-4.0.3/tools/gif2tiff.c 2013-08-24 11:17:13.546447901 -0400 -@@ -400,6 +400,10 @@ - } - - if (oldcode == -1) { -+ if (code >= clear) { -+ fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",code, clear); -+ return 0; -+ } - *(*fill)++ = suffix[code]; - firstchar = oldcode = code; - return 1; diff --git a/libs/tiff/patches/016-CVE-2013-4243.patch b/libs/tiff/patches/016-CVE-2013-4243.patch deleted file mode 100644 index 75fae2c3c..000000000 --- a/libs/tiff/patches/016-CVE-2013-4243.patch +++ /dev/null @@ -1,37 +0,0 @@ -Index: tiff/tools/gif2tiff.c -=================================================================== ---- tiff.orig/tools/gif2tiff.c -+++ tiff/tools/gif2tiff.c -@@ -280,6 +280,10 @@ readgifimage(char* mode) - fprintf(stderr, "no colormap present for image\n"); - return (0); - } -+ if (width == 0 || height == 0) { -+ fprintf(stderr, "Invalid value of width or height\n"); -+ return(0); -+ } - if ((raster = (unsigned char*) _TIFFmalloc(width*height+EXTRAFUDGE)) == NULL) { - fprintf(stderr, "not enough memory for image\n"); - return (0); -@@ -404,6 +408,10 @@ process(register int code, unsigned char - fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",code, clear); - return 0; - } -+ if (*fill >= raster + width*height) { -+ fprintf(stderr, "raster full before eoi code\n"); -+ return 0; -+ } - *(*fill)++ = suffix[code]; - firstchar = oldcode = code; - return 1; -@@ -434,6 +442,10 @@ process(register int code, unsigned char - } - oldcode = incode; - do { -+ if (*fill >= raster + width*height) { -+ fprintf(stderr, "raster full before eoi code\n"); -+ return 0; -+ } - *(*fill)++ = *--stackp; - } while (stackp > stack); - return 1; diff --git a/libs/tiff/patches/017-CVE-2014-9330.patch b/libs/tiff/patches/017-CVE-2014-9330.patch deleted file mode 100644 index acd0a331d..000000000 --- a/libs/tiff/patches/017-CVE-2014-9330.patch +++ /dev/null @@ -1,45 +0,0 @@ -Description: CVE-2014-9330 - Integer overflow in bmp2tiff -Origin: upstream, http://bugzilla.maptools.org/show_bug.cgi?id=2494 -Bug: http://bugzilla.maptools.org/show_bug.cgi?id=2494 -Bug-Debian: http://bugs.debian.org/773987 - -Index: tiff/tools/bmp2tiff.c -=================================================================== ---- tiff.orig/tools/bmp2tiff.c -+++ tiff/tools/bmp2tiff.c -@@ -1,4 +1,4 @@ --/* $Id: bmp2tiff.c,v 1.23 2010-03-10 18:56:49 bfriesen Exp $ -+/* $Id: bmp2tiff.c,v 1.24 2014-12-21 15:15:32 erouault Exp $ - * - * Project: libtiff tools - * Purpose: Convert Windows BMP files in TIFF. -@@ -403,6 +403,13 @@ main(int argc, char* argv[]) - - width = info_hdr.iWidth; - length = (info_hdr.iHeight > 0) ? info_hdr.iHeight : -info_hdr.iHeight; -+ if( width <= 0 || length <= 0 ) -+ { -+ TIFFError(infilename, -+ "Invalid dimensions of BMP file" ); -+ close(fd); -+ return -1; -+ } - - switch (info_hdr.iBitCount) - { -@@ -593,6 +600,14 @@ main(int argc, char* argv[]) - - compr_size = file_hdr.iSize - file_hdr.iOffBits; - uncompr_size = width * length; -+ /* Detect int overflow */ -+ if( uncompr_size / width != length ) -+ { -+ TIFFError(infilename, -+ "Invalid dimensions of BMP file" ); -+ close(fd); -+ return -1; -+ } - comprbuf = (unsigned char *) _TIFFmalloc( compr_size ); - if (!comprbuf) { - TIFFError(infilename, diff --git a/libs/tiff/patches/019-CVE-2017-18013.patch b/libs/tiff/patches/019-CVE-2017-18013.patch new file mode 100644 index 000000000..daaf41353 --- /dev/null +++ b/libs/tiff/patches/019-CVE-2017-18013.patch @@ -0,0 +1,34 @@ +From c6f41df7b581402dfba3c19a1e3df4454c551a01 Mon Sep 17 00:00:00 2001 +From: Even Rouault <even.rouault@spatialys.com> +Date: Sun, 31 Dec 2017 15:09:41 +0100 +Subject: [PATCH] libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer dereference on corrupted file. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2770 + +--- + libtiff/tif_print.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c +index 9959d35..8deceb2 100644 +--- a/libtiff/tif_print.c ++++ b/libtiff/tif_print.c +@@ -667,13 +667,13 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) + #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + fprintf(fd, " %3lu: [%8I64u, %8I64u]\n", + (unsigned long) s, +- (unsigned __int64) td->td_stripoffset[s], +- (unsigned __int64) td->td_stripbytecount[s]); ++ td->td_stripoffset ? (unsigned __int64) td->td_stripoffset[s] : 0, ++ td->td_stripbytecount ? (unsigned __int64) td->td_stripbytecount[s] : 0); + #else + fprintf(fd, " %3lu: [%8llu, %8llu]\n", + (unsigned long) s, +- (unsigned long long) td->td_stripoffset[s], +- (unsigned long long) td->td_stripbytecount[s]); ++ td->td_stripoffset ? (unsigned long long) td->td_stripoffset[s] : 0, ++ td->td_stripbytecount ? (unsigned long long) td->td_stripbytecount[s] : 0); + #endif + } + } +-- +libgit2 0.26.0 + diff --git a/libs/tiff/patches/020-CVE-2017-9935.patch b/libs/tiff/patches/020-CVE-2017-9935.patch new file mode 100644 index 000000000..d1082c09e --- /dev/null +++ b/libs/tiff/patches/020-CVE-2017-9935.patch @@ -0,0 +1,117 @@ +diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c +index 2ccaf44..cbf2b69 100644 +--- a/libtiff/tif_dir.c ++++ b/libtiff/tif_dir.c +@@ -1067,6 +1067,9 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap) + if (td->td_samplesperpixel - td->td_extrasamples > 1) { + *va_arg(ap, uint16**) = td->td_transferfunction[1]; + *va_arg(ap, uint16**) = td->td_transferfunction[2]; ++ } else { ++ *va_arg(ap, uint16**) = NULL; ++ *va_arg(ap, uint16**) = NULL; + } + break; + case TIFFTAG_REFERENCEBLACKWHITE: +diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c +index d1a9b09..484776c 100644 +--- a/tools/tiff2pdf.c ++++ b/tools/tiff2pdf.c +@@ -237,7 +237,7 @@ typedef struct { + float tiff_whitechromaticities[2]; + float tiff_primarychromaticities[6]; + float tiff_referenceblackwhite[2]; +- float* tiff_transferfunction[3]; ++ uint16* tiff_transferfunction[3]; + int pdf_image_interpolate; /* 0 (default) : do not interpolate, + 1 : interpolate */ + uint16 tiff_transferfunctioncount; +@@ -1047,6 +1047,8 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){ + uint16 pagen=0; + uint16 paged=0; + uint16 xuint16=0; ++ uint16 tiff_transferfunctioncount=0; ++ uint16* tiff_transferfunction[3]; + + directorycount=TIFFNumberOfDirectories(input); + t2p->tiff_pages = (T2P_PAGE*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,directorycount,sizeof(T2P_PAGE))); +@@ -1147,26 +1149,48 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){ + } + #endif + if (TIFFGetField(input, TIFFTAG_TRANSFERFUNCTION, +- &(t2p->tiff_transferfunction[0]), +- &(t2p->tiff_transferfunction[1]), +- &(t2p->tiff_transferfunction[2]))) { +- if((t2p->tiff_transferfunction[1] != (float*) NULL) && +- (t2p->tiff_transferfunction[2] != (float*) NULL) && +- (t2p->tiff_transferfunction[1] != +- t2p->tiff_transferfunction[0])) { +- t2p->tiff_transferfunctioncount = 3; +- t2p->tiff_pages[i].page_extra += 4; +- t2p->pdf_xrefcount += 4; +- } else { +- t2p->tiff_transferfunctioncount = 1; +- t2p->tiff_pages[i].page_extra += 2; +- t2p->pdf_xrefcount += 2; +- } +- if(t2p->pdf_minorversion < 2) +- t2p->pdf_minorversion = 2; ++ &(tiff_transferfunction[0]), ++ &(tiff_transferfunction[1]), ++ &(tiff_transferfunction[2]))) { ++ ++ if((tiff_transferfunction[1] != (uint16*) NULL) && ++ (tiff_transferfunction[2] != (uint16*) NULL) ++ ) { ++ tiff_transferfunctioncount=3; ++ } else { ++ tiff_transferfunctioncount=1; ++ } + } else { +- t2p->tiff_transferfunctioncount=0; ++ tiff_transferfunctioncount=0; + } ++ ++ if (i > 0){ ++ if (tiff_transferfunctioncount != t2p->tiff_transferfunctioncount){ ++ TIFFError( ++ TIFF2PDF_MODULE, ++ "Different transfer function on page %d", ++ i); ++ t2p->t2p_error = T2P_ERR_ERROR; ++ return; ++ } ++ } ++ ++ t2p->tiff_transferfunctioncount = tiff_transferfunctioncount; ++ t2p->tiff_transferfunction[0] = tiff_transferfunction[0]; ++ t2p->tiff_transferfunction[1] = tiff_transferfunction[1]; ++ t2p->tiff_transferfunction[2] = tiff_transferfunction[2]; ++ if(tiff_transferfunctioncount == 3){ ++ t2p->tiff_pages[i].page_extra += 4; ++ t2p->pdf_xrefcount += 4; ++ if(t2p->pdf_minorversion < 2) ++ t2p->pdf_minorversion = 2; ++ } else if (tiff_transferfunctioncount == 1){ ++ t2p->tiff_pages[i].page_extra += 2; ++ t2p->pdf_xrefcount += 2; ++ if(t2p->pdf_minorversion < 2) ++ t2p->pdf_minorversion = 2; ++ } ++ + if( TIFFGetField( + input, + TIFFTAG_ICCPROFILE, +@@ -1827,10 +1851,9 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){ + &(t2p->tiff_transferfunction[0]), + &(t2p->tiff_transferfunction[1]), + &(t2p->tiff_transferfunction[2]))) { +- if((t2p->tiff_transferfunction[1] != (float*) NULL) && +- (t2p->tiff_transferfunction[2] != (float*) NULL) && +- (t2p->tiff_transferfunction[1] != +- t2p->tiff_transferfunction[0])) { ++ if((t2p->tiff_transferfunction[1] != (uint16*) NULL) && ++ (t2p->tiff_transferfunction[2] != (uint16*) NULL) ++ ) { + t2p->tiff_transferfunctioncount=3; + } else { + t2p->tiff_transferfunctioncount=1; diff --git a/mail/fdm/Makefile b/mail/fdm/Makefile index 49c02f15e..997671465 100644 --- a/mail/fdm/Makefile +++ b/mail/fdm/Makefile @@ -12,9 +12,9 @@ PKG_VERSION:=1.7 PKG_RELEASE:=1 PKG_LICENSE:=BSD-2-Clause -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=@SF/fdm -PKG_MD5SUM:=aea0421571e8f3ec8f747a5d72c84348 +PKG_SOURCE:=$(PKG_VERSION).zip +PKG_SOURCE_URL:=https://github.com/nicm/fdm/archive +PKG_MD5SUM:=b4195f5503702b6b07714ad8417f531a PKG_INSTALL:=1 diff --git a/multimedia/crtmpserver/Makefile b/multimedia/crtmpserver/Makefile index 5f2a31eb4..dd31f3349 100644 --- a/multimedia/crtmpserver/Makefile +++ b/multimedia/crtmpserver/Makefile @@ -8,19 +8,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=crtmpserver -PKG_REV:=811 -PKG_VERSION:=r$(PKG_REV) -PKG_RELEASE:=1 +PKG_REV:=b6fdcdb +PKG_VERSION:=2012-07-18+git-$(PKG_REV) +PKG_RELEASE:=2 PKG_BUILD_PARALLEL:=2 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> PKG_LICENSE:=GPL-3.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=--username=anonymous --password= https://svn.rtmpd.com/crtmpserver/branches/1.0 +PKG_SOURCE_URL:=https://github.com/j0sh/crtmpserver.git PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_SOURCE_PROTO:=svn +PKG_SOURCE_PROTO:=git include $(INCLUDE_DIR)/package.mk @@ -66,6 +66,9 @@ define Build/Configure -e 's,^OPTIMIZATIONS[[:space:]]*=.*,OPTIMIZATIONS=-O2,' \ -e 's,^SSL_BASE[[:space:]]*=.*,SSL_BASE=$(STAGING_DIR)/usr,' \ linux-openwrt-uclibc.mk) + (cd $(PKG_BUILD_DIR)/sources/common/include/; \ + echo '#define CRTMPSERVER_VERSION_RELEASE_NUMBER "$(PKG_VERSION)\n"' > version.h; \ + echo '#define CRTMPSERVER_VERSION_CODE_NAME "Git\n"' >> version.h) endef define Build/Compile diff --git a/multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch b/multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch index ec758188e..cc49523ae 100644 --- a/multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch +++ b/multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch @@ -1,6 +1,6 @@ --- a/builders/make/compile.mk +++ b/builders/make/compile.mk -@@ -67,7 +67,7 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny +@@ -72,7 +72,7 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny #common COMMON_INCLUDE=$(LUA_INCLUDE) $(TINYXML_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include diff --git a/multimedia/crtmpserver/patches/030-default-config.patch b/multimedia/crtmpserver/patches/030-default-config.patch index c37644ce9..2975f000c 100644 --- a/multimedia/crtmpserver/patches/030-default-config.patch +++ b/multimedia/crtmpserver/patches/030-default-config.patch @@ -23,7 +23,7 @@ -- It is optional. If not specified, it will be defaulted to: -- <rootDirectory>/<name>/mediaFolder - -- mediaFolder="/some/directory/where/media/files/are/stored" -+ mediaFolder="/usr/share/crtmpserver/appselector", ++ mediaFolder="/media", -- the application will also be known by that names. It is optional --aliases= --{ @@ -41,16 +41,7 @@ port=8080, protocol="inboundRtmpt" }, -@@ -105,7 +98,7 @@ configuration= - description="FLV Playback Sample", - name="flvplayback", - protocol="dynamiclinklibrary", -- mediaFolder="/Volumes/android/backup/media/", -+ mediaFolder="/media/", - aliases= - { - "simpleLive", -@@ -183,6 +176,7 @@ configuration= +@@ -184,6 +177,7 @@ configuration= name="samplefactory", description="asdsadasdsa", protocol="dynamiclinklibrary", diff --git a/multimedia/crtmpserver/patches/040-use-select.patch b/multimedia/crtmpserver/patches/040-use-select.patch index 466f86c9e..380208e80 100644 --- a/multimedia/crtmpserver/patches/040-use-select.patch +++ b/multimedia/crtmpserver/patches/040-use-select.patch @@ -1,7 +1,5 @@ -Index: crtmpserver-r726/builders/make/linux.mk -=================================================================== ---- crtmpserver-r726.orig/builders/make/linux.mk -+++ crtmpserver-r726/builders/make/linux.mk +--- a/builders/make/linux.mk ++++ b/builders/make/linux.mk @@ -38,7 +38,7 @@ dynamic_exec_flags = $(FPIC) $(OPTIMIZAT PLATFORM_DEFINES = \ -DLINUX \ diff --git a/multimedia/crtmpserver/patches/050-add-missing-make-defines.patch b/multimedia/crtmpserver/patches/050-add-missing-make-defines.patch index f9ff617b9..25694b8f7 100644 --- a/multimedia/crtmpserver/patches/050-add-missing-make-defines.patch +++ b/multimedia/crtmpserver/patches/050-add-missing-make-defines.patch @@ -1,22 +1,6 @@ --- a/builders/make/compile.mk +++ b/builders/make/compile.mk -@@ -43,17 +43,22 @@ FEATURES_DEFINES = \ - -DHAS_PROTOCOL_RTP \ - -DHAS_PROTOCOL_TS \ - -DHAS_PROTOCOL_VAR \ -+ -DHAS_PROTOCOL_CLI \ -+ -DHAS_PROTOCOL_HLS \ -+ -DHAS_PROTOCOL_RAWHTTPSTREAM \ - -DHAS_LUA \ - -DHAS_MEDIA_MP3 \ - -DHAS_MEDIA_MP4 \ -- -DHAS_MEDIA_FLV -+ -DHAS_MEDIA_FLV \ -+ -DHAS_SYSLOG -+ - - - DEFINES = $(PLATFORM_DEFINES) $(FEATURES_DEFINES) +@@ -58,7 +58,7 @@ DEFINES = $(PLATFORM_DEFINES) $(FEATURES #library paths SSL_INCLUDE=-I$(SSL_BASE)/include @@ -25,7 +9,7 @@ #lua LUA_INCLUDE=-I$(PROJECT_BASE_PATH)/3rdparty/lua-dev -@@ -67,25 +72,25 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny +@@ -72,25 +72,25 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny #common COMMON_INCLUDE=$(LUA_INCLUDE) $(TINYXML_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include diff --git a/multimedia/crtmpserver/patches/060-add-missing-includes.patch b/multimedia/crtmpserver/patches/060-add-missing-includes.patch index 505b5f337..7b9da39a2 100644 --- a/multimedia/crtmpserver/patches/060-add-missing-includes.patch +++ b/multimedia/crtmpserver/patches/060-add-missing-includes.patch @@ -23,4 +23,4 @@ + #include "utils/logging/fileloglocation.h" #include "utils/lua/luautils.h" - + #include "utils/misc/file.h" diff --git a/multimedia/crtmpserver/patches/070-missing-include-gcc-47.patch b/multimedia/crtmpserver/patches/070-missing-include-gcc-47.patch index 94d80e793..534046f07 100644 --- a/multimedia/crtmpserver/patches/070-missing-include-gcc-47.patch +++ b/multimedia/crtmpserver/patches/070-missing-include-gcc-47.patch @@ -5,6 +5,6 @@ #include <iostream> #include <sstream> +#include "lstate.h" + using namespace std; // Help out windows: - #if defined( _DEBUG ) && !defined( DEBUG ) diff --git a/multimedia/crtmpserver/patches/080-disable-apple-streaming.patch b/multimedia/crtmpserver/patches/080-disable-apple-streaming.patch new file mode 100644 index 000000000..cde14fe4b --- /dev/null +++ b/multimedia/crtmpserver/patches/080-disable-apple-streaming.patch @@ -0,0 +1,12 @@ +--- a/builders/make/apps.mk ++++ b/builders/make/apps.mk +@@ -110,6 +110,6 @@ vptests: thelib $(VPTESTS_OBJS) + %.vptests.o: %.cpp + $(CXXCOMPILER) $(COMPILE_FLAGS) $(DEFINES) $(VPTESTS_INCLUDE) -c $< -o $@ + +-ALL_APPS_OBJS= $(ADMIN_OBJS) $(APPLESTREAMINGCLIENT_OBJS) $(APPSELECTOR_OBJS) $(FLVPLAYBACK_OBJS) $(PROXYPUBLISH_OBJS) $(SAMPLEFACTORY_OBJS) $(STRESSTEST_OBJS) $(VPTESTS_OBJS) +-ACTIVE_APPS= -DHAS_APP_ADMIN -DHAS_APP_APPLESTREAMINGCLIENT -DHAS_APP_APPSELECTOR -DHAS_APP_FLVPLAYBACK -DHAS_APP_PROXYPUBLISH -DHAS_APP_SAMPLEFACTORY -DHAS_APP_STRESSTEST -DHAS_APP_VPTESTS +-applications: thelib admin applestreamingclient appselector flvplayback proxypublish samplefactory stresstest vptests ++ALL_APPS_OBJS= $(ADMIN_OBJS) $(APPSELECTOR_OBJS) $(FLVPLAYBACK_OBJS) $(PROXYPUBLISH_OBJS) $(SAMPLEFACTORY_OBJS) $(STRESSTEST_OBJS) $(VPTESTS_OBJS) ++ACTIVE_APPS= -DHAS_APP_ADMIN -DHAS_APP_APPSELECTOR -DHAS_APP_FLVPLAYBACK -DHAS_APP_PROXYPUBLISH -DHAS_APP_SAMPLEFACTORY -DHAS_APP_STRESSTEST -DHAS_APP_VPTESTS ++applications: thelib admin appselector flvplayback proxypublish samplefactory stresstest vptests diff --git a/multimedia/oggfwd/Makefile b/multimedia/oggfwd/Makefile index 8caf7f1ac..3aac82ba0 100644 --- a/multimedia/oggfwd/Makefile +++ b/multimedia/oggfwd/Makefile @@ -13,7 +13,7 @@ PKG_VERSION:=20150412 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=git://r-w-x.org/oggfwd.git +PKG_SOURCE_URL:=https://r-w-x.org/oggfwd.git PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_REV) diff --git a/multimedia/xupnpd/Makefile b/multimedia/xupnpd/Makefile index 9522e83fd..a533a0773 100644 --- a/multimedia/xupnpd/Makefile +++ b/multimedia/xupnpd/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2013-2015 OpenWrt.org +# Copyright (C) 2013-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,15 +8,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xupnpd -PKG_REV:=404 -PKG_VERSION:=$(PKG_REV) +PKG_REV:=5c08c051caa0062cc1c401b2d26d1f36dffe9c55 +PKG_VERSION:=2016-07-06 PKG_RELEASE:=1 -PKG_SOURCE_PROTO:=svn +PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_SOURCE_SUBDIR:=xupnpd-$(PKG_VERSION) -PKG_SOURCE_URL:=http://tsdemuxer.googlecode.com/svn/trunk/xupnpd/src/ +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=https://github.com/clark15b/xupnpd.git PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz + +PKG_LICENSE:=GPLv2 +PKG_LICENSE_FILES:=LICENSE + PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com> include $(INCLUDE_DIR)/package.mk @@ -24,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk LUA_FLAGS:=-llua define Build/Compile - (cd $(PKG_BUILD_DIR); $(TARGET_CC) -v $(LUA_FLAGS) $(TARGET_CFLAGS) -fno-exceptions -fno-rtti -DWITH_URANDOM $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) -lm -ldl -lcrypt -o xupnpd *.c *.cpp) + (cd $(PKG_BUILD_DIR)/src; $(TARGET_CC) -v $(LUA_FLAGS) $(TARGET_CFLAGS) -fno-exceptions -fno-rtti -DWITH_URANDOM $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) -lm -ldl -lcrypt -o xupnpd *.c *.cpp) endef define Package/xupnpd @@ -50,18 +54,18 @@ endef define Package/xupnpd/install $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/xupnpd $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xupnpd $(1)/usr/bin $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/xupnpd.init $(1)/etc/init.d/xupnpd $(INSTALL_DIR) $(1)/usr/share/xupnpd - $(CP) $(PKG_BUILD_DIR)/*.lua $(1)/usr/share/xupnpd + $(CP) $(PKG_BUILD_DIR)/src/*.lua $(1)/usr/share/xupnpd $(INSTALL_DIR) $(1)/usr/share/xupnpd/ui - $(CP) $(PKG_BUILD_DIR)/ui/* $(1)/usr/share/xupnpd/ui + $(CP) $(PKG_BUILD_DIR)/src/ui/* $(1)/usr/share/xupnpd/ui $(INSTALL_DIR) $(1)/usr/share/xupnpd/www - $(CP) $(PKG_BUILD_DIR)/www/* $(1)/usr/share/xupnpd/www + $(CP) $(PKG_BUILD_DIR)/src/www/* $(1)/usr/share/xupnpd/www $(INSTALL_DIR) $(1)/usr/share/xupnpd/playlists $(INSTALL_DIR) $(1)/usr/share/xupnpd/plugins - $(CP) $(PKG_BUILD_DIR)/plugins/* $(1)/usr/share/xupnpd/plugins + $(CP) $(PKG_BUILD_DIR)/src/plugins/* $(1)/usr/share/xupnpd/plugins $(INSTALL_DIR) $(1)/usr/share/xupnpd/config $(INSTALL_DIR) $(1)/etc/xupnpd (cd $(1)/etc/xupnpd; ln -s ../../usr/share/xupnpd/config ./; ln -s ../../usr/share/xupnpd/xupnpd.lua ./) diff --git a/multimedia/xupnpd/patches/100-default_config.patch b/multimedia/xupnpd/patches/100-default_config.patch index 89958c7fe..dee21a997 100644 --- a/multimedia/xupnpd/patches/100-default_config.patch +++ b/multimedia/xupnpd/patches/100-default_config.patch @@ -1,5 +1,5 @@ ---- a/xupnpd.lua -+++ b/xupnpd.lua +--- a/src/xupnpd.lua ++++ b/src/xupnpd.lua @@ -1,10 +1,10 @@ cfg={} diff --git a/multimedia/xupnpd/patches/101-root_dir_param.patch b/multimedia/xupnpd/patches/101-root_dir_param.patch index 68ea3e82e..4dac9d944 100644 --- a/multimedia/xupnpd/patches/101-root_dir_param.patch +++ b/multimedia/xupnpd/patches/101-root_dir_param.patch @@ -1,5 +1,5 @@ ---- a/main.cpp -+++ b/main.cpp +--- a/src/main.cpp ++++ b/src/main.cpp @@ -4,11 +4,14 @@ * https://tsdemuxer.googlecode.com/svn/trunk/xupnpd */ diff --git a/net/apache/Makefile b/net/apache/Makefile index f5de16377..1ea1dd078 100644 --- a/net/apache/Makefile +++ b/net/apache/Makefile @@ -16,7 +16,8 @@ PKG_LICENSE:=Apache License PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://mirrors.ibiblio.org/apache/httpd/ \ - http://apache.imsam.info/httpd/ + http://apache.imsam.info/httpd/ \ + https://archive.apache.org/dist/httpd/ PKG_MD5SUM:=6c10e15835ab214464228a9beb7afba8 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION) diff --git a/net/bind/Makefile b/net/bind/Makefile index 5764fb2b5..8f4ed4bd5 100644 --- a/net/bind/Makefile +++ b/net/bind/Makefile @@ -1,6 +1,6 @@ # # Copyright (C) 2006-2012 OpenWrt.org -# 2014 Noah Meyerhans <frodo@morgul.net> +# 2014-2016 Noah Meyerhans <frodo@morgul.net> # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bind -PKG_VERSION:=9.9.8-P3 +PKG_VERSION:=9.11.2 PKG_RELEASE:=1 USERID:=bind=57:bind=57 @@ -18,14 +18,15 @@ PKG_LICENSE := BSD-3-Clause PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:= \ - ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \ - http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) -PKG_MD5SUM:=30b9bf88a78eee783d3fef5257445788 + http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \ + http://ftp.isc.org/isc/bind9/$(PKG_VERSION) +PKG_MD5SUM:=efca7e5a63a07efba264da9be2fbb57f PKG_FIXUP:=autoreconf PKG_REMOVE_FILES:=aclocal.m4 libtool.m4 PKG_INSTALL:=1 +PKG_USE_MIPS16:=0 include $(INCLUDE_DIR)/package.mk @@ -41,7 +42,7 @@ endef define Package/bind-libs SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libopenssl + DEPENDS:=+libopenssl +zlib TITLE:=bind shared libraries URL:=https://www.isc.org/software/bind endef @@ -73,7 +74,7 @@ endef define Package/bind-dnssec $(call Package/bind/Default) - TITLE+= administration tools (dnssec-keygen and dnssec-signzone only) + TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only) endef define Package/bind-host @@ -95,6 +96,7 @@ CONFIGURE_ARGS += \ --disable-threads \ --disable-linux-caps \ --with-openssl="$(STAGING_DIR)/usr" \ + --with-libjson=no \ --with-libtool \ --with-libxml2=no \ --enable-epoll=yes \ @@ -102,6 +104,7 @@ CONFIGURE_ARGS += \ --with-gssapi=no \ --with-ecdsa=no \ --with-readline=no + --sysconfdir=/etc/bind CONFIGURE_VARS += \ BUILD_CC="$(TARGET_CC)" \ @@ -158,6 +161,7 @@ define Package/bind-tools/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/ $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/ @@ -180,6 +184,7 @@ endef define Package/bind-dnssec/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/ endef diff --git a/net/bind/files/bind/db.root b/net/bind/files/bind/db.root index 0eb52af7a..f0b79d2af 100644 --- a/net/bind/files/bind/db.root +++ b/net/bind/files/bind/db.root @@ -1,45 +1,90 @@ - -; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net. -;; global options: printcmd -;; Got answer: -;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944 -;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13 - -;; QUESTION SECTION: -;. IN NS - -;; ANSWER SECTION: -. 518400 IN NS A.ROOT-SERVERS.NET. -. 518400 IN NS B.ROOT-SERVERS.NET. -. 518400 IN NS C.ROOT-SERVERS.NET. -. 518400 IN NS D.ROOT-SERVERS.NET. -. 518400 IN NS E.ROOT-SERVERS.NET. -. 518400 IN NS F.ROOT-SERVERS.NET. -. 518400 IN NS G.ROOT-SERVERS.NET. -. 518400 IN NS H.ROOT-SERVERS.NET. -. 518400 IN NS I.ROOT-SERVERS.NET. -. 518400 IN NS J.ROOT-SERVERS.NET. -. 518400 IN NS K.ROOT-SERVERS.NET. -. 518400 IN NS L.ROOT-SERVERS.NET. -. 518400 IN NS M.ROOT-SERVERS.NET. - -;; ADDITIONAL SECTION: -A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4 -B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201 -C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12 -D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90 -E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10 -F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241 -G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4 -H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53 -I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17 -J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30 -K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129 -L.ROOT-SERVERS.NET. 3600000 IN A 199.7.83.42 -M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33 - -;; Query time: 81 msec -;; SERVER: 198.41.0.4#53(a.root-servers.net.) -;; WHEN: Sun Feb 1 11:27:14 2004 -;; MSG SIZE rcvd: 436 - +; This file holds the information on root name servers needed to +; initialize cache of Internet domain name servers +; (e.g. reference this file in the "cache . <file>" +; configuration file of BIND domain name servers). +; +; This file is made available by InterNIC +; under anonymous FTP as +; file /domain/named.cache +; on server FTP.INTERNIC.NET +; -OR- RS.INTERNIC.NET +; +; last update: February 17, 2016 +; related version of root zone: 2016021701 +; +; formerly NS.INTERNIC.NET +; +. 3600000 NS A.ROOT-SERVERS.NET. +A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 +A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:ba3e::2:30 +; +; FORMERLY NS1.ISI.EDU +; +. 3600000 NS B.ROOT-SERVERS.NET. +B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 +B.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:84::b +; +; FORMERLY C.PSI.NET +; +. 3600000 NS C.ROOT-SERVERS.NET. +C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 +C.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2::c +; +; FORMERLY TERP.UMD.EDU +; +. 3600000 NS D.ROOT-SERVERS.NET. +D.ROOT-SERVERS.NET. 3600000 A 199.7.91.13 +D.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2d::d +; +; FORMERLY NS.NASA.GOV +; +. 3600000 NS E.ROOT-SERVERS.NET. +E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 +; +; FORMERLY NS.ISC.ORG +; +. 3600000 NS F.ROOT-SERVERS.NET. +F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 +F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f +; +; FORMERLY NS.NIC.DDN.MIL +; +. 3600000 NS G.ROOT-SERVERS.NET. +G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 +; +; FORMERLY AOS.ARL.ARMY.MIL +; +. 3600000 NS H.ROOT-SERVERS.NET. +H.ROOT-SERVERS.NET. 3600000 A 198.97.190.53 +H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::53 +; +; FORMERLY NIC.NORDU.NET +; +. 3600000 NS I.ROOT-SERVERS.NET. +I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 +I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fe::53 +; +; OPERATED BY VERISIGN, INC. +; +. 3600000 NS J.ROOT-SERVERS.NET. +J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 +J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:c27::2:30 +; +; OPERATED BY RIPE NCC +; +. 3600000 NS K.ROOT-SERVERS.NET. +K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 +K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1 +; +; OPERATED BY ICANN +; +. 3600000 NS L.ROOT-SERVERS.NET. +L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 +L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 +; +; OPERATED BY WIDE +; +. 3600000 NS M.ROOT-SERVERS.NET. +M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 +M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35 +; End of file diff --git a/net/bind/files/named.init b/net/bind/files/named.init index 2ef7797ba..b7876d9e1 100644 --- a/net/bind/files/named.init +++ b/net/bind/files/named.init @@ -13,7 +13,6 @@ pid_file=/var/run/named/named.pid logdir=/var/log/named/ cachedir=/var/cache/bind libdir=/var/lib/bind -config_file=/etc/bind/named.conf fix_perms() { for dir in $libdir $logdir $cachedir; do diff --git a/net/bind/patches/001-no-tests.patch b/net/bind/patches/001-no-tests.patch index c969c5e96..2d0c152f7 100644 --- a/net/bind/patches/001-no-tests.patch +++ b/net/bind/patches/001-no-tests.patch @@ -1,26 +1,26 @@ -Index: bind-9.9.4/bin/Makefile.in +Index: bind-9.10.4-P3/bin/Makefile.in =================================================================== ---- bind-9.9.4.orig/bin/Makefile.in -+++ bind-9.9.4/bin/Makefile.in -@@ -19,7 +19,7 @@ srcdir = @srcdir@ +--- bind-9.10.4-P3.orig/bin/Makefile.in ++++ bind-9.10.4-P3/bin/Makefile.in +@@ -10,7 +10,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ top_srcdir = @top_srcdir@ --SUBDIRS = named rndc dig dnssec tools tests nsupdate \ -+SUBDIRS = named rndc dig dnssec tools nsupdate \ - check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@ +-SUBDIRS = named rndc dig delv dnssec tools tests nsupdate \ ++SUBDIRS = named rndc dig delv dnssec tools nsupdate \ + check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ TARGETS = -Index: bind-9.9.4/lib/Makefile.in +Index: bind-9.10.4-P3/lib/Makefile.in =================================================================== ---- bind-9.9.4.orig/lib/Makefile.in -+++ bind-9.9.4/lib/Makefile.in -@@ -23,7 +23,7 @@ top_srcdir = @top_srcdir@ +--- bind-9.10.4-P3.orig/lib/Makefile.in ++++ bind-9.10.4-P3/lib/Makefile.in +@@ -14,7 +14,7 @@ top_srcdir = @top_srcdir@ # Attempt to disable parallel processing. .NOTPARALLEL: .NO_PARALLEL: --SUBDIRS = isc isccc dns isccfg bind9 lwres tests -+SUBDIRS = isc isccc dns isccfg bind9 lwres +-SUBDIRS = isc isccc dns isccfg bind9 lwres irs tests samples ++SUBDIRS = isc isccc dns isccfg bind9 lwres irs samples TARGETS = @BIND9_MAKE_RULES@ diff --git a/net/bind/patches/002-autoconf-ar-fix.patch b/net/bind/patches/002-autoconf-ar-fix.patch index 501fa7d3b..878554fae 100644 --- a/net/bind/patches/002-autoconf-ar-fix.patch +++ b/net/bind/patches/002-autoconf-ar-fix.patch @@ -1,6 +1,8 @@ ---- a/configure.in -+++ b/configure.in -@@ -93,26 +93,11 @@ esac +Index: bind-9.10.4-P3/configure.in +=================================================================== +--- bind-9.10.4-P3.orig/configure.in ++++ bind-9.10.4-P3/configure.in +@@ -157,26 +157,11 @@ esac # AC_CONFIG_FILES([make/rules make/includes]) diff --git a/net/irssi/Makefile b/net/irssi/Makefile index 3fbfef115..6b6820d02 100644 --- a/net/irssi/Makefile +++ b/net/irssi/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=irssi -PKG_VERSION:=0.8.17 +PKG_VERSION:=0.8.21 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://irssi.org/files/ -PKG_MD5SUM:=ecf64be47978d89a742b435a81cb47db +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/irssi/irssi/releases/download/0.8.21/ +PKG_MD5SUM:=b820760c3b4f3b0c24abe4db82b6366a PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -64,7 +64,6 @@ CONFIGURE_ARGS += \ --with-perl=no \ --with-glib-prefix="$(STAGING_DIR)/usr" \ --with-textui \ - --without-terminfo \ --without-bot \ --disable-proxy diff --git a/net/netperf/Makefile b/net/netperf/Makefile index fd824ba7c..da16ee33b 100644 --- a/net/netperf/Makefile +++ b/net/netperf/Makefile @@ -13,8 +13,12 @@ PKG_RELEASE:=1 PKG_LICENSE:=Custom PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=ftp://ftp.netperf.org/netperf/ -PKG_MD5SUM:=ad1c5342d61f297c417a93133aeba65a +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=https://github.com/HewlettPackard/netperf.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=f46c031 + +#PKG_MD5SUM:=ad1c5342d61f297c417a93133aeba65a include $(INCLUDE_DIR)/package.mk diff --git a/net/nginx/Config.in b/net/nginx/Config.in index b135e42d4..4cec04026 100644 --- a/net/nginx/Config.in +++ b/net/nginx/Config.in @@ -1,5 +1,5 @@ # -# Copyright (C) 2010-2012 OpenWrt.org +# Copyright (C) 2010-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,44 +8,33 @@ menu "Configuration" depends on PACKAGE_nginx -config NGINX_STUB_STATUS - bool - prompt "Enable stub status module" - help - Enable the stub status module which gives some status from the server. - -config NGINX_FLV - bool - prompt "Enable FLV module" - help - Provides the ability to seek within FLV (Flash) files using time-based offsets. - config NGINX_SSL bool prompt "Enable SSL module" help Enable HTTPS/SSL support. + default n config NGINX_DAV bool prompt "Enable WebDAV module" help Enable the HTTP and WebDAV methods PUT, DELETE, MKCOL, COPY and MOVE. + default n -config NGINX_LUA +config NGINX_FLV bool - prompt "Enable LUA module" + prompt "Enable FLV module" help - Enable support for LUA scripts. - -config NGINX_PCRE - bool - prompt "Enable PCRE library usage" - default y + Provides the ability to seek within FLV (Flash) files using time-based offsets. + default n -config NGINX_HTTP_CACHE +config NGINX_STUB_STATUS bool - prompt "Enable HTTP cache" + prompt "Enable stub status module" + help + Enable the stub status module which gives some status from the server. + default n config NGINX_HTTP_CHARSET bool @@ -77,6 +66,11 @@ config NGINX_HTTP_AUTH_BASIC prompt "Enable HTTP auth basic" default y +config NGINX_HTTP_AUTH_REQUEST + bool + prompt "Enable HTTP auth request module" + default n + config NGINX_HTTP_AUTOINDEX bool prompt "Enable HTTP autoindex module" @@ -153,40 +147,59 @@ config NGINX_HTTP_BROWSER prompt "Enable HTTP browser module" default y +config NGINX_HTTP_UPSTREAM_HASH + bool + prompt "Enable HTTP hash module" + default y + config NGINX_HTTP_UPSTREAM_IP_HASH bool prompt "Enable HTTP IP hash module" default y +config NGINX_HTTP_UPSTREAM_LEAST_CONN + bool + prompt "Enable HTTP least conn module" + default y + +config NGINX_HTTP_UPSTREAM_KEEPALIVE + bool + prompt "Enable HTTP keepalive module" + default y + +config NGINX_HTTP_CACHE + bool + prompt "Enable HTTP cache" + default y + +config NGINX_HTTP_V2 + bool + prompt "Enable HTTP_V2 module" + default n + +config NGINX_PCRE + bool + prompt "Enable PCRE library usage" + default y + config NGINX_NAXSI bool prompt "Enable NAXSI module" - select PACKAGE_nginx-naxsi default y - help - Enable support for NAXSI WAF. -config NGINX_PROXYPROTOCOL +config NGINX_LUA bool - prompt "Enable HAProxy proxyprotocol" - select PACKAGE_nginx-proxyprotocol - select NGINX_SSL + prompt "Enable Lua module" default n - help - Enable support for PROXY PROTOCOL -config NGINX_SYSLOG +config NGINX_HTTP_REAL_IP bool - prompt "Enable Syslog module" - select PACKAGE_nginx-syslog - default y - help - Provides the ability log to a remote destination + prompt "Enable HTTP real ip module" + default n -config NGINX_HTTP_UPSTREAM_CHECK +config NGINX_HTTP_SECURE_LINK bool - select NGINX_SSL - prompt "Enable HTTP upstream check module" + prompt "Enable HTTP secure link module" default n endmenu diff --git a/net/nginx/Makefile b/net/nginx/Makefile index e93326e52..6552b4602 100644 --- a/net/nginx/Makefile +++ b/net/nginx/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2009-2012 OpenWrt.org +# Copyright (C) 2012-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,32 +8,32 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nginx -PKG_VERSION:=1.4.7 -PKG_RELEASE:=2 +PKG_VERSION:=1.12.1 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://nginx.org/download/ -PKG_MD5SUM:=aee151d298dcbfeb88b3f7dd3e7a4d17 +PKG_HASH:=8793bf426485a30f91021b6b945a9fd8a84d87d17b566562c3797aba8fac76fb PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> PKG_LICENSE:=2-clause BSD-like license +PKG_BUILD_DIR:=$(BUILD_DIR)/nginx-$(PKG_VERSION) + PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 PKG_CONFIG_DEPENDS := \ - CONFIG_NGINX_STUB_STATUS \ - CONFIG_NGINX_FLV \ CONFIG_NGINX_SSL \ CONFIG_NGINX_DAV \ - CONFIG_NGINX_LUA \ - CONFIG_NGINX_PCRE \ - CONFIG_NGINX_HTTP_CACHE \ + CONFIG_NGINX_FLV \ + CONFIG_NGINX_STUB_STATUS \ CONFIG_NGINX_HTTP_CHARSET \ CONFIG_NGINX_HTTP_GZIP \ CONFIG_NGINX_HTTP_SSI \ CONFIG_NGINX_HTTP_USERID \ CONFIG_NGINX_HTTP_ACCESS \ CONFIG_NGINX_HTTP_AUTH_BASIC \ + CONFIG_NGINX_HTTP_AUTH_REQUEST \ CONFIG_NGINX_HTTP_AUTOINDEX \ CONFIG_NGINX_HTTP_GEO \ CONFIG_NGINX_HTTP_MAP \ @@ -49,7 +49,18 @@ PKG_CONFIG_DEPENDS := \ CONFIG_NGINX_HTTP_LIMIT_REQ \ CONFIG_NGINX_HTTP_EMPTY_GIF \ CONFIG_NGINX_HTTP_BROWSER \ - CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH + CONFIG_NGINX_HTTP_UPSTREAM_HASH \ + CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH \ + CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN \ + CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE \ + CONFIG_NGINX_HTTP_UPSTREAM_ZONE \ + CONFIG_NGINX_HTTP_CACHE \ + CONFIG_NGINX_HTTP_V2 \ + CONFIG_NGINX_PCRE \ + CONFIG_NGINX_NAXSI \ + CONFIG_NGINX_LUA \ + CONFIG_NGINX_HTTP_REAL_IP \ + CONFIG_NGINX_HTTP_SECURE_LINK include $(INCLUDE_DIR)/package.mk @@ -59,7 +70,7 @@ define Package/nginx SUBMENU:=Web Servers/Proxies TITLE:=Nginx web server URL:=http://nginx.org/ - DEPENDS:=+NGINX_PCRE:libpcre +(NGINX_SSL||NGINX_HTTP_CACHE||NGINX_HTTP_AUTH_BASIC):libopenssl +NGINX_HTTP_GZIP:zlib +libpthread +NGINX_LUA:liblua + DEPENDS:=+NGINX_PCRE:libpcre +(NGINX_SSL||NGINX_HTTP_CACHE||NGINX_HTTP_AUTH_BASIC):libopenssl +NGINX_HTTP_GZIP:zlib +NGINX_LUA:liblua +libpthread MENU:=1 endef @@ -72,7 +83,7 @@ define Package/nginx/config source "$(SOURCE)/Config.in" endef -config_files=nginx.conf mime.types fastcgi_params koi-utf koi-win win-utf +config_files=nginx.conf mime.types define Package/nginx/conffiles /etc/nginx/ @@ -82,6 +93,9 @@ ADDITIONAL_MODULES:= ifeq ($(CONFIG_NGINX_NAXSI),y) ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-naxsi/naxsi_src endif +ifeq ($(CONFIG_NGINX_LUA),y) + ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/lua-nginx +endif ifeq ($(CONFIG_IPV6),y) ADDITIONAL_MODULES += --with-ipv6 endif @@ -97,9 +111,6 @@ endif ifeq ($(CONFIG_NGINX_DAV),y) ADDITIONAL_MODULES += --with-http_dav_module endif -ifeq ($(CONFIG_NGINX_LUA),y) - ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/lua-nginx -endif ifneq ($(CONFIG_NGINX_HTTP_CACHE),y) ADDITIONAL_MODULES += --without-http-cache endif @@ -108,6 +119,8 @@ ifneq ($(CONFIG_NGINX_PCRE),y) endif ifneq ($(CONFIG_NGINX_HTTP_CHARSET),y) ADDITIONAL_MODULES += --without-http_charset_module +else + config_files += koi-utf koi-win win-utf endif ifneq ($(CONFIG_NGINX_HTTP_GZIP),y) ADDITIONAL_MODULES += --without-http_gzip_module @@ -124,6 +137,9 @@ endif ifneq ($(CONFIG_NGINX_HTTP_AUTH_BASIC),y) ADDITIONAL_MODULES += --without-http_auth_basic_module endif +ifeq ($(CONFIG_NGINX_HTTP_AUTH_REQUEST),y) + ADDITIONAL_MODULES += --with-http_auth_request_module +endif ifneq ($(CONFIG_NGINX_HTTP_AUTOINDEX),y) ADDITIONAL_MODULES += --without-http_autoindex_module endif @@ -147,6 +163,8 @@ ifneq ($(CONFIG_NGINX_HTTP_PROXY),y) endif ifneq ($(CONFIG_NGINX_HTTP_FASTCGI),y) ADDITIONAL_MODULES += --without-http_fastcgi_module +else + config_files += fastcgi_params endif ifneq ($(CONFIG_NGINX_HTTP_UWSGI),y) ADDITIONAL_MODULES += --without-http_uwsgi_module @@ -169,22 +187,33 @@ endif ifneq ($(CONFIG_NGINX_HTTP_BROWSER),y) ADDITIONAL_MODULES += --without-http_browser_module endif +ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_HASH),y) + ADDITIONAL_MODULES += --without-http_upstream_hash_module +endif ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH),y) ADDITIONAL_MODULES += --without-http_upstream_ip_hash_module endif -ifeq ($(CONFIG_NGINX_PROXYPROTOCOL),y) - ADDITIONAL_MODULES += --with-proxy-protocol +ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN),y) + ADDITIONAL_MODULES += --without-http_upstream_least_conn_module +endif +ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE),y) + ADDITIONAL_MODULES += --without-http_upstream_keepalive_module endif -ifeq ($(CONFIG_NGINX_SYSLOG),y) - ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-syslog +ifeq ($(CONFIG_NGINX_HTTP_V2),y) + ADDITIONAL_MODULES += --with-http_v2_module endif -ifeq ($(CONFIG_NGINX_HTTP_UPSTREAM_CHECK),y) - ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-upstream-check +ifeq ($(CONFIG_NGINX_HTTP_REAL_IP),y) + ADDITIONAL_MODULES += --with-http_realip_module endif +ifeq ($(CONFIG_NGINX_HTTP_SECURE_LINK),y) + ADDITIONAL_MODULES += --with-http_secure_link_module +endif + +TARGET_CFLAGS += -fvisibility=hidden -ffunction-sections -fdata-sections -DNGX_LUA_NO_BY_LUA_BLOCK +TARGET_LDFLAGS += -Wl,--gc-sections define Build/Configure - # TODO: fix --crossbuild - (cd $(PKG_BUILD_DIR) ;\ + ( cd $(PKG_BUILD_DIR) ; \ $(if $(CONFIG_NGINX_LUA),LUA_INC=$(STAGING_DIR)/usr/include LUA_LIB=$(STAGING_DIR)/usr/lib) \ ./configure \ --crossbuild=Linux::$(ARCH) \ @@ -200,7 +229,9 @@ define Build/Configure --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ --with-cc="$(TARGET_CC)" \ --with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ - --with-ld-opt="$(TARGET_LDFLAGS)" ) + --with-ld-opt="$(TARGET_LDFLAGS)" \ + --without-http_upstream_zone_module \ + ) endef define Package/nginx/install @@ -210,80 +241,23 @@ define Package/nginx/install $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx +ifeq ($(CONFIG_NGINX_NAXSI),y) + $(INSTALL_DIR) $(1)/etc/nginx + $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-naxsi/naxsi_config/naxsi_core.rules $(1)/etc/nginx + chmod 0640 $(1)/etc/nginx/naxsi_core.rules +endif + $(if $(CONFIG_NGINX_NAXSI),$($(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-naxsi/naxsi_config/naxsi_core.rules $(1)/etc/nginx)) + $(if $(CONFIG_NGINX_NAXSI),$(chmod 0640 $(1)/etc/nginx/naxsi_core.rules)) endef define Build/Prepare $(call Build/Prepare/Default) - $(if $(CONFIG_NGINX_LUA),$(call Prepare/lua-nginx)) $(if $(CONFIG_NGINX_NAXSI),$(call Prepare/nginx-naxsi)) - $(if $(CONFIG_NGINX_SYSLOG),$(call Prepare/nginx-syslog)) - $(if $(CONFIG_NGINX_HTTP_UPSTREAM_CHECK),$(call Prepare/nginx-upstream-check)) -endef - -define Download/lua-nginx - VERSION:=d3ab0edd45bffe1b9a36abdf5bff544de436ccee - SUBDIR:=lua-nginx - FILE:=lua-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz - URL:=https://github.com/chaoslawful/lua-nginx-module.git - PROTO:=git -endef - -define Prepare/lua-nginx - $(eval $(call Download,lua-nginx)) - gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS) - $(call PatchDir,$(PKG_BUILD_DIR),./patches-lua-nginx) -endef - -define Download/nginx-upstream-check - VERSION:=d40b9f956d9d978005bb15616d2f283d4e3d2031 - SUBDIR:=nginx-upstream-check - FILE:=nginx-upstream-check-$(PKG_VERSION)-$$(VERSION).tar.gz - URL:=https://github.com/yaoweibin/nginx_upstream_check_module.git - PROTO:=git -endef - -define Prepare/nginx-upstream-check - $(eval $(call Download,nginx-upstream-check)) - gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS) - $(call PatchDir,$(PKG_BUILD_DIR),./patches-nginx-upstream-check) -endef - - -define Package/nginx-naxsi - MENU:=1 - $(call Package/nginx) - TITLE:=nginx-naxsi - DEPENDS:=nginx @NGINX_NAXSI -endef - -define Package/nginx-naxsi/description - NGINX WAF NAXSI -endef - -define Package/nginx-proxyprotocol - MENU:=1 - $(call Package/nginx) - TITLE:=nginx - DEPENDS:=nginx @NGINX_PROXYPROTOCOL -endef - -define Package/nginx-proxyprotocol/description - IMPLEMENT Proxy Protocol -endef - -define Package/nginx-syslog - MENU:=1 - $(call Package/nginx) - TITLE:=nginx-syslog - DEPENDS:=nginx @NGINX_SYSLOG -endef - -define Package/nginx-syslog/description - IMPLEMENT Syslog Protocol + $(if $(CONFIG_NGINX_LUA),$(call Prepare/lua-nginx)) endef define Download/nginx-naxsi - VERSION:=34dcb45fe4fdcb144c5258d83672f8e1e1c8db2e + VERSION:=cf73f9c8664127252c2a4958d2e169516d3845a1 SUBDIR:=nginx-naxsi FILE:=nginx-naxsi-module-$(PKG_VERSION)-$$(VERSION).tar.gz URL:=https://github.com/nbs-system/naxsi.git @@ -295,40 +269,18 @@ define Prepare/nginx-naxsi gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS) endef -define Package/nginx-naxsi/install - $(INSTALL_DIR) $(1)/etc/nginx - $(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-naxsi/naxsi_config/naxsi_core.rules $(1)/etc/nginx - chmod 0640 $(1)/etc/nginx/naxsi_core.rules -endef - -define Download/nginx-syslog - VERSION:=7abf48e52552c40a21463e1a8c608e0e575261cd - SUBDIR:=nginx-syslog - FILE:=nginx-syslog-module-$(PKG_VERSION)-$$(VERSION).tar.gz - URL:=https://github.com/splitice/nginx_syslog_patch.git +define Download/lua-nginx + VERSION:=cdd2ae921f67bf396c743406493127be496e57ce + SUBDIR:=lua-nginx + FILE:=lua-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz + URL:=https://github.com/openresty/lua-nginx-module.git PROTO:=git endef -define Prepare/nginx-syslog - $(eval $(call Download,nginx-syslog)) +define Prepare/lua-nginx + $(eval $(call Download,lua-nginx)) gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS) + $(call PatchDir,$(PKG_BUILD_DIR),./patches-lua-nginx) endef -define Package/nginx-proxyprotocol/install - $(INSTALL_DIR) $(1)/etc/nginx - $(INSTALL_BIN) ./files/nginx.proxyprotocol.example $(1)/etc/nginx/nginx.conf.proxyprotocol - chmod 0640 $(1)/etc/nginx/nginx.conf.proxyprotocol -endef - -define Package/nginx-syslog/install - $(INSTALL_DIR) $(1)/etc/nginx - $(INSTALL_BIN) ./files/nginx.syslog.example $(1)/etc/nginx/nginx.conf.syslog - chmod 0640 $(1)/etc/nginx/nginx.conf.syslog -endef - - $(eval $(call BuildPackage,nginx)) -$(eval $(call BuildPackage,nginx-naxsi)) -$(eval $(call BuildPackage,nginx-proxyprotocol)) -$(eval $(call BuildPackage,nginx-syslog)) - diff --git a/net/nginx/files/nginx.init b/net/nginx/files/nginx.init index adf36b442..40d389719 100644 --- a/net/nginx/files/nginx.init +++ b/net/nginx/files/nginx.init @@ -1,24 +1,17 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2009-2012 OpenWrt.org +# Copyright (C) 2015 OpenWrt.org -START=50 -NGINX_BIN=/usr/sbin/nginx +START=80 -start() { - mkdir -p /var/log/nginx - mkdir -p /var/lib/nginx - $NGINX_BIN -} +USE_PROCD=1 -stop() { - $NGINX_BIN -s stop -} +start_service() { + [ -d /var/log/nginx ] || mkdir -p /var/log/nginx + [ -d /var/lib/nginx ] || mkdir -p /var/lib/nginx -reload() { - $NGINX_BIN -s reload + procd_open_instance + procd_set_param command /usr/sbin/nginx -c /etc/nginx/nginx.conf -g 'daemon off;' + procd_set_param file /etc/nginx/nginx.conf + procd_set_param respawn + procd_close_instance } - -shutdown() { - $NGINX_BIN -s quit -} - diff --git a/net/nginx/files/nginx.proxyprotocol.example b/net/nginx/files/nginx.proxyprotocol.example deleted file mode 100644 index ab4bad625..000000000 --- a/net/nginx/files/nginx.proxyprotocol.example +++ /dev/null @@ -1,40 +0,0 @@ -worker_processes 1; -pid /tmp/nginx.pid; -daemon off; -master_process off; -error_log stderr debug_core; - -events { - debug_connection <YOUR IPv4>; - debug_connection <YOUR IPV6>; - worker_connections 1024; -} - -http { - default_type application/octet-stream; - client_body_temp_path /tmp/body 1; - - access_log /tmp/nginx_access.log; - - server { -# listen 8082 ssl; -# proxy protocol configuration for nginx 1.4.x: - listen 8082 accept_proxy_protocol=on; -# same with spdy enabled: -# listen 8082 spdy ssl accept_proxy_protocol=on; - listen [::]:8082 ipv6only=on; - ssl_certificate /your/certificate; - ssl_certificate_key /your/key; - server_name localhost; -# proxy protocol configuration for nginx 1.2.x: -# accept_proxy_protocol on; - - location / { - proxy_pass http://127.0.0.1:8084; - proxy_set_header X-Real-IP $remote_addr; - proxy_connect_timeout 10s; - proxy_read_timeout 10s; - send_proxy_protocol on; - } - } -} diff --git a/net/nginx/files/nginx.syslog.example b/net/nginx/files/nginx.syslog.example deleted file mode 100644 index 05943448d..000000000 --- a/net/nginx/files/nginx.syslog.example +++ /dev/null @@ -1,59 +0,0 @@ -worker_processes 1; - -syslog local6 nginx; - -events { - worker_connections 1024; -} - -http { - include mime.types; - default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] $request ' - '"$status" $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - server { - listen 80; - server_name localhost; - - #send the log to syslog and file. - access_log syslog:notice|logs/host1.access.log main; - - # pre 1.5.x - error_log syslog:notice|logs/host1.error.log; - - location / { - root html; - index index.html index.htm; - } - } - - server { - listen 80; - server_name www.example.com; - - access_log syslog:warn|logs/host2.access.log main; - error_log syslog:warn|logs/host2.error.log; - - location / { - root html; - index index.html index.htm; - } - } - - server { - listen 80; - server_name www.test.com; - - #send the log just to syslog. - access_log syslog:error main; - error_log syslog:error; - - location / { - root html; - index index.html index.htm; - } - } -} diff --git a/net/nginx/patches-lua-nginx/100-no_by_lua_block.patch b/net/nginx/patches-lua-nginx/100-no_by_lua_block.patch new file mode 100644 index 000000000..fef983fa7 --- /dev/null +++ b/net/nginx/patches-lua-nginx/100-no_by_lua_block.patch @@ -0,0 +1,195 @@ +--- a/lua-nginx/src/ngx_http_lua_module.c ++++ b/lua-nginx/src/ngx_http_lua_module.c +@@ -157,14 +157,14 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + offsetof(ngx_http_lua_loc_conf_t, log_socket_errors), + NULL }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + { ngx_string("init_by_lua_block"), + NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, + ngx_http_lua_init_by_lua_block, + NGX_HTTP_MAIN_CONF_OFFSET, + 0, + (void *) ngx_http_lua_init_by_inline }, +- ++#endif + { ngx_string("init_by_lua"), + NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, + ngx_http_lua_init_by_lua, +@@ -178,14 +178,14 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_MAIN_CONF_OFFSET, + 0, + (void *) ngx_http_lua_init_by_file }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + { ngx_string("init_worker_by_lua_block"), + NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, + ngx_http_lua_init_worker_by_lua_block, + NGX_HTTP_MAIN_CONF_OFFSET, + 0, + (void *) ngx_http_lua_init_worker_by_inline }, +- ++#endif + { ngx_string("init_worker_by_lua"), + NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, + ngx_http_lua_init_worker_by_lua, +@@ -201,6 +201,7 @@ static ngx_command_t ngx_http_lua_cmds[] + (void *) ngx_http_lua_init_worker_by_file }, + + #if defined(NDK) && NDK ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + /* set_by_lua $res { inline Lua code } [$arg1 [$arg2 [...]]] */ + { ngx_string("set_by_lua_block"), + NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF +@@ -209,7 +210,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_filter_set_by_lua_inline }, +- ++#endif + /* set_by_lua $res <inline script> [$arg1 [$arg2 [...]]] */ + { ngx_string("set_by_lua"), + NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF +@@ -237,7 +238,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_rewrite_handler_inline }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + /* rewrite_by_lua_block { <inline script> } */ + { ngx_string("rewrite_by_lua_block"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF +@@ -246,7 +247,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_rewrite_handler_inline }, +- ++#endif + /* access_by_lua "<inline script>" */ + { ngx_string("access_by_lua"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF +@@ -255,7 +256,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_access_handler_inline }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + /* access_by_lua_block { <inline script> } */ + { ngx_string("access_by_lua_block"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF +@@ -264,7 +265,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_access_handler_inline }, +- ++#endif + /* content_by_lua "<inline script>" */ + { ngx_string("content_by_lua"), + NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, +@@ -272,7 +273,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_content_handler_inline }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + /* content_by_lua_block { <inline script> } */ + { ngx_string("content_by_lua_block"), + NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, +@@ -280,7 +281,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_content_handler_inline }, +- ++#endif + /* log_by_lua <inline script> */ + { ngx_string("log_by_lua"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF +@@ -289,7 +290,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_log_handler_inline }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + /* log_by_lua_block { <inline script> } */ + { ngx_string("log_by_lua_block"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF +@@ -298,7 +299,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_log_handler_inline }, +- ++#endif + { ngx_string("rewrite_by_lua_file"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF + |NGX_CONF_TAKE1, +@@ -353,7 +354,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_header_filter_inline }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + /* header_filter_by_lua_block { <inline script> } */ + { ngx_string("header_filter_by_lua_block"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF +@@ -362,7 +363,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_header_filter_inline }, +- ++#endif + { ngx_string("header_filter_by_lua_file"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF + |NGX_CONF_TAKE1, +@@ -378,7 +379,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_body_filter_inline }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + /* body_filter_by_lua_block { <inline script> } */ + { ngx_string("body_filter_by_lua_block"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF +@@ -387,7 +388,7 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_body_filter_inline }, +- ++#endif + { ngx_string("body_filter_by_lua_file"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF + |NGX_CONF_TAKE1, +@@ -395,14 +396,14 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + 0, + (void *) ngx_http_lua_body_filter_file }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + { ngx_string("balancer_by_lua_block"), + NGX_HTTP_UPS_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, + ngx_http_lua_balancer_by_lua_block, + NGX_HTTP_SRV_CONF_OFFSET, + 0, + (void *) ngx_http_lua_balancer_handler_inline }, +- ++#endif + { ngx_string("balancer_by_lua_file"), + NGX_HTTP_UPS_CONF|NGX_CONF_TAKE1, + ngx_http_lua_balancer_by_lua, +@@ -509,14 +510,14 @@ static ngx_command_t ngx_http_lua_cmds[] + NGX_HTTP_LOC_CONF_OFFSET, + offsetof(ngx_http_lua_loc_conf_t, ssl_ciphers), + NULL }, +- ++#ifndef NGX_LUA_NO_BY_LUA_BLOCK + { ngx_string("ssl_certificate_by_lua_block"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, + ngx_http_lua_ssl_cert_by_lua_block, + NGX_HTTP_SRV_CONF_OFFSET, + 0, + (void *) ngx_http_lua_ssl_cert_handler_inline }, +- ++#endif + { ngx_string("ssl_certificate_by_lua_file"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, + ngx_http_lua_ssl_cert_by_lua, diff --git a/net/nginx/patches-lua-nginx/300-ldl.patch b/net/nginx/patches-lua-nginx/300-ldl.patch deleted file mode 100644 index d826bcf26..000000000 --- a/net/nginx/patches-lua-nginx/300-ldl.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/lua-nginx/config -+++ b/lua-nginx/config -@@ -1,5 +1,5 @@ - ngx_feature="Lua library" --ngx_feature_libs="-llua -lm" -+ngx_feature_libs="-llua -lm -ldl" - ngx_feature_name= - ngx_feature_run=no - ngx_feature_incs="#include <lauxlib.h>" -@@ -47,9 +47,9 @@ else - ngx_feature="Lua library in $LUA_LIB and $LUA_INC (specified by the LUA_LIB and LUA_INC env)" - ngx_feature_path="$LUA_INC" - if [ $NGX_RPATH = YES ]; then -- ngx_feature_libs="-R$LUA_LIB -L$LUA_LIB -llua -lm" -+ ngx_feature_libs="-R$LUA_LIB -L$LUA_LIB -llua -lm -ldl" - else -- ngx_feature_libs="-L$LUA_LIB -llua -lm" -+ ngx_feature_libs="-L$LUA_LIB -llua -lm -ldl" - fi - - . auto/feature diff --git a/net/nginx/patches-nginx-upstream-check/check_1.2.6+.patch b/net/nginx/patches-nginx-upstream-check/check_1.2.6+.patch deleted file mode 100644 index 3ab913472..000000000 --- a/net/nginx/patches-nginx-upstream-check/check_1.2.6+.patch +++ /dev/null @@ -1,209 +0,0 @@ -diff --git a/src/http/modules/ngx_http_upstream_ip_hash_module.c b/src/http/modules/ngx_http_upstream_ip_hash_module.c -index 89ccc2b..a552044 100644 ---- a/src/http/modules/ngx_http_upstream_ip_hash_module.c -+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c -@@ -9,6 +9,10 @@ - #include <ngx_core.h> - #include <ngx_http.h> - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+#include "ngx_http_upstream_check_handler.h" -+#endif -+ - - typedef struct { - /* the round robin data must be first */ -@@ -208,6 +212,12 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data) - - if (!peer->down) { - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get ip_hash peer, check_index: %ui", -+ peer->check_index); -+ if (!ngx_http_check_peer_down(peer->check_index)) { -+#endif - if (peer->max_fails == 0 || peer->fails < peer->max_fails) { - break; - } -@@ -216,6 +226,9 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data) - peer->checked = now; - break; - } -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ } -+#endif - } - - iphp->rrp.tried[n] |= m; -diff --git a/src/http/modules/ngx_http_upstream_least_conn_module.c b/src/http/modules/ngx_http_upstream_least_conn_module.c -index 21156ae..c57393d 100644 ---- a/src/http/modules/ngx_http_upstream_least_conn_module.c -+++ b/src/http/modules/ngx_http_upstream_least_conn_module.c -@@ -9,6 +9,10 @@ - #include <ngx_core.h> - #include <ngx_http.h> - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+#include "ngx_http_upstream_check_handler.h" -+#endif -+ - - typedef struct { - ngx_uint_t *conns; -@@ -203,6 +207,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data) - continue; - } - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get least_conn peer, check_index: %ui", -+ peer->check_index); -+ -+ if (ngx_http_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (peer->max_fails - && peer->fails >= peer->max_fails - && now - peer->checked <= peer->fail_timeout) -@@ -256,6 +270,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data) - continue; - } - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get least_conn peer, check_index: %ui", -+ peer->check_index); -+ -+ if (ngx_http_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (lcp->conns[i] * best->weight != lcp->conns[p] * peer->weight) { - continue; - } -diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c -index 4b78cff..f077b46 100644 ---- a/src/http/ngx_http_upstream_round_robin.c -+++ b/src/http/ngx_http_upstream_round_robin.c -@@ -9,6 +9,9 @@ - #include <ngx_core.h> - #include <ngx_http.h> - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+#include "ngx_http_upstream_check_handler.h" -+#endif - - static ngx_int_t ngx_http_upstream_cmp_servers(const void *one, - const void *two); -@@ -87,7 +90,17 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, - peers->peer[n].weight = server[i].weight; - peers->peer[n].effective_weight = server[i].weight; - peers->peer[n].current_weight = 0; -- n++; -+ -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ if (!server[i].down) { -+ peers->peer[n].check_index = -+ ngx_http_check_add_peer(cf, us, &server[i].addrs[j]); -+ } -+ else { -+ peers->peer[n].check_index = (ngx_uint_t) NGX_ERROR; -+ } -+#endif -+ n++; - } - } - -@@ -145,6 +158,17 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, - backup->peer[n].max_fails = server[i].max_fails; - backup->peer[n].fail_timeout = server[i].fail_timeout; - backup->peer[n].down = server[i].down; -+ -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ if (!server[i].down) { -+ backup->peer[n].check_index = -+ ngx_http_check_add_peer(cf, us, &server[i].addrs[j]); -+ } -+ else { -+ backup->peer[n].check_index = (ngx_uint_t) NGX_ERROR; -+ } -+#endif -+ - n++; - } - } -@@ -206,6 +230,9 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, - peers->peer[i].current_weight = 0; - peers->peer[i].max_fails = 1; - peers->peer[i].fail_timeout = 10; -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR; -+#endif - } - - us->peer.data = peers; -@@ -323,6 +350,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r, - peers->peer[0].current_weight = 0; - peers->peer[0].max_fails = 1; - peers->peer[0].fail_timeout = 10; -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ peers->peer[0].check_index = (ngx_uint_t) NGX_ERROR; -+#endif - - } else { - -@@ -356,6 +386,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r, - peers->peer[i].current_weight = 0; - peers->peer[i].max_fails = 1; - peers->peer[i].fail_timeout = 10; -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR; -+#endif - } - } - -@@ -434,6 +467,12 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data) - goto failed; - } - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ if (ngx_http_check_peer_down(peer->check_index)) { -+ goto failed; -+ } -+#endif -+ - } else { - - /* there are several peers */ -@@ -531,6 +570,12 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peer_data_t *rrp) - continue; - } - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ if (ngx_http_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (peer->max_fails - && peer->fails >= peer->max_fails - && now - peer->checked <= peer->fail_timeout) -diff --git a/src/http/ngx_http_upstream_round_robin.h b/src/http/ngx_http_upstream_round_robin.h -index 3f8cbf8..1613168 100644 ---- a/src/http/ngx_http_upstream_round_robin.h -+++ b/src/http/ngx_http_upstream_round_robin.h -@@ -30,6 +30,10 @@ typedef struct { - ngx_uint_t max_fails; - time_t fail_timeout; - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ ngx_uint_t check_index; -+#endif -+ - ngx_uint_t down; /* unsigned down:1; */ - - #if (NGX_HTTP_SSL) diff --git a/net/nginx/patches/101-feature_test_fix.patch b/net/nginx/patches/101-feature_test_fix.patch index 8e15fe96e..2c692bc79 100644 --- a/net/nginx/patches/101-feature_test_fix.patch +++ b/net/nginx/patches/101-feature_test_fix.patch @@ -11,7 +11,7 @@ ngx_feature_libs= --- a/auto/cc/conf +++ b/auto/cc/conf -@@ -155,7 +155,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then +@@ -200,7 +200,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then else ngx_feature="C99 variadic macros" ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS" @@ -20,7 +20,7 @@ ngx_feature_incs="#include <stdio.h> #define var(dummy, ...) sprintf(__VA_ARGS__)" ngx_feature_path= -@@ -169,7 +169,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then +@@ -214,7 +214,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then ngx_feature="gcc variadic macros" ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS" @@ -31,7 +31,7 @@ ngx_feature_path= --- a/auto/os/linux +++ b/auto/os/linux -@@ -48,7 +48,7 @@ fi +@@ -36,7 +36,7 @@ fi ngx_feature="epoll" ngx_feature_name="NGX_HAVE_EPOLL" @@ -40,7 +40,7 @@ ngx_feature_incs="#include <sys/epoll.h>" ngx_feature_path= ngx_feature_libs= -@@ -73,7 +73,7 @@ fi +@@ -93,7 +93,7 @@ ngx_feature_test="int fd; struct stat sb CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE" ngx_feature="sendfile()" ngx_feature_name="NGX_HAVE_SENDFILE" @@ -49,7 +49,7 @@ ngx_feature_incs="#include <sys/sendfile.h> #include <errno.h>" ngx_feature_path= -@@ -94,7 +94,7 @@ fi +@@ -114,7 +114,7 @@ fi CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" ngx_feature="sendfile64()" ngx_feature_name="NGX_HAVE_SENDFILE64" @@ -58,7 +58,7 @@ ngx_feature_incs="#include <sys/sendfile.h> #include <errno.h>" ngx_feature_path= -@@ -112,7 +112,7 @@ ngx_include="sys/prctl.h"; . auto/includ +@@ -132,7 +132,7 @@ ngx_include="sys/prctl.h"; . auto/includ ngx_feature="prctl(PR_SET_DUMPABLE)" ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE" @@ -69,7 +69,7 @@ ngx_feature_libs= --- a/auto/unix +++ b/auto/unix -@@ -618,7 +618,7 @@ ngx_feature_test="void *p; p = memalign( +@@ -735,7 +735,7 @@ ngx_feature_test="void *p; p = memalign( ngx_feature="mmap(MAP_ANON|MAP_SHARED)" ngx_feature_name="NGX_HAVE_MAP_ANON" @@ -78,7 +78,7 @@ ngx_feature_incs="#include <sys/mman.h>" ngx_feature_path= ngx_feature_libs= -@@ -631,7 +631,7 @@ ngx_feature_test="void *p; +@@ -748,7 +748,7 @@ ngx_feature_test="void *p; ngx_feature='mmap("/dev/zero", MAP_SHARED)' ngx_feature_name="NGX_HAVE_MAP_DEVZERO" @@ -87,7 +87,7 @@ ngx_feature_incs="#include <sys/mman.h> #include <sys/stat.h> #include <fcntl.h>" -@@ -646,7 +646,7 @@ ngx_feature_test='void *p; int fd; +@@ -763,7 +763,7 @@ ngx_feature_test='void *p; int fd; ngx_feature="System V shared memory" ngx_feature_name="NGX_HAVE_SYSVSHM" @@ -96,7 +96,7 @@ ngx_feature_incs="#include <sys/ipc.h> #include <sys/shm.h>" ngx_feature_path= -@@ -660,7 +660,7 @@ ngx_feature_test="int id; +@@ -777,7 +777,7 @@ ngx_feature_test="int id; ngx_feature="POSIX semaphores" ngx_feature_name="NGX_HAVE_POSIX_SEM" diff --git a/net/nginx/patches/102-sizeof_test_fix.patch b/net/nginx/patches/102-sizeof_test_fix.patch index 0cd93cc4e..8a0e88200 100644 --- a/net/nginx/patches/102-sizeof_test_fix.patch +++ b/net/nginx/patches/102-sizeof_test_fix.patch @@ -1,6 +1,6 @@ --- a/auto/types/sizeof +++ b/auto/types/sizeof -@@ -25,8 +25,13 @@ $NGX_INCLUDE_UNISTD_H +@@ -25,8 +25,14 @@ $NGX_INCLUDE_UNISTD_H $NGX_INCLUDE_INTTYPES_H $NGX_INCLUDE_AUTO_CONFIG_H @@ -10,8 +10,9 @@ + 'Y', '3', 'p', 'M', '\n' +}; + - int main() { + int main(void) { - printf("%d", (int) sizeof($ngx_type)); ++ printf("dummy use of object_code_block to avoid gc-section: %c", object_code_block[0]); return 0; } diff --git a/net/nginx/patches/300-crosscompile_ccflags.patch b/net/nginx/patches/300-crosscompile_ccflags.patch deleted file mode 100644 index 4a06a7696..000000000 --- a/net/nginx/patches/300-crosscompile_ccflags.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/auto/endianness -+++ b/auto/endianness -@@ -21,7 +21,7 @@ int main() { - - END - --ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ -+ngx_test="$CC $NGX_CC_OPT $CC_TEST_FLAGS $CC_AUX_FLAGS \ - -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs" - - eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" ---- a/auto/feature -+++ b/auto/feature -@@ -39,7 +39,7 @@ int main() { - END - - --ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \ -+ngx_test="$CC $NGX_CC_OPT $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \ - -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs" - - ngx_feature_inc_path= ---- a/auto/include -+++ b/auto/include -@@ -27,7 +27,7 @@ int main() { - END - - --ngx_test="$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c" -+ngx_test="$CC $NGX_CC_OPT -o $NGX_AUTOTEST $NGX_AUTOTEST.c" - - eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" - diff --git a/net/nginx/patches/300-max-processes.patch b/net/nginx/patches/300-max-processes.patch new file mode 100644 index 000000000..f7465d434 --- /dev/null +++ b/net/nginx/patches/300-max-processes.patch @@ -0,0 +1,11 @@ +--- a/src/os/unix/ngx_process.h ++++ b/src/os/unix/ngx_process.h +@@ -44,7 +44,7 @@ typedef struct { + } ngx_exec_ctx_t; + + +-#define NGX_MAX_PROCESSES 1024 ++#define NGX_MAX_PROCESSES 8 + + #define NGX_PROCESS_NORESPAWN -1 + #define NGX_PROCESS_JUST_SPAWN -2 diff --git a/net/nginx/patches/400-nginx-1.4.x_proxy_protocol_patch_v2.patch b/net/nginx/patches/400-nginx-1.4.x_proxy_protocol_patch_v2.patch deleted file mode 100644 index ba63834e8..000000000 --- a/net/nginx/patches/400-nginx-1.4.x_proxy_protocol_patch_v2.patch +++ /dev/null @@ -1,1183 +0,0 @@ -Index: nginx-1.4.7/auto/modules -=================================================================== ---- nginx-1.4.7.orig/auto/modules -+++ nginx-1.4.7/auto/modules -@@ -297,6 +297,10 @@ if [ $HTTP_SSL = YES ]; then - HTTP_SRCS="$HTTP_SRCS $HTTP_SSL_SRCS" - fi - -+if [ $PROXY_PROTOCOL = YES ]; then -+ have=NGX_PROXY_PROTOCOL . auto/have -+fi -+ - if [ $HTTP_PROXY = YES ]; then - have=NGX_HTTP_X_FORWARDED_FOR . auto/have - #USE_MD5=YES -Index: nginx-1.4.7/auto/options -=================================================================== ---- nginx-1.4.7.orig/auto/options -+++ nginx-1.4.7/auto/options -@@ -47,6 +47,8 @@ USE_THREADS=NO - NGX_FILE_AIO=NO - NGX_IPV6=NO - -+PROXY_PROTOCOL=NO -+ - HTTP=YES - - NGX_HTTP_LOG_PATH= -@@ -192,6 +194,8 @@ do - --with-file-aio) NGX_FILE_AIO=YES ;; - --with-ipv6) NGX_IPV6=YES ;; - -+ --with-proxy-protocol) PROXY_PROTOCOL=YES ;; -+ - --without-http) HTTP=NO ;; - --without-http-cache) HTTP_CACHE=NO ;; - -@@ -350,6 +354,8 @@ cat << END - --with-file-aio enable file AIO support - --with-ipv6 enable IPv6 support - -+ --with-proxy-protocol enable proxy protocol support -+ - --with-http_ssl_module enable ngx_http_ssl_module - --with-http_spdy_module enable ngx_http_spdy_module - --with-http_realip_module enable ngx_http_realip_module -Index: nginx-1.4.7/auto/sources -=================================================================== ---- nginx-1.4.7.orig/auto/sources -+++ nginx-1.4.7/auto/sources -@@ -36,7 +36,8 @@ CORE_DEPS="src/core/nginx.h \ - src/core/ngx_conf_file.h \ - src/core/ngx_resolver.h \ - src/core/ngx_open_file_cache.h \ -- src/core/ngx_crypt.h" -+ src/core/ngx_crypt.h \ -+ src/core/ngx_proxy_protocol.h" - - - CORE_SRCS="src/core/nginx.c \ -@@ -67,7 +68,8 @@ CORE_SRCS="src/core/nginx.c \ - src/core/ngx_conf_file.c \ - src/core/ngx_resolver.c \ - src/core/ngx_open_file_cache.c \ -- src/core/ngx_crypt.c" -+ src/core/ngx_crypt.c \ -+ src/core/ngx_proxy_protocol.c" - - - REGEX_MODULE=ngx_regex_module -Index: nginx-1.4.7/src/core/ngx_connection.h -=================================================================== ---- nginx-1.4.7.orig/src/core/ngx_connection.h -+++ nginx-1.4.7/src/core/ngx_connection.h -@@ -63,6 +63,10 @@ struct ngx_listening_s { - unsigned shared:1; /* shared between threads or processes */ - unsigned addr_ntop:1; - -+#if (NGX_PROXY_PROTOCOL) -+ unsigned accept_proxy_protocol:2; /* proxy_protocol flag */ -+#endif -+ - #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) - unsigned ipv6only:1; - #endif -@@ -148,6 +152,10 @@ struct ngx_connection_s { - - ngx_uint_t requests; - -+#if (NGX_PROXY_PROTOCOL) -+ ngx_uint_t proxy_protocol; -+#endif -+ - unsigned buffered:8; - - unsigned log_error:3; /* ngx_connection_log_error_e */ -Index: nginx-1.4.7/src/core/ngx_core.h -=================================================================== ---- nginx-1.4.7.orig/src/core/ngx_core.h -+++ nginx-1.4.7/src/core/ngx_core.h -@@ -77,6 +77,9 @@ typedef void (*ngx_connection_handler_pt - #include <ngx_open_file_cache.h> - #include <ngx_os.h> - #include <ngx_connection.h> -+#if (NGX_PROXY_PROTOCOL) -+#include <ngx_proxy_protocol.h> -+#endif - - - #define LF (u_char) 10 -Index: nginx-1.4.7/src/core/ngx_proxy_protocol.c -=================================================================== ---- /dev/null -+++ nginx-1.4.7/src/core/ngx_proxy_protocol.c -@@ -0,0 +1,430 @@ -+ -+/* -+ * Copyright (C) Baptiste Assmann -+ * Copyright (C) Exceliance -+ */ -+ -+ -+#include <ngx_config.h> -+#include <ngx_core.h> -+#include <ngx_event.h> -+ -+#if (NGX_PROXY_PROTOCOL) -+ -+int -+ngx_recv_proxy_protocol(ngx_connection_t *c, u_char *buf, ssize_t n) -+{ -+ u_char *end, *p, *t; -+ size_t len; -+ ssize_t s; -+ int step = 0; -+ ngx_proxy_protocol_t pp; -+ -+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "processing proxy protocol"); -+ -+ /* 16 is the minimal length of the proxy protocol string */ -+ if (n < 18) { -+ step = 1; -+ goto fail; -+ } -+ -+ s = n; -+ end = memchr(buf, '\n', n); -+ if (end == NULL) { -+ step = 2; -+ goto fail; -+ } -+ -+ p = buf; -+ if (memcmp(p, "PROXY ", 6) != 0) { -+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, -+ "incorrect proxy protocol header string"); -+ step = 3; -+ goto fail; -+ } -+ p += 6; -+ s -= 6; -+ if (s <= 0) { -+ step = 4; -+ goto fail; -+ } -+ -+ ngx_memzero(&pp, sizeof(ngx_proxy_protocol_t)); -+ -+ if (memcmp(p, "TCP4 ", 5) == 0) { -+ struct sockaddr_in *sin_src; -+ struct sockaddr_in *sin_dst; -+ -+ pp.pp_proto = NGX_PP_PROTO_TCP4; -+ pp.pp_src3.ss_family = AF_INET; -+ pp.pp_dst3.ss_family = AF_INET; -+ sin_src = (struct sockaddr_in *) &pp.pp_src3; -+ sin_dst = (struct sockaddr_in *) &pp.pp_dst3; -+ -+ p += 5; -+ s -= 5; -+ if (s <= 0) { -+ step = 5; -+ goto fail; -+ } -+ -+ /* l3 source address */ -+ if ( (t = (u_char *)memchr(p, ' ', s)) == NULL ) { -+ step = 6; -+ goto fail; -+ } -+ len = t - p; -+ if ((sin_src->sin_addr.s_addr = ngx_inet_addr(p, len)) == INADDR_NONE) { -+ step = 7; -+ goto fail; -+ } -+ pp.pp_src3_text.data = ngx_pcalloc(c->pool, len + 1); -+ ngx_memcpy(pp.pp_src3_text.data, p, len); -+ pp.pp_src3_text.len = len; -+ -+ p += (len + 1); -+ s -= (len + 1); -+ if (s <= 0) { -+ step = 8; -+ goto fail; -+ } -+ -+ /* l3 destination address */ -+ if ( (t = (u_char *)memchr(p, ' ', s)) == NULL ) { -+ step = 9; -+ goto fail; -+ } -+ len = t - p; -+ if ((sin_dst->sin_addr.s_addr = ngx_inet_addr(p, len)) == INADDR_NONE) { -+ step = 10; -+ goto fail; -+ } -+// FIXME pointer shift ??? -+ pp.pp_dst3_text.data = ngx_pcalloc(c->pool, len + 1); -+ ngx_memcpy(pp.pp_dst3_text.data, p, len); -+ pp.pp_dst3_text.len = len; -+ -+ p += (len + 1); -+ s -= (len + 1); -+ if (s <= 0) { -+ step = 11; -+ goto fail; -+ } -+ -+ /* l4 source port */ -+ if ( (t = (u_char *)memchr(p, ' ', s)) == NULL ) { -+ step = 12; -+ goto fail; -+ } -+ len = t - p; -+ pp.pp_src4 = ngx_atoi(p, len); -+ if ((pp.pp_src4 < 1024) -+ || (pp.pp_src4 > 65535)) { -+ step = 13; -+ goto fail; -+ } -+ sin_src->sin_port = htons(pp.pp_src4); -+ -+ p += (len + 1); -+ s -= (len + 1); -+ if (s <= 0) { -+ step = 14; -+ goto fail; -+ } -+ -+ /* l4 destination port */ -+ if ( (t = (u_char *)memchr(p, '\r', s)) == NULL ) { -+ step = 15; -+ goto fail; -+ } -+ len = t - p; -+ pp.pp_dst4 = ngx_atoi(p, len); -+ if (pp.pp_dst4 > 65535) { -+ step = 16; -+ goto fail; -+ } -+ sin_dst->sin_port = htons(pp.pp_dst4); -+ -+ if (p[len + 1] != '\n') { -+ step = 17; -+ goto fail; -+ } -+ -+ p += (len + 2); -+ s -= (len + 2); -+ -+ -+ /* if we managed to get there, then we can safely replace the -+ * information in the connection structure -+ */ -+ -+ /* updating connection with source information provided by proxy protocol */ -+ if (pp.pp_src3_text.len > c->addr_text.len) { -+ ngx_pfree(c->pool, c->addr_text.data); -+ c->addr_text.data = ngx_pcalloc(c->pool, pp.pp_src3_text.len); -+ } else { -+ ngx_memzero(c->addr_text.data, c->addr_text.len); -+ } -+ ngx_memcpy(c->addr_text.data, pp.pp_src3_text.data, pp.pp_src3_text.len); -+ c->addr_text.len = pp.pp_src3_text.len; -+ -+ ngx_pfree(c->pool, c->sockaddr); -+ c->socklen = NGX_SOCKADDRLEN; -+ c->sockaddr = ngx_pcalloc(c->pool, c->socklen); -+ ngx_memcpy(c->sockaddr, sin_src, c->socklen); -+ -+ if (c->sockaddr->sa_family != AF_INET) { -+ ngx_pfree(c->pool, c->sockaddr); -+ c->socklen = NGX_SOCKADDRLEN; -+ c->sockaddr = ngx_pcalloc(c->pool, c->socklen); -+ } else { -+ ngx_memzero(c->sockaddr, sizeof(struct sockaddr_in)); -+ c->socklen = NGX_SOCKADDRLEN; -+ } -+ ngx_memcpy(c->sockaddr, sin_src, c->socklen); -+ -+ /* updating connection with destination information provided by proxy protocol */ -+ ngx_pfree(c->pool, c->local_sockaddr); -+ c->local_sockaddr = ngx_pcalloc(c->pool, NGX_SOCKADDRLEN); -+ ngx_memcpy(c->local_sockaddr, sin_dst, NGX_SOCKADDRLEN); -+ -+ } -+ -+#if (NGX_HAVE_INET6) -+ -+ else if (memcmp(p, "TCP6 ", 5) == 0) { -+ -+ struct sockaddr_in6 *sin6_src; -+ struct sockaddr_in6 *sin6_dst; -+ -+ pp.pp_proto = NGX_PP_PROTO_TCP6; -+ pp.pp_src3.ss_family = AF_INET6; -+ pp.pp_dst3.ss_family = AF_INET6; -+ sin6_src = (struct sockaddr_in6 *) &pp.pp_src3; -+ sin6_dst = (struct sockaddr_in6 *) &pp.pp_dst3; -+ -+ p += 5; -+ s -= 5; -+ if (s <= 0) { -+ step = 18; -+ goto fail; -+ } -+ -+ /* l3 source address */ -+ if ( (t = (u_char *)memchr(p, ' ', s)) == NULL ) { -+ step = 19; -+ goto fail; -+ } -+ len = t - p; -+ if (ngx_inet6_addr(p, len, sin6_src->sin6_addr.s6_addr) != NGX_OK) { -+ step = 20; -+ goto fail; -+ } -+ pp.pp_src3_text.data = ngx_pcalloc(c->pool, len + 1); -+ ngx_memcpy(pp.pp_src3_text.data, p, len); -+ pp.pp_src3_text.len = len; -+ -+ p += (len + 1); -+ s -= (len + 1); -+ if (s <= 0) { -+ step = 21; -+ goto fail; -+ } -+ -+ /* l3 destination address */ -+ if ( (t = (u_char *)memchr(p, ' ', s)) == NULL ) { -+ step = 22; -+ goto fail; -+ } -+ len = t - p; -+ if (ngx_inet6_addr(p, len, sin6_dst->sin6_addr.s6_addr) != NGX_OK) { -+ step = 23; -+ goto fail; -+ } -+ pp.pp_dst3_text.data = ngx_pcalloc(c->pool, len + 1); -+ ngx_memcpy(pp.pp_dst3_text.data, p, len); -+ pp.pp_dst3_text.len = len; -+ -+ p += (len + 1); -+ s -= (len + 1); -+ if (s <= 0) { -+ step = 24; -+ goto fail; -+ } -+ -+ /* l4 source port */ -+ if ( (t = (u_char *)memchr(p, ' ', s)) == NULL ) { -+ step = 25; -+ goto fail; -+ } -+ len = t - p; -+ pp.pp_src4 = ngx_atoi(p, len); -+ if ((pp.pp_src4 < 1024) -+ || (pp.pp_src4 > 65535)) { -+ step = 26; -+ goto fail; -+ } -+ sin6_src->sin6_port = htons(pp.pp_src4); -+ -+ p += (len + 1); -+ s -= (len + 1); -+ if (s <= 0) { -+ step = 27; -+ goto fail; -+ } -+ -+ /* l4 destination port */ -+ if ( (t = (u_char *)memchr(p, '\r', s)) == NULL ) { -+ step = 28; -+ goto fail; -+ } -+ len = t - p; -+ pp.pp_dst4 = ngx_atoi(p, len); -+ if (pp.pp_dst4 > 65535) { -+ step = 29; -+ goto fail; -+ } -+ sin6_dst->sin6_port = htons(pp.pp_dst4); -+ -+ if (p[len + 1] != '\n') { -+ step = 30; -+ goto fail; -+ } -+ -+ p += (len + 2); -+ s -= (len + 2); -+ -+ /* if we managed to get there, then we can safely replace the -+ * information in the connection structure -+ */ -+ -+ /* updating connection with source provided by proxy protocol */ -+ if (pp.pp_src3_text.len > c->addr_text.len) { -+ ngx_pfree(c->pool, c->addr_text.data); -+ c->addr_text.data = ngx_pcalloc(c->pool, pp.pp_src3_text.len); -+ } else { -+ ngx_memzero(c->addr_text.data, c->addr_text.len); -+ } -+ ngx_memcpy(c->addr_text.data, pp.pp_src3_text.data, pp.pp_src3_text.len); -+ c->addr_text.len = pp.pp_src3_text.len; -+ -+ ngx_pfree(c->pool, c->sockaddr); -+ c->socklen = NGX_SOCKADDRLEN; -+ c->sockaddr = ngx_pcalloc(c->pool, c->socklen); -+ ngx_memcpy(c->sockaddr, sin6_src, c->socklen); -+ -+ /* updating connection with destination provided by proxy protocol */ -+ if (c->sockaddr->sa_family != AF_INET6) { -+ ngx_pfree(c->pool, c->local_sockaddr); -+ c->local_sockaddr = ngx_pcalloc(c->pool, NGX_SOCKADDRLEN); -+ } else { -+ ngx_memzero(c->sockaddr, sizeof(struct sockaddr_in6)); -+ c->socklen = NGX_SOCKADDRLEN; -+ } -+// ngx_memcpy(c->local_sockaddr, sin6_dst, NGX_SOCKADDRLEN); -+//FIXME must be finished here -+ -+ } -+ -+#endif -+ -+ else { -+ step = 31; -+ goto fail; -+ } -+ -+ ngx_print_proxy_protocol(&pp, c->log); -+ -+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, -+ "proxy_protocol, asking to remove %z chars", -+ end + 1 - buf); -+ -+ return (end + 1 - buf); -+ -+fail: -+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, -+ "proxy_protocol error at step: %d", step); -+ -+ return 0; -+ -+} -+ -+ -+void -+ngx_print_proxy_protocol(ngx_proxy_protocol_t *p, ngx_log_t *log) -+{ -+ switch (p->pp_proto) { -+ case NGX_PP_PROTO_TCP4: -+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, log, 0, -+ "proxy_protocol, proto: TCP4"); -+ break; -+ case NGX_PP_PROTO_TCP6: -+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, log, 0, -+ "proxy_protocol, proto: TCP6"); -+ break; -+ } -+ -+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, log, 0, -+ "proxy_protocol, string length: %d", ngx_proxy_protocol_string_length(p)); -+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, log, 0, -+ "proxy_protocol, src3: %s, %d", p->pp_src3_text.data, p->pp_src3_text.len); -+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, log, 0, -+ "proxy_protocol, dst3: %s, %d", p->pp_dst3_text.data, p->pp_dst3_text.len); -+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, log, 0, -+ "proxy_protocol, src4: %d", p->pp_src4); -+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, log, 0, -+ "proxy_protocol, dst4: %d", p->pp_dst4); -+} -+ -+ -+int -+ngx_proxy_protocol_string_length(ngx_proxy_protocol_t *p) -+{ -+ int len = 0; -+ -+ /* 'PROXY ' */ -+ len += (sizeof("PROXY ") - 1); -+ -+ /* protocol version (TCP4 or TCP6) + space */ -+ len += (sizeof("TCP0 ") - 1); -+ -+ /* src3 + space */ -+ len += p->pp_src3_text.len; -+ len += 1; -+ -+ /* dst3 + space */ -+ len += p->pp_dst3_text.len; -+ len += 1; -+ -+ /* src4 */ -+ if (p->pp_src4 < 10000) -+ /* 4 digits + 1 space */ -+ len += (sizeof("0000 ") - 1); -+ else -+ /* 5 digits + 1 space */ -+ len += (sizeof("00000 ") - 1); -+ -+ /* dst4 */ -+ if (p->pp_dst4 >= 10000) -+ /* 5 digits */ -+ len += (sizeof("00000 ") - 1); -+ else if (p->pp_dst4 >= 1000) -+ /* 4 digits */ -+ len += (sizeof("0000 ") - 1); -+ else if (p->pp_dst4 >= 100) -+ /* 3 digits */ -+ len += (sizeof("000 ") - 1); -+ else if (p->pp_dst4 >= 10) -+ /* 2 digits */ -+ len += (sizeof("00 ") - 1); -+ else -+ /* 1 digit */ -+ len += (sizeof("0 ") - 1); -+ -+ /* CRLF */ -+ len += (sizeof(CRLF) - 1); -+ -+ return len - 1; -+} -+ -+#endif -Index: nginx-1.4.7/src/core/ngx_proxy_protocol.h -=================================================================== ---- /dev/null -+++ nginx-1.4.7/src/core/ngx_proxy_protocol.h -@@ -0,0 +1,45 @@ -+ -+/* -+ * Copyright (C) Baptiste Assmann -+ * Copyright (C) Exceliance -+ */ -+ -+ -+#ifndef _NGX_PROXY_PROTOCOL_H_INCLUDED_ -+#define _NGX_PROXY_PROTOCOL_H_INCLUDED_ -+ -+ -+#include <ngx_config.h> -+#include <ngx_core.h> -+ -+ -+#if (NGX_PROXY_PROTOCOL) -+ -+typedef struct ngx_proxy_protocol_s ngx_proxy_protocol_t; -+ -+typedef enum { -+ NGX_PP_PROTO_TCP4 = 1, -+ NGX_PP_PROTO_TCP6 -+} ngx_pp_proto; -+ -+ -+struct ngx_proxy_protocol_s { -+ unsigned int pp_proto; /* proxy protocol related information */ -+ struct sockaddr_storage pp_src3; -+ ngx_str_t pp_src3_text; -+ struct sockaddr_storage pp_dst3; -+ ngx_str_t pp_dst3_text; -+ unsigned int pp_src4; -+ unsigned int pp_dst4; -+}; -+ -+ -+int ngx_recv_proxy_protocol(ngx_connection_t *, u_char *, ssize_t); -+void ngx_print_proxy_protocol(ngx_proxy_protocol_t *, ngx_log_t *); -+int ngx_proxy_protocol_string_length(ngx_proxy_protocol_t *); -+ -+ -+#endif -+ -+#endif /* _NGX_CONNECTION_H_INCLUDED_ */ -+ -Index: nginx-1.4.7/src/http/modules/ngx_http_proxy_module.c -=================================================================== ---- nginx-1.4.7.orig/src/http/modules/ngx_http_proxy_module.c -+++ nginx-1.4.7/src/http/modules/ngx_http_proxy_module.c -@@ -8,7 +8,9 @@ - #include <ngx_config.h> - #include <ngx_core.h> - #include <ngx_http.h> -- -+#if (NGX_PROXY_PROTOCOL) -+#include <ngx_proxy_protocol.h> -+#endif - - typedef struct ngx_http_proxy_rewrite_s ngx_http_proxy_rewrite_t; - -@@ -365,6 +367,17 @@ static ngx_command_t ngx_http_proxy_com - offsetof(ngx_http_proxy_loc_conf_t, upstream.busy_buffers_size_conf), - NULL }, - -+#if (NGX_PROXY_PROTOCOL) -+ -+ { ngx_string("send_proxy_protocol"), -+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, -+ ngx_conf_set_flag_slot, -+ NGX_HTTP_LOC_CONF_OFFSET, -+ offsetof(ngx_http_proxy_loc_conf_t, upstream.send_proxy_protocol), -+ NULL }, -+ -+#endif -+ - #if (NGX_HTTP_CACHE) - - { ngx_string("proxy_cache"), -@@ -2420,6 +2433,11 @@ ngx_http_proxy_create_loc_conf(ngx_conf_ - conf->upstream.pass_headers = NGX_CONF_UNSET_PTR; - - conf->upstream.intercept_errors = NGX_CONF_UNSET; -+ -+#if (NGX_PROXY_PROTOCOL) -+ conf->upstream.send_proxy_protocol = NGX_CONF_UNSET; -+#endif -+ - #if (NGX_HTTP_SSL) - conf->upstream.ssl_session_reuse = NGX_CONF_UNSET; - #endif -@@ -2695,6 +2713,11 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t - ngx_conf_merge_value(conf->upstream.intercept_errors, - prev->upstream.intercept_errors, 0); - -+#if (NGX_PROXY_PROTOCOL) -+ ngx_conf_merge_value(conf->upstream.send_proxy_protocol, -+ prev->upstream.send_proxy_protocol, 0); -+#endif -+ - #if (NGX_HTTP_SSL) - ngx_conf_merge_value(conf->upstream.ssl_session_reuse, - prev->upstream.ssl_session_reuse, 1); -Index: nginx-1.4.7/src/http/ngx_http.c -=================================================================== ---- nginx-1.4.7.orig/src/http/ngx_http.c -+++ nginx-1.4.7/src/http/ngx_http.c -@@ -1228,6 +1228,9 @@ ngx_http_add_addresses(ngx_conf_t *cf, n - #if (NGX_HTTP_SPDY) - ngx_uint_t spdy; - #endif -+#if (NGX_PROXY_PROTOCOL) -+ ngx_uint_t accept_proxy_protocol; -+#endif - - /* - * we cannot compare whole sockaddr struct's as kernel -@@ -1283,6 +1286,10 @@ ngx_http_add_addresses(ngx_conf_t *cf, n - #if (NGX_HTTP_SPDY) - spdy = lsopt->spdy || addr[i].opt.spdy; - #endif -+#if (NGX_PROXY_PROTOCOL) -+ accept_proxy_protocol = lsopt->accept_proxy_protocol -+ || addr[i].opt.accept_proxy_protocol; -+#endif - - if (lsopt->set) { - -@@ -1316,6 +1323,9 @@ ngx_http_add_addresses(ngx_conf_t *cf, n - #if (NGX_HTTP_SPDY) - addr[i].opt.spdy = spdy; - #endif -+#if (NGX_PROXY_PROTOCOL) -+ addr[i].opt.accept_proxy_protocol = accept_proxy_protocol; -+#endif - - return NGX_OK; - } -@@ -1762,6 +1772,11 @@ ngx_http_add_listening(ngx_conf_t *cf, n - ls->pool_size = cscf->connection_pool_size; - ls->post_accept_timeout = cscf->client_header_timeout; - -+#if (NGX_PROXY_PROTOCOL) -+// CLEANUP: ls->accept_proxy_protocol = cscf->accept_proxy_protocol; -+ ls->accept_proxy_protocol = addr->opt.accept_proxy_protocol; -+#endif -+ - clcf = cscf->ctx->loc_conf[ngx_http_core_module.ctx_index]; - - ls->logp = clcf->error_log; -@@ -1840,6 +1855,9 @@ ngx_http_add_addrs(ngx_conf_t *cf, ngx_h - #if (NGX_HTTP_SPDY) - addrs[i].conf.spdy = addr[i].opt.spdy; - #endif -+#if (NGX_PROXY_PROTOCOL) -+ addrs[i].conf.accept_proxy_protocol = addr[i].opt.accept_proxy_protocol; -+#endif - - if (addr[i].hash.buckets == NULL - && (addr[i].wc_head == NULL -@@ -1904,6 +1922,9 @@ ngx_http_add_addrs6(ngx_conf_t *cf, ngx_ - #if (NGX_HTTP_SPDY) - addrs6[i].conf.spdy = addr[i].opt.spdy; - #endif -+#if (NGX_PROXY_PROTOCOL) -+ addrs6[i].conf.accept_proxy_protocol = addr[i].opt.accept_proxy_protocol; -+#endif - - if (addr[i].hash.buckets == NULL - && (addr[i].wc_head == NULL -Index: nginx-1.4.7/src/http/ngx_http_core_module.c -=================================================================== ---- nginx-1.4.7.orig/src/http/ngx_http_core_module.c -+++ nginx-1.4.7/src/http/ngx_http_core_module.c -@@ -4090,6 +4090,15 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx - continue; - } - -+#if (NGX_PROXY_PROTOCOL) -+ if (ngx_strncmp(value[n].data, "accept_proxy_protocol=on", 24) == 0) { -+ lsopt.accept_proxy_protocol = 1; -+ lsopt.set = 1; -+ lsopt.bind = 1; -+ continue; -+ } -+#endif -+ - if (ngx_strncmp(value[n].data, "ipv6only=o", 10) == 0) { - #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) - struct sockaddr *sa; -Index: nginx-1.4.7/src/http/ngx_http_core_module.h -=================================================================== ---- nginx-1.4.7.orig/src/http/ngx_http_core_module.h -+++ nginx-1.4.7/src/http/ngx_http_core_module.h -@@ -78,6 +78,11 @@ typedef struct { - #if (NGX_HTTP_SPDY) - unsigned spdy:1; - #endif -+ -+#if (NGX_PROXY_PROTOCOL) -+ unsigned accept_proxy_protocol:2; -+#endif -+ - #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) - unsigned ipv6only:1; - #endif -@@ -234,6 +239,10 @@ struct ngx_http_addr_conf_s { - - ngx_http_virtual_names_t *virtual_names; - -+#if (NGX_PROXY_PROTOCOL) -+ ngx_flag_t accept_proxy_protocol; -+#endif -+ - #if (NGX_HTTP_SSL) - unsigned ssl:1; - #endif -Index: nginx-1.4.7/src/http/ngx_http_request.c -=================================================================== ---- nginx-1.4.7.orig/src/http/ngx_http_request.c -+++ nginx-1.4.7/src/http/ngx_http_request.c -@@ -63,6 +63,9 @@ static void ngx_http_ssl_handshake(ngx_e - static void ngx_http_ssl_handshake_handler(ngx_connection_t *c); - #endif - -+#if (NGX_PROXY_PROTOCOL) -+static void ngx_http_proxy_protocol(ngx_event_t *rev); -+#endif - - static char *ngx_http_client_errors[] = { - -@@ -343,6 +346,14 @@ ngx_http_init_connection(ngx_connection_ - } - #endif - -+#if (NGX_PROXY_PROTOCOL) -+ { -+ if (hc->addr_conf->accept_proxy_protocol) { -+ rev->handler = ngx_http_proxy_protocol; -+ } -+ } -+#endif -+ - if (rev->ready) { - /* the deferred accept(), rtsig, aio, iocp */ - -@@ -364,7 +375,6 @@ ngx_http_init_connection(ngx_connection_ - } - } - -- - static void - ngx_http_wait_request_handler(ngx_event_t *rev) - { -@@ -469,6 +479,12 @@ ngx_http_wait_request_handler(ngx_event_ - } - - rev->handler = ngx_http_process_request_line; -+ -+#if (NGX_PROXY_PROTOCOL) -+ if (hc->addr_conf->accept_proxy_protocol) -+ rev->handler = ngx_http_proxy_protocol; -+#endif -+ - ngx_http_process_request_line(rev); - } - -@@ -582,6 +598,67 @@ ngx_http_create_request(ngx_connection_t - return r; - } - -+#if (NGX_PROXY_PROTOCOL) -+ -+static void -+ngx_http_proxy_protocol(ngx_event_t *rev) -+{ -+ ssize_t n; -+ size_t size = 1024; -+ u_char tmpbuf[size]; -+ ngx_connection_t *c; -+ ngx_http_connection_t *hc; -+ -+ c = rev->data; -+ hc = c->data; -+ rev->handler = ngx_http_wait_request_handler; -+ -+#if (NGX_HTTP_SPDY) -+ { -+ if (hc->addr_conf->spdy) { -+ rev->handler = ngx_http_spdy_init; -+ } -+ } -+#endif -+ -+#if (NGX_HTTP_SSL) -+ { -+ if (hc->addr_conf->ssl) { -+ rev->handler = ngx_http_ssl_handshake; -+ } -+ } -+#endif -+ -+ n = recv(c->fd, tmpbuf, size, MSG_PEEK); -+ -+ if ((n <= 0) && (c->listening) -+ && (hc->addr_conf->accept_proxy_protocol) -+ && (!c->proxy_protocol)) { -+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "ngx_http_proxy_protocol: pp required but not found"); -+ return; -+ } -+ if ((n > 0) && (c->listening) -+ && (hc->addr_conf->accept_proxy_protocol) -+ && (!c->proxy_protocol)) { -+ ssize_t m; -+ if (!(m = ngx_recv_proxy_protocol(c, tmpbuf, n))) { -+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "ngx_http_proxy_protocol: pp required but not found"); -+ ngx_http_close_connection(c); -+ return; -+ } -+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "ngx_http_proxy_protocol: pp required and found"); -+ -+ c->proxy_protocol = 1; -+ -+ /* strip the proxy protocol string from the buffer */ -+ recv(c->fd, tmpbuf, m, 0); -+ } -+ -+ rev->handler(rev); -+} -+ -+#endif -+ - - #if (NGX_HTTP_SSL) - -Index: nginx-1.4.7/src/http/ngx_http_upstream.c -=================================================================== ---- nginx-1.4.7.orig/src/http/ngx_http_upstream.c -+++ nginx-1.4.7/src/http/ngx_http_upstream.c -@@ -31,6 +31,10 @@ static ngx_int_t ngx_http_upstream_reini - ngx_http_upstream_t *u); - static void ngx_http_upstream_send_request(ngx_http_request_t *r, - ngx_http_upstream_t *u); -+#if (NGX_PROXY_PROTOCOL) -+static void ngx_http_upstream_send_proxy_protocol(ngx_http_request_t *r, -+ ngx_http_upstream_t *u); -+#endif - static void ngx_http_upstream_send_request_handler(ngx_http_request_t *r, - ngx_http_upstream_t *u); - static void ngx_http_upstream_process_header(ngx_http_request_t *r, -@@ -1255,6 +1259,13 @@ ngx_http_upstream_connect(ngx_http_reque - - u->request_sent = 0; - -+#if (NGX_PROXY_PROTOCOL) -+ if (u->conf->send_proxy_protocol && !(u->ssl && c->ssl == NULL)) { -+ ngx_http_upstream_send_proxy_protocol(r, u); -+ return; -+ } -+#endif -+ - if (rc == NGX_AGAIN) { - ngx_add_timer(c->write, u->conf->connect_timeout); - return; -@@ -1498,6 +1509,228 @@ ngx_http_upstream_send_request(ngx_http_ - } - - -+#if (NGX_PROXY_PROTOCOL) -+ -+static void -+ngx_http_upstream_send_proxy_protocol(ngx_http_request_t *r, ngx_http_upstream_t *u) -+{ -+ size_t len; -+ ngx_int_t rc; -+ ngx_connection_t *uc; -+ ngx_connection_t *cc; -+ ngx_chain_t *pp_string; -+ ngx_proxy_protocol_t pp; -+ ngx_buf_t *b; -+ char port[6]; -+ u_char *addr; -+ struct sockaddr_storage sa_src; -+ struct sockaddr_storage sa_dst; -+ socklen_t addrlen = NGX_SOCKADDRLEN; -+ struct sockaddr_in *sin_src; -+ struct sockaddr_in *sin_dst; -+ -+#if (NGX_HAVE_INET6) -+ -+ struct sockaddr_in6 *sin6_src; -+ struct sockaddr_in6 *sin6_dst; -+ -+#endif -+ -+ -+ uc = u->peer.connection; -+ cc = r->connection; -+ -+ if ( !(u->conf->send_proxy_protocol) ) { -+ return; -+ } -+ -+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, uc->log, 0, -+ "http upstream send proxy protocol"); -+ -+ if (!u->request_sent && ngx_http_upstream_test_connect(uc) != NGX_OK) { -+ ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR); -+ return; -+ } -+ -+ uc->log->action = "sending proxy protocol to upstream"; -+ -+ len = 0; -+ -+ if (r->connection->proxy_protocol) { -+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, uc->log, 0, -+ "PP: got proxy-protocol from client connection"); -+ -+ switch (cc->sockaddr->sa_family) { -+ -+#if (NGX_HAVE_INET6) -+ -+ case AF_INET6: -+ -+ pp.pp_proto = NGX_PP_PROTO_TCP6; -+ sin6_dst = (struct sockaddr_in6 *) cc->local_sockaddr; -+ sin6_src = (struct sockaddr_in6 *) cc->sockaddr; -+ -+ break; -+ -+#endif -+ -+ default: -+ pp.pp_proto = NGX_PP_PROTO_TCP4; -+ sin_dst = (struct sockaddr_in *) cc->local_sockaddr; -+ sin_src = (struct sockaddr_in *) cc->sockaddr; -+ -+ } -+ -+ } else { -+ -+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, uc->log, 0, -+ "PP: collecting information from socket fd"); -+ -+ getsockname(cc->fd, (struct sockaddr *) &sa_dst, &addrlen); -+ -+ switch (sa_dst.ss_family) { -+ -+#if (NGX_HAVE_INET6) -+ -+ case AF_INET6: -+ -+ pp.pp_proto = NGX_PP_PROTO_TCP6; -+ sin6_dst = (struct sockaddr_in6 *) &sa_dst; -+ -+ getpeername(cc->fd, (struct sockaddr *) &sa_src, &addrlen); -+ sin6_src = (struct sockaddr_in6 *) &sa_src; -+ -+ break; -+ -+#endif -+ -+ default: -+ -+ pp.pp_proto = NGX_PP_PROTO_TCP4; -+ sin_dst = (struct sockaddr_in *) &sa_dst; -+ getpeername(cc->fd, (struct sockaddr *) &sa_src, &addrlen); -+ sin_src = (struct sockaddr_in *) &sa_src; -+ } -+ -+ -+ } -+ -+ switch (pp.pp_proto) { -+ -+#if (NGX_HAVE_INET6) -+ -+ case NGX_PP_PROTO_TCP6: -+ -+ /* dst3 and dst4 */ -+ addr = ngx_pcalloc(r->pool, NGX_INET6_ADDRSTRLEN); -+ ngx_inet_ntop(AF_INET6, &sin6_dst->sin6_addr, addr, NGX_INET6_ADDRSTRLEN); -+ pp.pp_dst3_text.data = ngx_pcalloc(r->pool, NGX_INET6_ADDRSTRLEN); -+ pp.pp_dst3_text.len = ngx_strlen(addr); -+ ngx_memcpy(pp.pp_dst3_text.data, addr, pp.pp_dst3_text.len); -+ pp.pp_dst4 = htons(sin6_dst->sin6_port); -+ -+ ngx_memzero(addr, NGX_INET6_ADDRSTRLEN); -+ -+ /* src3 and src4 */ -+ ngx_inet_ntop(AF_INET6, &sin6_src->sin6_addr, addr, NGX_INET6_ADDRSTRLEN); -+ pp.pp_src3_text.data = ngx_pcalloc(r->pool, NGX_INET6_ADDRSTRLEN); -+ pp.pp_src3_text.len = ngx_strlen(addr); -+ ngx_memcpy(pp.pp_src3_text.data, addr, pp.pp_src3_text.len); -+ pp.pp_src4 = htons(sin6_src->sin6_port); -+ -+ break; -+ -+#endif -+ -+ default: -+ -+ /* dst3 and dst4 */ -+ addr = ngx_pcalloc(r->pool, NGX_INET_ADDRSTRLEN); -+ ngx_inet_ntop(AF_INET, &sin_dst->sin_addr, addr, NGX_INET_ADDRSTRLEN); -+ pp.pp_dst3_text.data = ngx_pcalloc(r->pool, NGX_INET_ADDRSTRLEN); -+ pp.pp_dst3_text.len = ngx_strlen(addr); -+ ngx_memcpy(pp.pp_dst3_text.data, addr, pp.pp_dst3_text.len); -+ pp.pp_dst4 = htons(sin_dst->sin_port); -+ -+ ngx_memzero(addr, NGX_INET_ADDRSTRLEN); -+ -+ /* src3 and src4 */ -+ ngx_inet_ntop(AF_INET, &sin_src->sin_addr, addr, NGX_INET_ADDRSTRLEN); -+ pp.pp_src3_text.data = ngx_pcalloc(r->pool, NGX_INET_ADDRSTRLEN); -+ pp.pp_src3_text.len = ngx_strlen(addr); -+ ngx_memcpy(pp.pp_src3_text.data, addr, pp.pp_src3_text.len); -+ pp.pp_src4 = htons(sin_src->sin_port); -+ -+ } -+ -+ len += ngx_proxy_protocol_string_length(&pp); -+ -+ ngx_print_proxy_protocol(&pp, uc->log); -+ -+ b = ngx_create_temp_buf(uc->pool, len); -+ if (b == NULL) { -+ return; -+ } -+ -+ pp_string = ngx_alloc_chain_link(uc->pool); -+ if (pp_string == NULL) { -+ return; -+ } -+ -+ pp_string->buf = b; -+ pp_string->next = NULL; -+ -+ b->last = ngx_cpymem(b->last, "PROXY ", sizeof("PROXY ") - 1); -+ -+ switch (pp.pp_proto) { -+ case NGX_PP_PROTO_TCP4: -+ b->last = ngx_cpymem(b->last, "TCP4 ", sizeof("TCP4 ") - 1); -+ break; -+ case NGX_PP_PROTO_TCP6: -+ b->last = ngx_cpymem(b->last, "TCP6 ", sizeof("TCP6 ") - 1); -+ break; -+ } -+ -+ /* src3 */ -+ b->last = ngx_cpymem(b->last, pp.pp_src3_text.data, pp.pp_src3_text.len); -+ b->last = ngx_cpymem(b->last, " ", 1); -+ -+ /* dst3 */ -+ b->last = ngx_cpymem(b->last, pp.pp_dst3_text.data, pp.pp_dst3_text.len); -+ b->last = ngx_cpymem(b->last, " ", 1); -+ -+ /* src4 */ -+ ngx_memzero(port, 6); -+ sprintf(port,"%d", pp.pp_src4); -+ b->last = ngx_cpymem(b->last, port, strlen(port)); -+ b->last = ngx_cpymem(b->last, " ", 1); -+ -+ /* dst4 */ -+ ngx_memzero(port, 6); -+ sprintf(port,"%d", pp.pp_dst4); -+ b->last = ngx_cpymem(b->last, port, strlen(port)); -+ -+ /* CRLF */ -+ b->last = ngx_cpymem(b->last, CRLF, sizeof(CRLF) - 1); -+ -+ ngx_log_debug3(NGX_LOG_DEBUG_HTTP, uc->log, 0, -+ "http upstream send proxy protocol: %d -%*s-", -+ ngx_proxy_protocol_string_length(&pp), -+ ngx_proxy_protocol_string_length(&pp) - 2, -+ b->start); -+ -+ rc = ngx_output_chain(&u->output, pp_string); -+ -+ if (rc == NGX_ERROR) { -+ ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR); -+ return; -+ } -+ -+} -+ -+#endif -+ -+ - static void - ngx_http_upstream_send_request_handler(ngx_http_request_t *r, - ngx_http_upstream_t *u) -Index: nginx-1.4.7/src/http/ngx_http_upstream.h -=================================================================== ---- nginx-1.4.7.orig/src/http/ngx_http_upstream.h -+++ nginx-1.4.7/src/http/ngx_http_upstream.h -@@ -188,6 +188,10 @@ typedef struct { - unsigned intercept_404:1; - unsigned change_buffering:1; - -+#if (NGX_PROXY_PROTOCOL) -+ ngx_flag_t send_proxy_protocol; -+#endif -+ - #if (NGX_HTTP_SSL) - ngx_ssl_t *ssl; - ngx_flag_t ssl_session_reuse; -Index: nginx-1.4.7/auto/cc/gcc -=================================================================== ---- nginx-1.4.7.orig/auto/cc/gcc -+++ nginx-1.4.7/auto/cc/gcc -@@ -168,7 +168,7 @@ esac - - - # stop on warning --CFLAGS="$CFLAGS -Werror" -+CFLAGS="$CFLAGS" - - # debug - CFLAGS="$CFLAGS -g" -Index: nginx-1.4.7/auto/cc/icc -=================================================================== ---- nginx-1.4.7.orig/auto/cc/icc -+++ nginx-1.4.7/auto/cc/icc -@@ -115,7 +115,7 @@ case "$NGX_ICC_VER" in - esac - - # stop on warning --CFLAGS="$CFLAGS -Werror" -+CFLAGS="$CFLAGS " - - # debug - CFLAGS="$CFLAGS -g" diff --git a/net/nginx/patches/401-nginx-1.4.0-syslog.patch b/net/nginx/patches/401-nginx-1.4.0-syslog.patch deleted file mode 100644 index 941c79aee..000000000 --- a/net/nginx/patches/401-nginx-1.4.0-syslog.patch +++ /dev/null @@ -1,698 +0,0 @@ -Index: nginx-1.4.7/src/core/ngx_cycle.c -=================================================================== ---- nginx-1.4.7.orig/src/core/ngx_cycle.c -+++ nginx-1.4.7/src/core/ngx_cycle.c -@@ -85,6 +85,12 @@ ngx_init_cycle(ngx_cycle_t *old_cycle) - cycle->pool = pool; - cycle->log = log; - cycle->new_log.log_level = NGX_LOG_ERR; -+#if (NGX_ENABLE_SYSLOG) -+ cycle->new_log.facility = SYSLOG_FACILITY; -+ cycle->new_log.facility = ERR_SYSLOG_PRIORITY; -+ cycle->new_log.syslog_on = 0; -+ cycle->new_log.syslog_set = 0; -+#endif - cycle->old_cycle = old_cycle; - - cycle->conf_prefix.len = old_cycle->conf_prefix.len; -Index: nginx-1.4.7/src/core/ngx_log.c -=================================================================== ---- nginx-1.4.7.orig/src/core/ngx_log.c -+++ nginx-1.4.7/src/core/ngx_log.c -@@ -10,6 +10,15 @@ - - - static char *ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -+#if (NGX_ENABLE_SYSLOG) -+static char *ngx_set_syslog(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -+void log_exit(ngx_cycle_t *cycle); -+ -+typedef struct{ -+ ngx_str_t name; -+ ngx_int_t macro; -+} ngx_string_to_macro_t; -+#endif - - - static ngx_command_t ngx_errlog_commands[] = { -@@ -21,6 +30,15 @@ static ngx_command_t ngx_errlog_command - 0, - NULL}, - -+#if (NGX_ENABLE_SYSLOG) -+ {ngx_string("syslog"), -+ NGX_MAIN_CONF|NGX_CONF_TAKE12, -+ ngx_set_syslog, -+ 0, -+ 0, -+ NULL}, -+#endif -+ - ngx_null_command - }; - -@@ -43,7 +61,11 @@ ngx_module_t ngx_errlog_module = { - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ -- NULL, /* exit master */ -+#if (NGX_ENABLE_SYSLOG) -+ log_exit, /* exit master */ -+#else -+ NULL, -+#endif - NGX_MODULE_V1_PADDING - }; - -@@ -52,6 +74,48 @@ static ngx_log_t ngx_log; - static ngx_open_file_t ngx_log_file; - ngx_uint_t ngx_use_stderr = 1; - -+#if (NGX_ENABLE_SYSLOG) -+static ngx_string_to_macro_t ngx_syslog_facilities[] = { -+ {ngx_string("auth"), LOG_AUTH}, -+#if !(NGX_SOLARIS) -+ {ngx_string("authpriv"), LOG_AUTHPRIV}, -+#endif -+ {ngx_string("cron"), LOG_CRON}, -+ {ngx_string("daemon"), LOG_DAEMON}, -+#if !(NGX_SOLARIS) -+ {ngx_string("ftp"), LOG_FTP}, -+#endif -+ {ngx_string("kern"), LOG_KERN}, -+ {ngx_string("local0"), LOG_LOCAL0}, -+ {ngx_string("local1"), LOG_LOCAL1}, -+ {ngx_string("local2"), LOG_LOCAL2}, -+ {ngx_string("local3"), LOG_LOCAL3}, -+ {ngx_string("local4"), LOG_LOCAL4}, -+ {ngx_string("local5"), LOG_LOCAL5}, -+ {ngx_string("local6"), LOG_LOCAL6}, -+ {ngx_string("local7"), LOG_LOCAL7}, -+ {ngx_string("lpr"), LOG_LPR}, -+ {ngx_string("mail"), LOG_MAIL}, -+ {ngx_string("news"), LOG_NEWS}, -+ {ngx_string("syslog"), LOG_SYSLOG}, -+ {ngx_string("user"), LOG_USER}, -+ {ngx_string("uucp"), LOG_UUCP}, -+ { ngx_null_string, 0} -+}; -+ -+static ngx_string_to_macro_t ngx_syslog_priorities[] = { -+ {ngx_string("emerg"), LOG_EMERG}, -+ {ngx_string("alert"), LOG_ALERT}, -+ {ngx_string("crit"), LOG_CRIT}, -+ {ngx_string("error"), LOG_ERR}, -+ {ngx_string("err"), LOG_ERR}, -+ {ngx_string("warn"), LOG_WARNING}, -+ {ngx_string("notice"),LOG_NOTICE}, -+ {ngx_string("info"), LOG_INFO}, -+ {ngx_string("debug"), LOG_DEBUG}, -+ { ngx_null_string, 0} -+}; -+#endif - - static ngx_str_t err_levels[] = { - ngx_null_string, -@@ -89,11 +153,16 @@ ngx_log_error_core(ngx_uint_t level, ngx - va_list args; - #endif - u_char *p, *last, *msg; -+#if (NGX_ENABLE_SYSLOG) -+ u_char *errstr_syslog; -+#endif - u_char errstr[NGX_MAX_ERROR_STR]; - -+#if !(NGX_ENABLE_SYSLOG) - if (log->file->fd == NGX_INVALID_FILE) { - return; - } -+#endif - - last = errstr + NGX_MAX_ERROR_STR; - -@@ -102,6 +171,10 @@ ngx_log_error_core(ngx_uint_t level, ngx - - p = errstr + ngx_cached_err_log_time.len; - -+#if (NGX_ENABLE_SYSLOG) -+ errstr_syslog = p; -+#endif -+ - p = ngx_slprintf(p, last, " [%V] ", &err_levels[level]); - - /* pid#tid */ -@@ -140,11 +213,27 @@ ngx_log_error_core(ngx_uint_t level, ngx - - ngx_linefeed(p); - -+#if (NGX_ENABLE_SYSLOG) -+ if (log->file != NULL && log->file->name.len != 0) { - (void) ngx_write_fd(log->file->fd, errstr, p - errstr); -+ } -+ -+ /* Don't send the debug level info to syslog */ -+ if (log->syslog_on && level < NGX_LOG_DEBUG) { -+ /* write to syslog */ -+ syslog(log->priority, "%.*s", (int)(p - errstr_syslog), errstr_syslog); -+ } -+#else -+ (void) ngx_write_fd(log->file->fd, errstr, p - errstr); -+#endif - - if (!ngx_use_stderr - || level > NGX_LOG_WARN -+#if (NGX_ENABLE_SYSLOG) -+ || (log->file != NULL && log->file->fd == ngx_stderr)) -+#else - || log->file->fd == ngx_stderr) -+#endif - { - return; - } -@@ -367,6 +456,50 @@ ngx_log_create(ngx_cycle_t *cycle, ngx_s - } - - -+#if (NGX_ENABLE_SYSLOG) -+ngx_int_t -+ngx_log_get_priority(ngx_conf_t *cf, ngx_str_t *priority) -+{ -+ ngx_int_t p = 0; -+ ngx_uint_t n, match = 0; -+ -+ for (n = 0; ngx_syslog_priorities[n].name.len != 0; n++) { -+ if (ngx_strncmp(priority->data, ngx_syslog_priorities[n].name.data, -+ ngx_syslog_priorities[n].name.len) == 0) { -+ p = ngx_syslog_priorities[n].macro; -+ match = 1; -+ } -+ } -+ -+ if (!match) { -+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, -+ "invalid syslog priority \"%V\"", priority); -+ return -1; -+ } -+ -+ return p; -+} -+ -+ -+char * -+ngx_log_set_priority(ngx_conf_t *cf, ngx_str_t *priority, ngx_log_t *log) -+{ -+ log->priority = ERR_SYSLOG_PRIORITY; -+ -+ if (priority->len == 0) { -+ return NGX_CONF_OK; -+ } -+ -+ log->priority = ngx_log_get_priority(cf, priority); -+ if (log->priority == (-1)) { -+ return NGX_CONF_ERROR; -+ } -+ -+ return NGX_CONF_OK; -+} -+#endif -+ -+ - char * - ngx_log_set_levels(ngx_conf_t *cf, ngx_log_t *log) - { -@@ -429,6 +562,13 @@ static char * - ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) - { - ngx_str_t *value, name; -+#if (NGX_ENABLE_SYSLOG) -+ u_char *off = NULL; -+ ngx_str_t priority; -+ -+ ngx_str_null(&name); -+ ngx_str_null(&priority); -+#endif - - if (cf->cycle->new_log.file) { - return "is duplicate"; -@@ -436,7 +576,44 @@ ngx_error_log(ngx_conf_t *cf, ngx_comman - - value = cf->args->elts; - -+#if (NGX_ENABLE_SYSLOG) -+ if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) { -+ if (!cf->cycle->new_log.syslog_set) { -+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, -+ "You must set the syslog directive and enable it first."); -+ return NGX_CONF_ERROR; -+ } -+ -+ cf->cycle->new_log.syslog_on = 1; -+ -+ if (value[1].data[sizeof("syslog") - 1] == ':') { -+ priority.len = value[1].len - sizeof("syslog"); -+ priority.data = value[1].data + sizeof("syslog"); -+ -+ off = (u_char *)ngx_strchr(priority.data, (int) '|'); -+ if (off != NULL) { -+ priority.len = off - priority.data; -+ -+ off++; -+ name.len = value[1].data + value[1].len - off; -+ name.data = off; -+ } -+ } -+ else { -+ if (value[1].len > sizeof("syslog")) { -+ name.len = value[1].len - sizeof("syslog"); -+ name.data = value[1].data + sizeof("syslog"); -+ } -+ } -+ -+ if (ngx_log_set_priority(cf, &priority, &cf->cycle->new_log) == NGX_CONF_ERROR) { -+ return NGX_CONF_ERROR; -+ } -+ } -+ else if (ngx_strcmp(value[1].data, "stderr") == 0) { -+#else - if (ngx_strcmp(value[1].data, "stderr") == 0) { -+#endif - ngx_str_null(&name); - - } else { -@@ -457,3 +634,63 @@ ngx_error_log(ngx_conf_t *cf, ngx_comman - - return ngx_log_set_levels(cf, &cf->cycle->new_log); - } -+ -+ -+#if (NGX_ENABLE_SYSLOG) -+ -+#define SYSLOG_IDENT_NAME "nginx" -+ -+static char * -+ngx_set_syslog(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -+{ -+ char *program; -+ ngx_str_t *value; -+ ngx_int_t facility, match = 0; -+ ngx_uint_t n; -+ -+ value = cf->args->elts; -+ -+ if (cf->cycle->new_log.syslog_set) { -+ return "is duplicate"; -+ } -+ -+ cf->cycle->new_log.syslog_set = 1; -+ -+ for (n = 0; ngx_syslog_facilities[n].name.len != 0; n++) { -+ if (ngx_strncmp(value[1].data, ngx_syslog_facilities[n].name.data, -+ ngx_syslog_facilities[n].name.len) == 0) { -+ facility = ngx_syslog_facilities[n].macro; -+ match = 1; -+ break; -+ } -+ } -+ -+ if (match) { -+ cf->cycle->new_log.facility = facility; -+ cf->cycle->new_log.priority = ERR_SYSLOG_PRIORITY; -+ } -+ else { -+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, -+ "invalid syslog facility \"%V\"", &value[1]); -+ return NGX_CONF_ERROR; -+ } -+ -+ program = SYSLOG_IDENT_NAME; -+ if (cf->args->nelts > 2) { -+ program = (char *) value[2].data; -+ } -+ -+ openlog(program, LOG_ODELAY, facility); -+ -+ return NGX_CONF_OK; -+} -+ -+ -+void log_exit(ngx_cycle_t *cycle) -+{ -+ if (cycle->new_log.syslog_set) { -+ closelog(); -+ } -+} -+#endif -+ -Index: nginx-1.4.7/src/core/ngx_log.h -=================================================================== ---- nginx-1.4.7.orig/src/core/ngx_log.h -+++ nginx-1.4.7/src/core/ngx_log.h -@@ -12,6 +12,13 @@ - #include <ngx_config.h> - #include <ngx_core.h> - -+#if (NGX_ENABLE_SYSLOG) -+#include <syslog.h> -+ -+#define SYSLOG_FACILITY LOG_LOCAL5 -+#define ERR_SYSLOG_PRIORITY LOG_ERR -+#endif -+ - - #define NGX_LOG_STDERR 0 - #define NGX_LOG_EMERG 1 -@@ -61,6 +68,13 @@ struct ngx_log_s { - */ - - char *action; -+ -+#if (NGX_ENABLE_SYSLOG) -+ ngx_int_t priority; -+ ngx_int_t facility; -+ unsigned syslog_on:1; /* unsigned :1 syslog_on */ -+ unsigned syslog_set:1; /*unsigned :1 syslog_set */ -+#endif - }; - - -@@ -221,6 +235,10 @@ void ngx_cdecl ngx_log_debug_core(ngx_lo - - ngx_log_t *ngx_log_init(u_char *prefix); - ngx_log_t *ngx_log_create(ngx_cycle_t *cycle, ngx_str_t *name); -+#if (NGX_ENABLE_SYSLOG) -+ngx_int_t ngx_log_get_priority(ngx_conf_t *cf, ngx_str_t *priority); -+char * ngx_log_set_priority(ngx_conf_t *cf, ngx_str_t *priority, ngx_log_t *log); -+#endif - char *ngx_log_set_levels(ngx_conf_t *cf, ngx_log_t *log); - void ngx_cdecl ngx_log_abort(ngx_err_t err, const char *fmt, ...); - void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...); -Index: nginx-1.4.7/src/http/modules/ngx_http_log_module.c -=================================================================== ---- nginx-1.4.7.orig/src/http/modules/ngx_http_log_module.c -+++ nginx-1.4.7/src/http/modules/ngx_http_log_module.c -@@ -13,6 +13,11 @@ - #include <zlib.h> - #endif - -+#if (NGX_ENABLE_SYSLOG) -+#include <syslog.h> -+ -+#define HTTP_SYSLOG_PRIORITY LOG_NOTICE -+#endif - - typedef struct ngx_http_log_op_s ngx_http_log_op_t; - -@@ -67,6 +72,11 @@ typedef struct { - time_t disk_full_time; - time_t error_log_time; - ngx_http_log_fmt_t *format; -+ -+#if (NGX_ENABLE_SYSLOG) -+ ngx_int_t priority; -+ unsigned syslog_on:1; /* unsigned :1 syslog_on */ -+#endif - } ngx_http_log_t; - - -@@ -348,6 +358,14 @@ ngx_http_log_write(ngx_http_request_t *r - time_t now; - ssize_t n; - ngx_err_t err; -+ -+#if (NGX_ENABLE_SYSLOG) -+ n = 0; -+ if (log->syslog_on) { -+ syslog(log->priority, "%.*s", (int)len, buf); -+ } -+#endif -+ - #if (NGX_ZLIB) - ngx_http_log_buf_t *buffer; - #endif -@@ -355,6 +373,9 @@ ngx_http_log_write(ngx_http_request_t *r - if (log->script == NULL) { - name = log->file->name.data; - -+#if (NGX_ENABLE_SYSLOG) -+ if (name != NULL) { -+#endif - #if (NGX_ZLIB) - buffer = log->file->data; - -@@ -367,7 +388,11 @@ ngx_http_log_write(ngx_http_request_t *r - #else - n = ngx_write_fd(log->file->fd, buf, len); - #endif -- -+#if (NGX_ENABLE_SYSLOG) -+ } else { -+ n = len; -+ } -+#endif - } else { - name = NULL; - n = ngx_http_log_script_write(r, log->script, &name, buf, len); -@@ -1068,6 +1093,10 @@ ngx_http_log_merge_loc_conf(ngx_conf_t * - log->script = NULL; - log->disk_full_time = 0; - log->error_log_time = 0; -+#if (NGX_ENABLE_SYSLOG) -+ log->priority = HTTP_SYSLOG_PRIORITY; -+ log->syslog_on = 0; -+#endif - - lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module); - fmt = lmcf->formats.elts; -@@ -1096,6 +1125,13 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx - ngx_http_log_main_conf_t *lmcf; - ngx_http_script_compile_t sc; - -+#if (NGX_ENABLE_SYSLOG) -+ u_char *off; -+ ngx_str_t priority; -+ ngx_uint_t syslog_on = 0; -+ name = priority = (ngx_str_t)ngx_null_string; -+#endif -+ - value = cf->args->elts; - - if (ngx_strcmp(value[1].data, "off") == 0) { -@@ -1108,6 +1144,38 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx - "invalid parameter \"%V\"", &value[2]); - return NGX_CONF_ERROR; - } -+#if (NGX_ENABLE_SYSLOG) -+ else if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) { -+ if (!cf->cycle->new_log.syslog_set) { -+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, -+ "You must set the syslog directive and enable it first."); -+ return NGX_CONF_ERROR; -+ } -+ -+ syslog_on = 1; -+ if (value[1].data[sizeof("syslog") - 1] == ':') { -+ priority.len = value[1].len - sizeof("syslog"); -+ priority.data = value[1].data + sizeof("syslog"); -+ -+ off = (u_char*) ngx_strchr(priority.data, '|'); -+ if (off != NULL) { -+ priority.len = off - priority.data; -+ -+ off++; -+ name.len = value[1].data + value[1].len - off; -+ name.data = off; -+ } -+ } -+ else { -+ if (value[1].len > sizeof("syslog")) { -+ name.len = value[1].len - sizeof("syslog"); -+ name.data = value[1].data + sizeof("syslog"); -+ } -+ } -+ } else { -+ name = value[1]; -+ } -+#endif - - if (llcf->logs == NULL) { - llcf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_log_t)); -@@ -1125,6 +1193,52 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx - - ngx_memzero(log, sizeof(ngx_http_log_t)); - -+#if (NGX_ENABLE_SYSLOG) -+ log->syslog_on = syslog_on; -+ -+ if (priority.len == 0) { -+ log->priority = HTTP_SYSLOG_PRIORITY; -+ } -+ else { -+ log->priority = ngx_log_get_priority(cf, &priority); -+ } -+ -+ if (name.len != 0) { -+ n = ngx_http_script_variables_count(&name); -+ -+ if (n == 0) { -+ log->file = ngx_conf_open_file(cf->cycle, &name); -+ if (log->file == NULL) { -+ return NGX_CONF_ERROR; -+ } -+ } else { -+ if (ngx_conf_full_name(cf->cycle, &name, 0) != NGX_OK) { -+ return NGX_CONF_ERROR; -+ } -+ log->script = ngx_pcalloc(cf->pool, sizeof(ngx_http_log_script_t)); -+ if (log->script == NULL) { -+ return NGX_CONF_ERROR; -+ } -+ ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); -+ sc.cf = cf; -+ sc.source = &name; -+ sc.lengths = &log->script->lengths; -+ sc.values = &log->script->values; -+ sc.variables = n; -+ sc.complete_lengths = 1; -+ sc.complete_values = 1; -+ if (ngx_http_script_compile(&sc) != NGX_OK) { -+ return NGX_CONF_ERROR; -+ } -+ } -+ } -+ else { -+ log->file = ngx_conf_open_file(cf->cycle, &name); -+ if (log->file == NULL) { -+ return NGX_CONF_ERROR; -+ } -+ } -+#else - n = ngx_http_script_variables_count(&value[1]); - - if (n == 0) { -@@ -1157,6 +1271,7 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx - return NGX_CONF_ERROR; - } - } -+#endif - - if (cf->args->nelts >= 3) { - name = value[2]; -Index: nginx-1.4.7/src/http/ngx_http_core_module.c -=================================================================== ---- nginx-1.4.7.orig/src/http/ngx_http_core_module.c -+++ nginx-1.4.7/src/http/ngx_http_core_module.c -@@ -1462,6 +1462,9 @@ ngx_http_update_location_config(ngx_http - - if (r == r->main) { - ngx_http_set_connection_log(r->connection, clcf->error_log); -+#if (NGX_ENABLE_SYSLOG) -+ r->connection->log->priority = clcf->error_log->priority; -+#endif - } - - if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) { -@@ -4901,6 +4904,15 @@ ngx_http_core_error_log(ngx_conf_t *cf, - - ngx_str_t *value, name; - -+#if (NGX_ENABLE_SYSLOG) -+ u_char *off = NULL; -+ ngx_int_t syslog_on = 0; -+ ngx_str_t priority; -+ -+ name = priority = (ngx_str_t) ngx_null_string; -+#endif -+ -+ - if (clcf->error_log) { - return "is duplicate"; - } -@@ -4910,6 +4922,36 @@ ngx_http_core_error_log(ngx_conf_t *cf, - if (ngx_strcmp(value[1].data, "stderr") == 0) { - ngx_str_null(&name); - -+#if (NGX_ENABLE_SYSLOG) -+ } else if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) { -+ if (!cf->cycle->new_log.syslog_set) { -+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, -+ "You must set the syslog directive and enable it first."); -+ return NGX_CONF_ERROR; -+ } -+ -+ syslog_on = 1; -+ -+ if (value[1].data[sizeof("syslog") - 1] == ':') { -+ priority.len = value[1].len - sizeof("syslog"); -+ priority.data = value[1].data + sizeof("syslog"); -+ -+ off = (u_char*) ngx_strchr(priority.data, '|'); -+ if (off != NULL) { -+ priority.len = off - priority.data; -+ -+ off++; -+ name.len = value[1].data + value[1].len - off; -+ name.data = off; -+ } -+ } -+ else { -+ if (value[1].len > sizeof("syslog")) { -+ name.len = value[1].len - sizeof("syslog"); -+ name.data = value[1].data + sizeof("syslog"); -+ } -+ } -+#endif - } else { - name = value[1]; - } -@@ -4919,6 +4961,17 @@ ngx_http_core_error_log(ngx_conf_t *cf, - return NGX_CONF_ERROR; - } - -+#if (NGX_ENABLE_SYSLOG) -+ if (syslog_on) { -+ clcf->error_log->syslog_on = 1; -+ if (ngx_log_set_priority(cf, &priority, clcf->error_log) == NGX_CONF_ERROR) { -+ return NGX_CONF_ERROR; -+ } -+ } -+ -+ clcf->error_log->log_level = 0; -+#endif -+ - if (cf->args->nelts == 2) { - clcf->error_log->log_level = NGX_LOG_ERR; - return NGX_CONF_OK; -Index: nginx-1.4.7/src/http/ngx_http_request.c -=================================================================== ---- nginx-1.4.7.orig/src/http/ngx_http_request.c -+++ nginx-1.4.7/src/http/ngx_http_request.c -@@ -533,6 +533,9 @@ ngx_http_create_request(ngx_connection_t - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - - ngx_http_set_connection_log(r->connection, clcf->error_log); -+#if (NGX_ENABLE_SYSLOG) -+ c->log->priority = clcf->error_log->priority; -+#endif - - r->header_in = hc->nbusy ? hc->busy[0] : c->buffer; - -@@ -872,6 +875,9 @@ ngx_http_ssl_servername(ngx_ssl_conn_t * - clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module); - - ngx_http_set_connection_log(c, clcf->error_log); -+#if (NGX_ENABLE_SYSLOG) -+ c->log->priority = clcf->error_log->priority; -+#endif - - sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_ssl_module); - -@@ -2077,6 +2083,9 @@ ngx_http_set_virtual_server(ngx_http_req - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - - ngx_http_set_connection_log(r->connection, clcf->error_log); -+#if (NGX_ENABLE_SYSLOG) -+ r->connection->log->priority = clcf->error_log->priority; -+#endif - - return NGX_OK; - } diff --git a/net/snort/Makefile b/net/snort/Makefile index 33f8b6d5e..c8c7a1aff 100644 --- a/net/snort/Makefile +++ b/net/snort/Makefile @@ -12,7 +12,7 @@ PKG_VERSION:=2.9.7.2 PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/ \ +PKG_SOURCE_URL:=https://www.snort.org/downloads/archive/snort/ \ @SF/$(PKG_NAME) PKG_MD5SUM:=b01e9964827394c39194a0147bc15705 diff --git a/net/squid/Makefile b/net/squid/Makefile index a5e43b340..b9cedd7ea 100644 --- a/net/squid/Makefile +++ b/net/squid/Makefile @@ -8,15 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=squid -PKG_VERSION:=3.5.12 +PKG_VERSION:=3.5.27 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 -PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org> +PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr> PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=http://www.squid-cache.org/Versions/v3/3.5/ -PKG_MD5SUM:=50016bf6e2d3a3a186a6c7236d251f63 +PKG_SOURCE_URL:=http://www3.us.squid-cache.org/Versions/v3/3.5/ \ + http://www2.pl.squid-cache.org/Versions/v3/3.5/ \ + http://www.squid-cache.org/Versions/v3/3.5/ +PKG_HASH:=5ddb4367f2dc635921f9ca7a59d8b87edb0412fa203d1543393ac3c7f9fef0ec PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 @@ -28,11 +30,11 @@ define Package/squid/Default CATEGORY:=Network SUBMENU:=Web Servers/Proxies URL:=http://www.squid-cache.org/ + MENU:=1 endef define Package/squid $(call Package/squid/Default) - MENU:=1 DEPENDS:=+libopenssl +libpthread +librt +libltdl +libstdcpp TITLE:=full-featured Web proxy cache endef @@ -85,6 +87,7 @@ CONFIGURE_ARGS += \ --disable-auth-basic \ --disable-arch-native \ --with-krb5-config=no \ + --without-mit-krb5 \ --without-libcap \ --without-netfilter-conntrack diff --git a/net/squid/files/squid.config b/net/squid/files/squid.config index 4c0daae95..327ecef7c 100644 --- a/net/squid/files/squid.config +++ b/net/squid/files/squid.config @@ -3,3 +3,7 @@ config squid 'squid' option http_port '3128' option coredump_dir '/tmp/squid' option visible_hostname 'OpenWrt' + option mime_table '/etc/squid/mime.conf' + #option http_port_options 'intercept' + #option ssldb '/tmp/squid/ssldb' + #option ssldb_options '-M 4MB' diff --git a/net/squid/files/squid.init b/net/squid/files/squid.init index 8b3094840..177b1490c 100644 --- a/net/squid/files/squid.init +++ b/net/squid/files/squid.init @@ -7,6 +7,7 @@ STOP=10 USE_PROCD=1 PROG=/usr/sbin/squid CONFIGFILE="/tmp/squid/squid.conf" +MIMETABLE="/tmp/squid/mime.conf" validate_squid_section() { uci_validate_section squid squid "${1}" \ @@ -14,7 +15,8 @@ validate_squid_section() { 'http_port:port:3128' \ 'coredump_dir:string' \ 'visible_hostname:string:OpenWrt' \ - 'pinger_enable:string:off' + 'pinger_enable:string:off' \ + 'mime_table:string:/etc/squid/mime.conf' } start_service() { @@ -33,6 +35,9 @@ start_service() { echo visible_hostname $visible_hostname >> $CONFIGFILE echo pinger_enable $pinger_enable >> $CONFIGFILE + cat $mime_table > $MIMETABLE + echo mime_table $MIMETABLE >> $CONFIGFILE + procd_open_instance procd_set_param command $PROG -s -f $CONFIGFILE -N procd_set_param file $CONFIGFILE diff --git a/net/squid/patches/001-cross_compile.patch b/net/squid/patches/001-cross_compile.patch index c7493bbce..be9fdcd25 100644 --- a/net/squid/patches/001-cross_compile.patch +++ b/net/squid/patches/001-cross_compile.patch @@ -1,24 +1,40 @@ --- a/src/Makefile.in +++ b/src/Makefile.in -@@ -7761,3 +7761,3 @@ cache_cf.o: cf_parser.cci +@@ -7984,7 +7984,7 @@ cache_cf.o: cf_parser.cci + + # cf_gen builds the configuration files. cf_gen$(EXEEXT): $(cf_gen_SOURCES) $(cf_gen_DEPENDENCIES) cf_gen_defines.cci - $(BUILDCXX) $(BUILDCXXFLAGS) -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src + g++ -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src + # squid.conf.default is built by cf_gen when making cf_parser.cci + squid.conf.default squid.conf.documented: cf_parser.cci --- a/configure +++ b/configure -@@ -20133,3 +20133,3 @@ if test "$cross_compiling" = yes; then : +@@ -20842,7 +20842,7 @@ else + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling +_as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -@@ -28289,3 +28289,3 @@ else + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -29142,7 +29142,7 @@ else + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling +_as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -@@ -28314,3 +28314,3 @@ else + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -29167,7 +29167,7 @@ else + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling +_as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext diff --git a/net/squid/patches/100-mime.patch b/net/squid/patches/100-mime.patch deleted file mode 100644 index 1138a413d..000000000 --- a/net/squid/patches/100-mime.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/src/mime.conf.default -+++ b/src/mime.conf.default -@@ -1,20 +1,3 @@ --## Copyright (C) 1996-2015 The Squid Software Foundation and contributors --## --## Squid software is distributed under GPLv2+ license and includes --## contributions from numerous individuals and organizations. --## Please see the COPYING and CONTRIBUTORS files for details. --## --# --# This file associates URL patterns for servers or services --# that don't automatically include Content-Type (like ftp) with a mime type --# and a graphical icon. --# --# Content-Encodings are taken from section 3.1 of RFC2068 (HTTP/1.1) --# --# This file has the format : --# --# regexp content-type icon encoding mode actions --#-------------------------------------------------------------------------------------------------------- - \.gif$ image/gif silk/image.png - image +download - \.mime$ www/mime silk/page_white_text.png - ascii +download - ^internal-dirup$ - silk/arrow_up.png - - -@@ -191,6 +174,4 @@ README text/plain silk/information.pn - \.xml$ text/xml silk/page_world.png - ascii +download - \.xsl$ text/xml silk/layout.png - ascii +download - \.xyz$ chemical/x-xyz silk/chart_line.png - image +download --# --# the default - . text/plain silk/bullet_red.png - image +download +view diff --git a/net/sshfs/Makefile b/net/sshfs/Makefile index d99dd927f..1da1f119a 100644 --- a/net/sshfs/Makefile +++ b/net/sshfs/Makefile @@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sshfs -PKG_VERSION:=2.5 +PKG_VERSION:=2.10 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu> -PKG_SOURCE:=$(PKG_NAME)-fuse-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=@SF/fuse -PKG_MD5SUM:=17494910db8383a366b1301e5f5148a9 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/libfuse/sshfs/releases/download/$(PKG_NAME)-$(PKG_VERSION) +PKG_MD5SUM:=c99a1bcf3934d45e4a6342113669df4b -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-fuse-$(PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk diff --git a/net/sslh/Makefile b/net/sslh/Makefile index e7f1c0e6b..f626b2e36 100644 --- a/net/sslh/Makefile +++ b/net/sslh/Makefile @@ -11,9 +11,11 @@ PKG_NAME:=sslh PKG_VERSION:=v1.17 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://rutschle.net/tech/ -PKG_MD5SUM:=1fc3ada4bafaca5a9786cc1431f48ed4 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=https://github.com/yrutschle/sslh.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=3550cbe PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING diff --git a/net/stunnel/Makefile b/net/stunnel/Makefile index 0b928b7f6..196196b25 100644 --- a/net/stunnel/Makefile +++ b/net/stunnel/Makefile @@ -8,16 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=stunnel -PKG_VERSION:=5.14 +PKG_VERSION:=5.20 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0+ PKG_MAINTAINER:=Michael Haas <haas@computerlinguist.org> PKG_LICENSE_FILES:=COPYING COPYRIGHT.GPL -PKG_SOURCE_URL:=http://stunnel.cybermirror.org/archive/5.x/ +PKG_SOURCE_URL:=\ + http://ftp.nluug.nl/pub/networking/stunnel/archive/5.x/ \ + http://www.usenix.org.uk/mirrors/stunnel/archive/5.x/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_MD5SUM:=e716501960dc6856d80f92547298f724 +PKG_MD5SUM:=3264375026c2b496b5d258e243222de8 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -27,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk define Package/stunnel SECTION:=net CATEGORY:=Network - DEPENDS:=+libopenssl + DEPENDS:=+libopenssl +zlib TITLE:=SSL TCP Wrapper URL:=http://www.stunnel.org/ endef diff --git a/net/stunnel/patches/010_fix_getnameinfo.patch b/net/stunnel/patches/010_fix_getnameinfo.patch deleted file mode 100644 index 03acfafac..000000000 --- a/net/stunnel/patches/010_fix_getnameinfo.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/src/prototypes.h -+++ b/src/prototypes.h -@@ -590,7 +590,7 @@ extern GETNAMEINFO s_getnameinfo; - - #endif /* USE_WIN32 */ - --int getnameinfo(const struct sockaddr *, int, char *, int, char *, int, int); -+int getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, unsigned int); - - #endif /* !defined HAVE_GETNAMEINFO */ - ---- a/src/resolver.c -+++ b/src/resolver.c -@@ -538,8 +538,9 @@ const char *s_gai_strerror(int err) { - /* implementation is limited to functionality needed by stunnel */ - - #ifndef HAVE_GETNAMEINFO --int getnameinfo(const struct sockaddr *sa, int salen, -- char *host, int hostlen, char *serv, int servlen, int flags) { -+int getnameinfo(const struct sockaddr *sa, socklen_t salen, -+ char *host, socklen_t hostlen, char *serv, socklen_t servlen, -+ unsigned int flags) { - - #if defined(USE_WIN32) && !defined(_WIN32_WCE) - if(s_getnameinfo) diff --git a/net/stunnel/patches/012-cron-without-pthread-fix.patch b/net/stunnel/patches/012-cron-without-pthread-fix.patch new file mode 100644 index 000000000..0f644b3c1 --- /dev/null +++ b/net/stunnel/patches/012-cron-without-pthread-fix.patch @@ -0,0 +1,14 @@ +Index: stunnel-5.20/src/cron.c +=================================================================== +--- stunnel-5.20.orig/src/cron.c ++++ stunnel-5.20/src/cron.c +@@ -46,6 +46,9 @@ NOEXPORT void cron_thread(void *arg); + #endif + #if defined(USE_PTHREAD) || defined(USE_WIN32) + NOEXPORT void cron_worker(void); ++#endif ++ ++#ifndef OPENSSL_NO_DH + NOEXPORT void cron_dh_param(void); + #endif + diff --git a/net/tor/Makefile b/net/tor/Makefile index ce2135ec8..ed5551f9c 100644 --- a/net/tor/Makefile +++ b/net/tor/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2008-2014 OpenWrt.org +# Copyright (C) 2008-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tor -PKG_VERSION:=0.2.7.6 +PKG_VERSION:=0.2.9.11 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://www.torproject.org/dist \ +PKG_SOURCE_URL:=https://dist.torproject.org/ \ https://archive.torproject.org/tor-package-archive -PKG_MD5SUM:=cc19107b57136a68e8c563bf2d35b072 +PKG_MD5SUM:=763ae964e916c2a7a4c5015d351fcf8b +PKG_HASH:=c1959bebff9a546a54cbedb58c8289a42441991af417d2d16f7b336be8903221 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=libminiupnpc libnatpmp PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk @@ -41,7 +41,7 @@ endef define Package/tor $(call Package/tor/Default) TITLE:=An anonymous Internet communication system - DEPENDS:=+libevent2 +libopenssl +libpthread +librt + DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap endef define Package/tor/description @@ -49,15 +49,26 @@ $(call Package/tor/Default/description) This package contains the tor daemon. endef -define Package/tor-fw-helper +define Package/tor-gencert $(call Package/tor/Default) - TITLE:=Firewall helper for tor - DEPENDS:=+tor +libminiupnpc +libnatpmp + TITLE:=Tor certificate generation + DEPENDS:=+tor endef -define Package/tor-fw-helper/description +define Package/tor-gencert/description $(call Package/tor/Default/description) - This package contains a helper for automatically configuring port forwarding. + Generate certs and keys for Tor directory authorities +endef + +define Package/tor-resolve +$(call Package/tor/Default) + TITLE:=tor hostname resolve + DEPENDS:=+tor +endef + +define Package/tor-resolve/description +$(call Package/tor/Default/description) + Resolve a hostname to an IP address via tor endef define Package/tor-geoip @@ -73,26 +84,30 @@ endef define Package/tor/conffiles /etc/tor/torrc +/var/lib/tor/fingerprint +/var/lib/tor/keys/* endef CONFIGURE_ARGS += \ --with-libevent-dir="$(STAGING_DIR)/usr" \ --with-ssl-dir="$(STAGING_DIR)/usr" \ - --enable-upnp \ - --with-libminiupnpc-dir="$(STAGING_DIR)/usr" \ - --enable-nat-pmp \ - --with-libnatpmp-dir="$(STAGING_DIR)/usr" \ + --with-openssl-dir="$(STAGING_DIR)/usr" \ + --with-zlib-dir="$(STAGING_DIR)/usr" \ --disable-asciidoc \ - --disable-seccomp + --disable-seccomp \ + --disable-libscrypt \ + --disable-unittests \ + --disable-largefile \ + --with-tor-user=tor \ + --with-tor-group=tor + +EXTRA_CFLAGS += -std=gnu99 ifneq ($(CONFIG_SSP_SUPPORT),y) CONFIGURE_ARGS += \ --disable-gcc-hardening - MAKE_FLAGS += \ - CFLAGS="$(TARGET_CFLAGS) -std=gnu99" else - MAKE_FLAGS += \ - CFLAGS="$(TARGET_CFLAGS) -fPIC -std=gnu99" + EXTRA_CFLAGS += -fPIC endif CONFIGURE_VARS += \ @@ -101,22 +116,30 @@ CONFIGURE_VARS += \ define Package/tor/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/torify $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor $(INSTALL_DIR) $(1)/etc/tor $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc endef -define Package/tor-fw-helper/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-fw-helper $(1)/usr/bin/ +define Package/tor-gencert/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/ +endef + +define Package/tor-resolve/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/ endef define Package/tor-geoip/install $(INSTALL_DIR) $(1)/usr/share/tor $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/ + $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 $(1)/usr/share/tor/ endef $(eval $(call BuildPackage,tor)) -$(eval $(call BuildPackage,tor-fw-helper)) +$(eval $(call BuildPackage,tor-gencert)) +$(eval $(call BuildPackage,tor-resolve)) $(eval $(call BuildPackage,tor-geoip)) diff --git a/net/tor/patches/001-torrc.patch b/net/tor/patches/001-torrc.patch index e295219f1..1a784d2ff 100644 --- a/net/tor/patches/001-torrc.patch +++ b/net/tor/patches/001-torrc.patch @@ -1,11 +1,15 @@ --- a/src/config/torrc.sample.in +++ b/src/config/torrc.sample.in -@@ -45,11 +45,11 @@ - ## Uncomment this to start the process in the background... or use - ## --runasdaemon 1 on the command line. This is ignored on Windows; - ## see the FAQ entry if you want Tor to run as an NT service. --#RunAsDaemon 1 -+RunAsDaemon 1 +@@ -39,7 +39,7 @@ + ## Send every possible message to @LOCALSTATEDIR@/log/tor/debug.log + #Log debug file @LOCALSTATEDIR@/log/tor/debug.log + ## Use the system log instead of Tor's logfiles +-#Log notice syslog ++Log notice syslog + ## To send all messages to stderr: + #Log debug stderr + +@@ -50,7 +50,7 @@ ## The directory for keeping all the keys/etc. By default, we store ## things in $HOME/.tor on Unix, and in Application Data\tor on Windows. @@ -14,7 +18,7 @@ ## The port on which Tor will listen for local connections from Tor ## controller applications, as documented in control-spec.txt. -@@ -190,3 +190,4 @@ +@@ -204,3 +204,4 @@ ## address manually to your friends, uncomment this line: #PublishServerDescriptor 0 diff --git a/net/wifidog/Makefile b/net/wifidog/Makefile index ade7606c3..591f29107 100644 --- a/net/wifidog/Makefile +++ b/net/wifidog/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wifidog -PKG_VERSION:=1.2.1 +PKG_VERSION:=1.3.0 PKG_RELEASE=1 @@ -22,7 +22,7 @@ PKG_LICENSE_FILES:=COPYING PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=git://github.com/wifidog/wifidog-gateway.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=1.2.1 +PKG_SOURCE_VERSION:=1.3.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_FIXUP:=autoreconf diff --git a/sound/pianod/Makefile b/sound/pianod/Makefile index 0c6689454..7fb48a9cd 100644 --- a/sound/pianod/Makefile +++ b/sound/pianod/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pianod -PKG_VERSION:=173 -PKG_RELEASE:=3 +PKG_VERSION:=174 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://deviousfish.com/Downloads/pianod/ -PKG_MD5SUM:=be0cec19ea6df1c4bc6c1cac8e253445 +PKG_MD5SUM:=cca2143e4a5301dea8c0cb9fcbd20881 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net> diff --git a/sound/pianod/patches/005-Fix_IPV6_socket_handling.patch b/sound/pianod/patches/005-Fix_IPV6_socket_handling.patch deleted file mode 100644 index 883495a1a..000000000 --- a/sound/pianod/patches/005-Fix_IPV6_socket_handling.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- a/src/libwaitress/waitress.c -+++ b/src/libwaitress/waitress.c -@@ -805,34 +805,37 @@ static WaitressReturn_t WaitressConnect - int pollres; - - /* we need shorter timeouts for connect() */ -- fcntl (sock, F_SETFL, O_NONBLOCK); -+ pollres = fcntl (sock, F_SETFL, O_NONBLOCK); -+ assert (pollres != -1); - -- /* increase socket receive buffer */ -- const int sockopt = 256*1024; -- setsockopt (sock, SOL_SOCKET, SO_RCVBUF, &sockopt, -- sizeof (sockopt)); -- -- /* non-blocking connect will return immediately */ -- connect (sock, gacurr->ai_addr, gacurr->ai_addrlen); -- -- pollres = WaitressPollLoop (sock, POLLOUT, waith->timeout); -- if (pollres == 0) { -- ret = WAITRESS_RET_TIMEOUT; -- } else if (pollres == -1) { -- ret = WAITRESS_RET_ERR; -- } else { -- /* check connect () return value */ -- socklen_t pollresSize = sizeof (pollres); -- getsockopt (sock, SOL_SOCKET, SO_ERROR, &pollres, -- &pollresSize); -- if (pollres != 0) { -- ret = WAITRESS_RET_CONNECT_REFUSED; -+ if (connect (sock, gacurr->ai_addr, gacurr->ai_addrlen) != -1) { -+ /* working */ -+ waith->request.sockfd = sock; -+ break; -+ } else if (errno == EINPROGRESS) { -+ /* wait for connect to succeed */ -+ pollres = WaitressPollLoop (sock, POLLOUT, waith->timeout); -+ if (pollres == 0) { -+ ret = WAITRESS_RET_TIMEOUT; -+ } else if (pollres == -1) { -+ ret = WAITRESS_RET_ERR; - } else { -- /* this one is working */ -- waith->request.sockfd = sock; -- break; -+ /* check connect () return value */ -+ socklen_t pollresSize = sizeof (pollres); -+ getsockopt (sock, SOL_SOCKET, SO_ERROR, &pollres, -+ &pollresSize); -+ if (pollres != 0) { -+ ret = WAITRESS_RET_CONNECT_REFUSED; -+ } else { -+ /* this one is working */ -+ waith->request.sockfd = sock; -+ break; -+ } - } -+ } else { -+ ret = WAITRESS_RET_ERR; - } -+ - close (sock); - } - } ---- a/src/libfootball/fb_service.c -+++ b/src/libfootball/fb_service.c -@@ -111,6 +111,8 @@ static bool fb_setup_socket (FB_SERVICE - service->socket [which] = 0; - } else { - fb_perror ("socket"); -+ // Element must be zero (not -1) -+ service->socket [which] = 0; - }; - return false; - } diff --git a/sound/pianod/patches/005-Remove_svn_version_query.patch b/sound/pianod/patches/005-Remove_svn_version_query.patch new file mode 100644 index 000000000..0ffd3a643 --- /dev/null +++ b/sound/pianod/patches/005-Remove_svn_version_query.patch @@ -0,0 +1,11 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -3,7 +3,7 @@ + + AC_PREREQ([2.69]) + AC_INIT([pianod], +- m4_esyscmd([svn info http://svn.deviousfish.com/pianod | grep Revision: | awk '{print $2}' | tr -d '\n']), ++ 174-OpenWrt, + [pianod@lists.deviousfish.com], + ,[http://deviousfish.com/pianod]) + AM_INIT_AUTOMAKE([foreign -Wall -Werror]) diff --git a/sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch b/sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch index 228710b05..25569ccc2 100644 --- a/sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch +++ b/sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch @@ -19,7 +19,7 @@ --- a/src/libwaitress/waitress.c +++ b/src/libwaitress/waitress.c -@@ -918,14 +918,14 @@ static WaitressReturn_t WaitressSendRequ +@@ -922,14 +922,14 @@ static WaitressReturn_t WaitressSendRequ if (WaitressProxyEnabled (waith) && !waith->url.tls) { snprintf (buf, WAITRESS_BUFFER_SIZE, "%s http://%s:%s/%s HTTP/" WAITRESS_HTTP_VERSION "\r\n" diff --git a/sound/pianod/patches/030-Waitress_add_polarssl_variant.patch b/sound/pianod/patches/030-Waitress_add_polarssl_variant.patch index b2a657645..ad27e9b6a 100644 --- a/sound/pianod/patches/030-Waitress_add_polarssl_variant.patch +++ b/sound/pianod/patches/030-Waitress_add_polarssl_variant.patch @@ -247,7 +247,7 @@ return WAITRESS_RET_OK; } -@@ -876,6 +947,12 @@ static WaitressReturn_t WaitressConnect +@@ -880,6 +951,12 @@ static WaitressReturn_t WaitressConnect } } @@ -260,7 +260,7 @@ /* Ignore return code as connection will likely still succeed */ gnutls_server_name_set (waith->request.tlsSession, GNUTLS_NAME_DNS, waith->url.host, strlen (waith->url.host)); -@@ -883,14 +960,15 @@ static WaitressReturn_t WaitressConnect +@@ -887,14 +964,15 @@ static WaitressReturn_t WaitressConnect if (gnutls_handshake (waith->request.tlsSession) != GNUTLS_E_SUCCESS) { return WAITRESS_RET_TLS_HANDSHAKE_ERR; } @@ -278,7 +278,7 @@ } return WAITRESS_RET_OK; -@@ -1116,6 +1194,21 @@ WaitressReturn_t WaitressFetchCall (Wait +@@ -1120,6 +1198,21 @@ WaitressReturn_t WaitressFetchCall (Wait waith->request.contentLengthKnown = false; if (waith->url.tls) { @@ -300,7 +300,7 @@ gnutls_init (&waith->request.tlsSession, GNUTLS_CLIENT); gnutls_set_default_priority (waith->request.tlsSession); -@@ -1133,6 +1226,7 @@ WaitressReturn_t WaitressFetchCall (Wait +@@ -1137,6 +1230,7 @@ WaitressReturn_t WaitressFetchCall (Wait WaitressPollRead); gnutls_transport_set_push_function (waith->request.tlsSession, WaitressPollWrite); @@ -308,7 +308,7 @@ } /* buffer is required for connect already */ -@@ -1144,15 +1238,22 @@ WaitressReturn_t WaitressFetchCall (Wait +@@ -1148,15 +1242,22 @@ WaitressReturn_t WaitressFetchCall (Wait if ((wRet = WaitressSendRequest (waith)) == WAITRESS_RET_OK) { wRet = WaitressReceiveResponse (waith); } diff --git a/sound/upmpdcli/Config.in b/sound/upmpdcli/Config.in new file mode 100644 index 000000000..fe3272296 --- /dev/null +++ b/sound/upmpdcli/Config.in @@ -0,0 +1,17 @@ +config PACKAGE_UPMPDCLI_SCCTL + bool "scctl command for configuring SongCast receivers" + default no + depends on PACKAGE_upmpdcli + help + Installs the scctl command. See the following link for more info: + http://www.lesbonscomptes.com/upmpdcli/scmulti.html + +config PACKAGE_UPMPDCLI_SC_WEB_INTERFACE + bool "SongCast web server and associated files (depends on python)" + default no + depends on PACKAGE_upmpdcli + select PACKAGE_python + select PACKAGE_UPMPDCLI_SCCTL + help + Installs the SongCast web interface and web server. See the following + link for more info: http://www.lesbonscomptes.com/upmpdcli/scmulti.html diff --git a/sound/upmpdcli/Makefile b/sound/upmpdcli/Makefile index 385a96bee..e10cea99a 100644 --- a/sound/upmpdcli/Makefile +++ b/sound/upmpdcli/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2015 OpenWrt.org +# Copyright (C) 2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=upmpdcli -PKG_VERSION:=0.9.0 -PKG_RELEASE:=2 +PKG_VERSION:=1.1.3 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads -PKG_MD5SUM:=0e7b86037f19ea3a08067409af6f6902 +PKG_MD5SUM:=de9f232d6d5f746ec81ec239e11bdda4 PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com> PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING @@ -29,12 +29,17 @@ define Package/upmpdcli DEPENDS+= +libupnpp +libmpdclient TITLE:=A UPnP front-end to MPD, the Music Player Daemon USERID:=upmpdcli=89:upmpdcli=89 + MENU:=1 endef define Package/upmpdcli/description upmpdcli implements an UPnP Media Renderer, using MPD to perform the real work. endef +define Package/upmpdcli/config + source "$(SOURCE)/Config.in" +endef + define Package/upmpdcli/install $(INSTALL_DIR) $(1)/etc $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/upmpdcli.conf $(1)/etc/ @@ -42,8 +47,14 @@ define Package/upmpdcli/install $(INSTALL_CONF) ./files/upmpdcli.config $(1)/etc/config/upmpdcli $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upmpdcli $(1)/usr/bin/ +ifeq ($(CONFIG_PACKAGE_UPMPDCLI_SCCTL),y) + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scctl $(1)/usr/bin/ +endif $(INSTALL_DIR) $(1)/usr/share/upmpdcli - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/upmpdcli/* $(1)/usr/share/upmpdcli/ +ifneq ($(CONFIG_PACKAGE_UPMPDCLI_SC_WEB_INTERFACE),y) + $(RM) -rf $(PKG_INSTALL_DIR)/usr/share/upmpdcli/web +endif + $(CP) -r $(PKG_INSTALL_DIR)/usr/share/upmpdcli $(1)/usr/share/ $(INSTALL_DATA) ./files/upmpdcli.png $(1)/usr/share/upmpdcli/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/upmpdcli.init $(1)/etc/init.d/upmpdcli diff --git a/sound/upmpdcli/patches/010-Add_icon_config.patch b/sound/upmpdcli/patches/010-Add_icon_config.patch index 9b1ca6db7..3030ae3a4 100644 --- a/sound/upmpdcli/patches/010-Add_icon_config.patch +++ b/sound/upmpdcli/patches/010-Add_icon_config.patch @@ -1,9 +1,11 @@ ---- a/src/upmpdcli.conf -+++ b/src/upmpdcli.conf -@@ -53,3 +53,6 @@ ohmetapersist = 1 - # Path to the sc2mpd if it is not in /usr/bin and the location is not in - # the PATH for the init scripts. - #sc2mpd = /usr/bin/sc2mpd -+ -+# Icon for MPD UPnP interface -+iconpath = /usr/share/upmpdcli/upmpdcli.png +--- a/src/upmpdcli.conf-dist ++++ b/src/upmpdcli.conf-dist +@@ -24,7 +24,7 @@ + + # You can set a path to an icon here. The icon will be displayed by a control + # point. The icon will only be read once, when upmpdcli starts up. +-# iconpath = /usr/share/upmpdcli/icon.png ++iconpath = /usr/share/upmpdcli/icon.png + + # You can set a path to an html file here, to replace the default + # presentation page. The page will only be read once, when upmpdcli starts diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index 4865698f2..1bff16ca1 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2015 OpenWrt.org +# Copyright (C) 2006-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bluez -PKG_VERSION:=5.30 +PKG_VERSION:=5.47 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/bluetooth/ -PKG_MD5SUM:=24ba1d1e8e7ef5b8f4033a3059d7600e +PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ +PKG_MD5SUM:=783e15f65e70cdb8f721c659e140dd56 PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING @@ -47,7 +47,7 @@ $(call Package/bluez/Default) SECTION:=libs CATEGORY:=Libraries TITLE+= library - DEPENDS:=+libpthread + DEPENDS:=+libpthread +kmod-bluetooth endef define Package/bluez-utils @@ -55,14 +55,22 @@ $(call Package/bluez/Default) SECTION:=utils CATEGORY:=Utilities TITLE+= utilities - DEPENDS:=+bluez-libs +libpthread +librt +dbus +glib2 +libical +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS) + DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS) endef -define Package/bluez-utils/conffiles +define Package/bluez-daemon +$(call Package/bluez/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= daemon + DEPENDS:=+bluez-libs +bluez-utils +dbus +libical $(INTL_DEPENDS) $(ICONV_DEPENDS) +endef + +define Package/bluez-daemon/conffiles /etc/bluetooth/main.conf /etc/bluetooth/network.conf /etc/bluetooth/input.conf -/etc/bluetooth/proximity.conf +/etc/bluetooth/audio.conf /etc/config/bluetooth endef @@ -84,6 +92,7 @@ CONFIGURE_ARGS += \ --disable-systemd \ --disable-test \ --disable-udev \ + --enable-deprecated TARGET_CPPFLAGS += \ -D_GNU_SOURCE @@ -109,10 +118,29 @@ endef define Package/bluez-utils/install $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcidump $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/ +endef + +define Package/bluez-daemon/install + $(INSTALL_DIR) $(1)/usr/bin $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/ $(INSTALL_DIR) $(1)/etc/config $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/ @@ -121,7 +149,7 @@ define Package/bluez-utils/install $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf - $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/proximity/proximity.conf $(1)/etc/bluetooth/proximity.conf + $(INSTALL_DATA) ./files/audio.conf $(1)/etc/bluetooth/audio.conf $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd endef @@ -129,3 +157,4 @@ endef $(eval $(call BuildPackage,bluez-examples)) $(eval $(call BuildPackage,bluez-libs)) $(eval $(call BuildPackage,bluez-utils)) +$(eval $(call BuildPackage,bluez-daemon)) diff --git a/utils/bluez/files/audio.conf b/utils/bluez/files/audio.conf new file mode 100644 index 000000000..0455c6c01 --- /dev/null +++ b/utils/bluez/files/audio.conf @@ -0,0 +1 @@ +Enable=Source,Sink,Media,Socket diff --git a/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch b/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch new file mode 100644 index 000000000..15eb6e1da --- /dev/null +++ b/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch @@ -0,0 +1,21 @@ +From b4f2b77472aeb967d3a7595e8a965785c7a37c87 Mon Sep 17 00:00:00 2001 +From: Phil Elwell <phil@raspberrypi.org> +Date: Tue, 16 Feb 2016 16:40:46 +0000 +Subject: [PATCH 1/4] bcm43xx: Add bcm43xx-3wire variant + +--- + tools/hciattach.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -1090,6 +1090,9 @@ struct uart_t uart[] = { + { "bcm43xx", 0x0000, 0x0000, HCI_UART_H4, 115200, 3000000, + FLOW_CTL, DISABLE_PM, NULL, bcm43xx, NULL }, + ++ { "bcm43xx-3wire", 0x0000, 0x0000, HCI_UART_3WIRE, 115200, 3000000, ++ 0, DISABLE_PM, NULL, bcm43xx, NULL }, ++ + { "ath3k", 0x0000, 0x0000, HCI_UART_ATH3K, 115200, 115200, + FLOW_CTL, DISABLE_PM, NULL, ath3k_ps, ath3k_pm }, + diff --git a/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch b/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch new file mode 100644 index 000000000..a221861d2 --- /dev/null +++ b/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch @@ -0,0 +1,33 @@ +From e145c9621f976063e5c573db1f2053d906f63427 Mon Sep 17 00:00:00 2001 +From: Phil Elwell <phil@raspberrypi.org> +Date: Tue, 16 Feb 2016 16:39:09 +0000 +Subject: [PATCH 2/4] bcm43xx: The UART speed must be reset after the firmware + download + +--- + tools/hciattach_bcm43xx.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/tools/hciattach_bcm43xx.c ++++ b/tools/hciattach_bcm43xx.c +@@ -366,11 +366,8 @@ int bcm43xx_init(int fd, int def_speed, + return -1; + + if (bcm43xx_locate_patch(FIRMWARE_DIR, chip_name, fw_path)) { +- fprintf(stderr, "Patch not found, continue anyway\n"); ++ fprintf(stderr, "Patch not found for %s, continue anyway\n", chip_name); + } else { +- if (bcm43xx_set_speed(fd, ti, speed)) +- return -1; +- + if (bcm43xx_load_firmware(fd, fw_path)) + return -1; + +@@ -380,6 +377,7 @@ int bcm43xx_init(int fd, int def_speed, + return -1; + } + ++ sleep(1); + if (bcm43xx_reset(fd)) + return -1; + } diff --git a/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch b/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch new file mode 100644 index 000000000..74911d3ca --- /dev/null +++ b/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch @@ -0,0 +1,20 @@ +From d41dc2046dd08d8c95197f677e224506f5b39bdd Mon Sep 17 00:00:00 2001 +From: Phil Elwell <phil@raspberrypi.org> +Date: Wed, 20 Jan 2016 16:00:37 +0000 +Subject: [PATCH 3/4] Increase firmware load timeout to 30s + +--- + tools/hciattach.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -1239,7 +1239,7 @@ int main(int argc, char *argv[]) + { + struct uart_t *u = NULL; + int detach, printpid, raw, opt, i, n, ld, err; +- int to = 10; ++ int to = 30; + int init_speed = 0; + int send_break = 0; + pid_t pid; diff --git a/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch b/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch new file mode 100644 index 000000000..80b052d5b --- /dev/null +++ b/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch @@ -0,0 +1,20 @@ +From 76681284b0ea49852041fdb97a35175089a08781 Mon Sep 17 00:00:00 2001 +From: Phil Elwell <phil@raspberrypi.org> +Date: Tue, 23 Feb 2016 17:52:29 +0000 +Subject: [PATCH 4/4] Move the 43xx firmware into /lib/firmware + +--- + tools/hciattach_bcm43xx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/hciattach_bcm43xx.c ++++ b/tools/hciattach_bcm43xx.c +@@ -43,7 +43,7 @@ + #include "hciattach.h" + + #ifndef FIRMWARE_DIR +-#define FIRMWARE_DIR "/etc/firmware" ++#define FIRMWARE_DIR "/lib/firmware/brcm" + #endif + + #define FW_EXT ".hcd" diff --git a/utils/bluez/patches/200-uart-speed.patch b/utils/bluez/patches/200-uart-speed.patch deleted file mode 100644 index ebe0153e2..000000000 --- a/utils/bluez/patches/200-uart-speed.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/tools/hciattach.c -+++ b/tools/hciattach.c -@@ -101,20 +101,37 @@ int uart_speed(int s) - return B230400; - case 460800: - return B460800; -+/* FIX: Not all platform support this high serial speed -+ claudyus84 @gamil.com -+*/ -+#ifdef B500000 - case 500000: - return B500000; -+#endif -+#ifdef B576000 - case 576000: - return B576000; -+#endif -+#ifdef B921600 - case 921600: - return B921600; -+#endif -+#ifdef B1000000 - case 1000000: - return B1000000; -+#endif -+#ifdef B1152000 - case 1152000: - return B1152000; -+#endif -+#ifdef B1500000 - case 1500000: - return B1500000; -+#endif -+#ifdef B2000000 - case 2000000: - return B2000000; -+#endif - #ifdef B2500000 - case 2500000: - return B2500000; diff --git a/utils/bluez/patches/201-readline.patch b/utils/bluez/patches/201-readline.patch index 58396dcb0..579437162 100644 --- a/utils/bluez/patches/201-readline.patch +++ b/utils/bluez/patches/201-readline.patch @@ -1,31 +1,24 @@ ---- a/Makefile.in -+++ b/Makefile.in -@@ -2055,7 +2055,7 @@ unit_tests = $(am__append_32) unit/test- +--- a/Makefile.in 2017-09-14 11:47:06.000000000 +0200 ++++ b/Makefile.in 2017-09-15 02:52:39.315926972 +0200 +@@ -2447,7 +2447,7 @@ @CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c - @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ --@CLIENT_TRUE@ -lreadline -+@CLIENT_TRUE@ -lreadline -lncurses + @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \ +-@CLIENT_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline ++@CLIENT_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses + + @MESH_TRUE@mesh_meshctl_SOURCES = mesh/main.c \ + @MESH_TRUE@ mesh/mesh-net.h \ +@@ -2468,7 +2468,7 @@ + + @MESH_TRUE@mesh_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \ + @MESH_TRUE@ lib/libbluetooth-internal.la \ +-@MESH_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -ljson-c -lreadline ++@MESH_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -ljson-c -lreadline -lncurses @MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ @MONITOR_TRUE@ monitor/display.h monitor/display.c \ -@@ -2226,7 +2226,7 @@ unit_tests = $(am__append_32) unit/test- - @EXPERIMENTAL_TRUE@tools_hcieventmask_LDADD = lib/libbluetooth-internal.la - @EXPERIMENTAL_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c - @EXPERIMENTAL_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \ --@EXPERIMENTAL_TRUE@ -lreadline -+@EXPERIMENTAL_TRUE@ -lreadline -lncurses - - @EXPERIMENTAL_TRUE@tools_btinfo_SOURCES = tools/btinfo.c monitor/bt.h - @EXPERIMENTAL_TRUE@tools_btinfo_LDADD = src/libshared-mainloop.la -@@ -2266,13 +2266,13 @@ unit_tests = $(am__append_32) unit/test- - @READLINE_TRUE@ client/display.h - - @READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ --@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline -+@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses - - @READLINE_TRUE@tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \ +@@ -2724,7 +2724,7 @@ @READLINE_TRUE@ tools/obex-client-tool.c @READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \ @@ -34,7 +27,7 @@ @READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ @READLINE_TRUE@ tools/obex-server-tool.c -@@ -2282,13 +2282,13 @@ unit_tests = $(am__append_32) unit/test- +@@ -2734,17 +2734,17 @@ @READLINE_TRUE@ client/display.h client/display.c @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ @@ -48,5 +41,19 @@ -@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline +@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses - @EXPERIMENTAL_TRUE@tools_gatt_service_SOURCES = tools/gatt-service.c - @EXPERIMENTAL_TRUE@tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la + @READLINE_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c + @READLINE_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \ +-@READLINE_TRUE@ -lreadline ++@READLINE_TRUE@ -lreadline -lncurses + + @DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \ + @DEPRECATED_TRUE@@READLINE_TRUE@ attrib/gattrib.c btio/btio.c \ +@@ -2753,7 +2753,7 @@ + @DEPRECATED_TRUE@@READLINE_TRUE@ client/display.h + + @DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ +-@DEPRECATED_TRUE@@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline ++@DEPRECATED_TRUE@@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses + + @CUPS_TRUE@cupsdir = $(libdir)/cups/backend + @CUPS_TRUE@profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \ diff --git a/utils/rtklib/Makefile b/utils/rtklib/Makefile index 224e851bd..9d7ed6db8 100644 --- a/utils/rtklib/Makefile +++ b/utils/rtklib/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2014 OpenWrt.org +# Copyright (C) 2014-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtklib -PKG_VERSION:=2.4.2_p9 +PKG_VERSION:=2.4.3_b24 PKG_RELEASE:=$(PKG_SOURCE_VERSION) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=git://github.com/tomojitakasu/RTKLIB.git -PKG_SOURCE_VERSION:=5592bb575ceb27f2ce0f0f5a84eda38497006c15 +PKG_SOURCE_VERSION:=1cec90a9ffa424908ad1a4ca3d52f33f9b94d1f7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_LICENSE:=BSD-2-Clause diff --git a/utils/stm32flash/Makefile b/utils/stm32flash/Makefile index c1f6b9b74..f22e725d7 100644 --- a/utils/stm32flash/Makefile +++ b/utils/stm32flash/Makefile @@ -12,7 +12,7 @@ PKG_VERSION:=0.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://releases.stm32flash.googlecode.com/git +PKG_SOURCE_URL:=@SF/stm32flash PKG_MD5SUM:=ec9b5c8bae67f9a489786546d088bd14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org> diff --git a/utils/taskwarrior/Makefile b/utils/taskwarrior/Makefile index 0a2d62c0c..a417a45b0 100644 --- a/utils/taskwarrior/Makefile +++ b/utils/taskwarrior/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=taskwarrior -PKG_VERSION:=2.4.1 +PKG_VERSION:=2.4.4 PKG_RELEASE:=1 PKG_LICENSE:=MIT PKG_SOURCE:=task-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.taskwarrior.org/download/ -PKG_MD5SUM:=f250f3fb3922e4153c6ad1b1270dceb8 +PKG_MD5SUM:=517450c4a23a5842df3e9905b38801b3 PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org> PKG_BUILD_DIR:=$(BUILD_DIR)/task-$(PKG_VERSION) diff --git a/utils/tracertools/Makefile b/utils/tracertools/Makefile index 8d95a9cb1..fd139700f 100644 --- a/utils/tracertools/Makefile +++ b/utils/tracertools/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tracertools -PKG_VERSION:=20150916 +PKG_VERSION:=20160118 PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org> @@ -16,7 +16,7 @@ PKG_LICENSE:=GPL-3.0 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dangowrt/tracertools.git -PKG_SOURCE_VERSION:=7dba3342fedfd04eb7b0d9941971726fde948ec0 +PKG_SOURCE_VERSION:=253e73fd379714239b51d5b0fd719b7c2d65f379 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz |
