include $(TOPDIR)/rules.mk
PKG_NAME:=debootstrap
-PKG_VERSION:=1.0.72
+PKG_VERSION:=1.0.75
PKG_RELEASE:=1
PKG_MAINTAINER=Daniel Golle <daniel@makrotopia.org>
PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
-PKG_MD5SUM:=49f24e3299352aa5453f725ec0d55566
+PKG_MD5SUM:=5b568d66390d76fba87b839984254730
PKG_LICENSE:=Unique
PKG_LICENSE_FILES:=debian/copyright
PKG_NAME:=perl
PKG_VERSION:=5.22.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
http://www.cpan.org/src/5.0 \
# Target perl
define Build/Configure
$(PERL_CMD) files/perlconfig.pl -Dowrt:target_cc='$(TARGET_CC)' \
+ -Dowrt:gccversion=$(CONFIG_GCC_VERSION) \
-Dowrt:target_cross='$(TARGET_CROSS)' \
-Dowrt:cflags='$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)' \
-Dowrt:ldflags='-rdynamic $(TARGET_LDFLAGS)' \
- -Dowrt:libc=$(CONFIG_LIBC) \
+ -Dowrt:libc=$(subst uClibc,uclibc,$(CONFIG_LIBC)) \
-Dowrt:ipv6=$(if $($(CONFIG_IPV6)),define,undef) \
-Dowrt:threads=$(if $(CONFIG_PERL_THREADS),yes,no) \
-Dowrt:staging_dir='$(STAGING_DIR)' \
owrt:ipv6 define/undef Whether to enable IPv6 support.
owrt:target_cross * Target architecture's host triplet.
owrt:target_cc * C compiler to use.
+owrt:gccversion * target_cc's version number.
owrt:cflags * Additional C compiler flags.
owrt:ldflags * Additional linker flags.
owrt:staging_dir * Same as OpenWRT buildroot's
cf_email='naoir@gmx.net'
osvers='3.18.19'
-gccversion='4.8.0'
+gccversion="$owrt:gccversion"
myhostname='OpenWrt'
cf_time='Thu Jan 1 12:00:00 CEST 2015'
include $(TOPDIR)/rules.mk
PKG_NAME:=php
-PKG_VERSION:=5.6.15
+PKG_VERSION:=5.6.16
PKG_RELEASE:=1
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>, Michael Heimpold <mhei@heimpold.de>
PKG_LICENSE:=PHPv3.01
PKG_LICENSE_FILES:=LICENSE
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_MD5SUM:=bdfa8fb1b895a25e1cc05c162f9ae5fc
+PKG_MD5SUM:=3f1d999ed1f9cb5713c9a0161c557f2f
PKG_FIXUP:=libtool autoreconf
PKG_BUILD_PARALLEL:=1
PKG_NAME:=python-pip
PKG_VERSION:=7.1.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=pip-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pip/
CATEGORY:=Languages
TITLE:=Tool for installing Python packages.
URL:=https://pip.pypa.io
- DEPENDS:=+python +python-setuptools
+ DEPENDS:=+python +python-setuptools +ca-certificates
MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
endef
PKG_NAME:=ply
PKG_VERSION:=3.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.dabeaz.com/ply
PKG_MD5SUM:=94726411496c52c87c2b9429b12d5c50
PKG_BUILD_DEPENDS:=python python-setuptools
+HOST_BUILD_DEPENDS:=python/host python-setuptools/host
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=README.md
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
+$(call include_mk, python-host.mk)
define Package/python-ply
SECTION:=lang
endef
define Build/Compile
- $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+ $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
endef
define Build/InstallDev
$(1)$(PYTHON_PKG_DIR)
endef
+define Host/Compile
+ $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOST)")
+endef
+
+define Host/Install
+endef
+
+$(eval $(call HostBuild))
+
$(eval $(call PyPackage,python-ply))
$(eval $(call BuildPackage,python-ply))
include $(TOPDIR)/rules.mk
PKG_NAME:=python-setuptools
-PKG_VERSION:=18.5
+PKG_VERSION:=18.7
PKG_RELEASE:=1
PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/setuptools/
-PKG_MD5SUM:=533c868f01169a3085177dffe5e768bb
+PKG_MD5SUM:=295d7aaef2da7d6ff10b522581da0cf9
+
+HOST_BUILD_DEPENDS:=python/host
PKG_BUILD_DIR:=$(BUILD_DIR)/setuptools-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/setuptools-$(PKG_VERSION)
+include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
+$(call include_mk, python-host.mk)
define Package/python-setuptools
SUBMENU:=Python
CATEGORY:=Languages
TITLE:=Tool for installing Python packages.
URL:=https://bitbucket.org/pypa/setuptools
- DEPENDS:=+python
+ DEPENDS:=+python +ca-certificates
MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
endef
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
endef
+define Host/Compile
+ $(call Build/Compile/HostPyMod,,\
+ install --root="$(STAGING_DIR_HOST)" --prefix="" \
+ --single-version-externally-managed \
+ )
+endef
+
+define Host/Install
+endef
+
+$(eval $(call HostBuild))
+
$(eval $(call PyPackage,python-setuptools))
$(eval $(call BuildPackage,python-setuptools))
PKG_NAME:=boost
PKG_VERSION:=1_59_0
-PKG_RELEASE:=5
+PKG_RELEASE:=6
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/boost
define Package/boost/description
This package provides the Boost v1.59 libraries.
Boost is a set of free, peer-reviewed, portable C++ source libraries.
+This package provides the following libraries:
+ - atomic
+ - chrono
+ - container
+ - context
+ - coroutine
+ - - coroutine2 (requires GCC v5 and up)
+ - date_time
+ - exception
+ - filesystem
+ - graph
+ - - graph-parallel
+ - iostreams
+ - locale
+ - log
+ - math
+ - program_options
+ - python
+ - python3
+ - random
+ - regex
+ - serialization
+ - signals
+ - system
+ - thread
+ - timer
+ - wave
endef
BOOST_LIBS =
depends on PACKAGE_boost
comment "Boost compilation options."
config boost-static-libs
- bool "Static Libraries Only"
+ bool "Compile Static Libraries"
help
- Static compile of all selected boost libraries.
+ Compile static version of all selected boost libraries.
default n
+
+ config boost-shared-libs
+ bool "Compile Shared Libraries"
+ help
+ Compile shared version of all selected boost libraries.
+ default y
config boost-runtime-static
- bool "Use static version of C and C++ runtimes."
+ bool "Use static version of C and C++ runtimes for static libraries."
help
- Determines if shared or static version of C and C++ runtimes should be used.
+ Determines if shared or static version of C and C++ runtimes should be used for static libraries.
default n
select boost-static-libs
+ config boost-runtime-shared
+ bool "Use shared version of C and C++ runtimes for shared libraries."
+ help
+ Determines if shared or static version of C and C++ runtimes should be used for shared libraries.
+ default n
+ select boost-shared-libs
+
+
config boost-multi-threading
bool "Multithread Support"
help
- Compile Boost libraries with multithread support.
+ Compile Boost libraries n multithread mode.
default y
+
+ config boost-single-thread
+ bool "Single thread Support"
+ help
+ Compile Boost libraries in single-thread mode.
+ default n
+
+ config boost-with-debug
+ bool "Boost Debug Support"
+ help
+ Compile Boost libraries with debug support.
+ default n
endmenu
menu "Select Boost libraries"
select PACKAGE_boost-test
config boost-coroutine2
+ depends on @GCC_USE_VERSION_5
bool "Boost couroutine2 support."
select PACKAGE_boost-coroutine
default n
#$(eval $(call DefineBoostLibrary,exception,,))
$(eval $(call DefineBoostLibrary,filesystem,system,))
$(eval $(call DefineBoostLibrary,graph,regex,))
-#$(eval $(call DefineBoostLibrary,graph_parallel,,))
$(eval $(call DefineBoostLibrary,iostreams,,+zlib))
$(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS) +@BUILD_NLS))
$(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
$(eval $(call DefineBoostLibrary,math,,))
#$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
$(eval $(call DefineBoostLibrary,program_options,,))
-$(eval $(call DefineBoostLibrary,python,,+python))
-$(eval $(call DefineBoostLibrary,python3,,+python3))
+$(eval $(call DefineBoostLibrary,python,,+CONFIG_boost_python:python))
+$(eval $(call DefineBoostLibrary,python3,,+CONFIG_boost_python3:python3))
$(eval $(call DefineBoostLibrary,random,system,))
$(eval $(call DefineBoostLibrary,regex,,))
$(eval $(call DefineBoostLibrary,serialization,,))
bjam \
'-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
--ignore-site-config \
- --toolset=gcc-$(ARCH) --build-type=minimal --layout=system abi=$(BOOST_ABI) \
+ --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
--disable-long-double \
- $(if $(CONFIG_boost-static-libs),link=static,link=shared) \
+ --layout=tagged \
+ $(if $(CONFIG_boost-with-debug),--build-type=complete,--build-type=minimal) \
+ $(if $(CONFIG_boost-static-libs),link=static,) \
$(if $(CONFIG_boost-runtime-static),runtime-link=static,runtime-link=shared) \
- $(if $(CONFIG_boost-multi-threading),threading=multi,threading=single) \
+ $(if $(CONFIG_boost-shared-libs),link=shared,) \
+ $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
+ $(if $(CONFIG_boost-single-thread),threading=single,) \
+ $(if $(CONFIG_boost-multi-threading),threading=multi,) \
$(CONFIGURE_ARGS) \
--without-mpi \
$(if $(CONFIG_boost-coroutine2),,--without-coroutine2) \
include $(TOPDIR)/rules.mk
PKG_NAME:=glpk
-PKG_VERSION:=4.55
+PKG_VERSION:=4.57
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=c632a7a631b8aed02e28eafcd99477f
+PKG_MD5SUM:=237531a54f73155842f8defe51aedb0f
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
--- /dev/null
+#
+# Copyright (C) 2006-2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=icu4c
+PKG_VERSION:=55.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-55_1-src.tgz
+PKG_SOURCE_URL:=http://download.icu-project.org/files/icu4c/55.1
+PKG_MD5SUM:=e2d523df79d6cb7855c2fbe284f4db29
+
+PKG_LICENSE:=ICU-1.8.1+
+PKG_LICENSE_FILES:=license.html
+
+PKG_MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_BUILD_DEPENDS:=icu/host
+
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+TAR_OPTIONS+= icu/source --strip-components 2
+TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
+
+define Package/icu
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=International Components for Unicode
+ URL:=http://icu-project.org
+ DEPENDS:=+libstdcpp +libpthread
+endef
+
+define Build/Configure
+ $(call Build/Configure/Default, \
+ --disable-debug \
+ --enable-release \
+ --enable-shared \
+ --enable-static \
+ --enable-draft \
+ --enable-renaming \
+ --disable-tracing \
+ --disable-extras \
+ --enable-dyload \
+ --enable-layout \
+ --enable-layoutex \
+ --disable-tools \
+ --disable-tests \
+ --disable-samples \
+ --with-cross-build="$(HOST_BUILD_DIR)" \
+ )
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) \
+ $(1)/usr/include
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/include/* \
+ $(1)/usr/include/
+
+ $(INSTALL_DIR) \
+ $(1)/usr/lib
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/* \
+ $(1)/usr/lib/
+endef
+
+define Host/install
+endef
+
+define Package/icu/install
+ $(INSTALL_DIR) \
+ $(1)/usr/lib
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/*.so.* \
+ $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,icu))
+$(eval $(call HostBuild))
--- /dev/null
+diff --git a/Makefile.in b/Makefile.in
+index 9db6c52..6aa2273 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -180,7 +180,6 @@ install-icu: $(INSTALLED_BUILT_FILES)
+ $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
+ @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
+ $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
+- $(INSTALL_DATA) $(top_srcdir)/../license.html $(DESTDIR)$(pkgdatadir)/license.html
+ $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
+ $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
+ $(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
include $(TOPDIR)/rules.mk
PKG_NAME:=libevdev
-PKG_VERSION:=1.4.4
+PKG_VERSION:=1.4.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.freedesktop.org/software/libevdev/
-PKG_MD5SUM:=b66443bb664cfaf2ba7b3f8c238ea951
+PKG_MD5SUM:=b123d91e31d279ecb37bea774f17aae1
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
$(1)/usr/lib/pkgconfig/
+ $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/vala-0.30/vapi/
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/share/vala/vapi/* \
+ $(STAGING_DIR_HOST)/share/vala-0.30/vapi
endef
define Package/libgee/install
include $(TOPDIR)/rules.mk
PKG_NAME:=libinput
-PKG_VERSION:=1.0.1
+PKG_VERSION:=1.1.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.freedesktop.org/software/libinput/
-PKG_MD5SUM:=f390e592aa09f77dabceabeb2ddd4419
+PKG_MD5SUM:=4a3fc842ac0b7bf0fa306ea7badc31a0
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
PKG_NAME:=libshout
PKG_VERSION:=2.3.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
--enable-shared \
--enable-static
-ifeq ($(BUILD_VARIANT),full)
- CONFIGURE_ARGS += --with-theora=no --with-speex=no
+ifeq ($(BUILD_VARIANT),nospeex)
+ CONFIGURE_ARGS += --disable-theora --disable-speex
endif
CONFIGURE_VARS += \
TARGET_CFLAGS += $(FPIC) -Wl,-rpath-link="$(STAGING_DIR)/usr/lib"
+PACKAGE_CONFIG_FILE=shout$(if $(findstring $(BUILD_VARIANT),full),-full).pc
+
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/shout $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/shout.pc $(1)/usr/lib/pkgconfig/
- $(SED) 's| -I/usr/include||' $(1)/usr/lib/pkgconfig/shout.pc
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/shout.pc $(1)/usr/lib/pkgconfig/$(PACKAGE_CONFIG_FILE)
+ $(SED) 's| -I/usr/include||' $(1)/usr/lib/pkgconfig/$(PACKAGE_CONFIG_FILE)
endef
define Package/libshout/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.so.* $(1)/usr/lib/
endef
-Package/libshout-full/install=Package/libshout/install
+Package/libshout-full/install=$(Package/libshout/install)
$(eval $(call BuildPackage,libshout))
$(eval $(call BuildPackage,libshout-full))
define Package/pgsql-cli
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=+libpq @USE_UCLIBC:+librt
+ DEPENDS:=+libpq +USE_UCLIBC:librt
TITLE:=Command Line Interface (CLI) to PostgreSQL databases
URL:=http://www.postgresql.org/
SUBMENU:=database
define Package/pgsql-server
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=+libpq @USE_UCLIBC:+librt
+ DEPENDS:=+libpq +USE_UCLIBC:librt
TITLE:=PostgreSQL databases Server
URL:=http://www.postgresql.org/
SUBMENU:=database
--- /dev/null
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mutt
+PKG_VERSION:=1.5.24
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=ftp://ftp.mutt.org/pub/mutt/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=7f25d27f3c7c82285ac07aac35f5f0f2
+
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=GPL
+PKG_MAINTAINER=Phil Eichinger <phil@zankapfel.net>
+
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mutt
+ SECTION:=mail
+ CATEGORY:=Mail
+ DEPENDS:=+libopenssl +libncursesw
+ TITLE:=Console mail client
+ URL:=http://www.mutt.org/
+endef
+
+define Package/mutt/description
+ Mutt is a small but very powerful text-based mail client for Unix
+ operating systems.
+endef
+
+CONFIGURE_ARGS += \
+ --includedir=$(PKG_BUILD_DIR)/. \
+ --oldincludedir=$(PKG_BUILD_DIR)/. \
+ --enable-pop \
+ --enable-imap \
+ --with-ssl \
+ --without-idn
+
+define Package/mutt/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mutt $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,mutt))
--- /dev/null
+From b0e285a8c7faaec8807fdd677da6750f341f0109 Mon Sep 17 00:00:00 2001
+From: Phil Eichinger <phil@zankapfel.net>
+Date: Thu, 19 Nov 2015 13:18:53 +0100
+Subject: [PATCH] no po and docs
+
+[adapted old patch and converted to git patch]
+Signed-off-by: Phil Eichinger <phil@zankapfel.net>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 1909835..cfa7ca0 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -458,7 +458,7 @@ get_cs_cmdline = $(call get_cs_compile,$(1)) $(call get_cs_all_flags,$(1),check_
+ AUTOMAKE_OPTIONS = 1.6 foreign
+ @BUILD_IMAP_TRUE@IMAP_SUBDIR = imap
+ @BUILD_IMAP_TRUE@IMAP_INCLUDES = -I$(top_srcdir)/imap
+-SUBDIRS = m4 po intl doc contrib $(IMAP_SUBDIR)
++SUBDIRS = m4 intl contrib $(IMAP_SUBDIR)
+ bin_SCRIPTS = muttbug flea $(SMIMEAUX_TARGET)
+ @BUILD_HCACHE_TRUE@HCVERSION = hcversion.h
+ BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h conststrings.c $(HCVERSION)
+--
+2.1.4
+
include $(TOPDIR)/rules.mk
PKG_NAME:=adblock
-PKG_VERSION:=0.22.1
+PKG_VERSION:=0.22.2
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dirk@brenken.org>
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
- TITLE:=powerful adblock script to block ad/abuse domains
+ TITLE:=Powerful adblock script to block ad/abuse domains
DEPENDS:=+curl +wget
PKGARCH:=all
endef
* support of the following domain blacklist sites (free for private usage, for commercial use please check their individual licenses):
* [pgl.yoyo.org](http://pgl.yoyo.org/adservers), approx. 2.500 entries
* [malwaredomains.com](http://malwaredomains.com), approx. 16.000 entries
- * [zeustracker.abuse.ch](https://zeustracker.abuse.ch), currently down
+ * [zeustracker.abuse.ch](https://zeustracker.abuse.ch), approx. 420 entries
* [feodotracker.abuse.ch](https://feodotracker.abuse.ch), approx. 10 entries
* [palevotracker.abuse.ch](https://palevotracker.abuse.ch), approx. 10 entries
* [dshield.org](http://dshield.org), approx. 4.500 entries
- * [shallalist.de](http://www.shallalist.de) (tested with the categories "adv" "costtraps" "downloads" "spyware" "tracker" "warez"), approx. 37.000 entries
+ * [shallalist.de](http://www.shallalist.de) (categories "adv" "costtraps" "spyware" "tracker" "warez" enabled by default), approx. 32.000 entries
+ * a short description of all shallalist categories can be found [online](http://www.shallalist.de/categories.html)
* [spam404.com](http://www.spam404.com), approx. 5.000 entries
* [winhelp2002.mvps.org](http://winhelp2002.mvps.org), approx. 15.000 entries
* blocklist parsing by fast & flexible regex rulesets
* additional white- and blacklist support for manual overrides
* separate dynamic adblock network interface
* separate dynamic uhttpd instance as pixel server
-* optional: quality checks and a powerful backup/restore handling to ensure a reliable dnsmasq service
+* adblock quality checks after list update to ensure a reliable dnsmasq service
+* optional: powerful adblock list backup/restore handling
* optional: adblock updates only on pre-defined wan interfaces (useful for (mobile) multiwan setups)
-* optional: domain query logging as a background service to easily identify free and already blocked domains
+* optional: domain query logging as a background service to easily identify free and already blocked domains (see example output below)
+* optional: status & error logging to separate file (req. ntp time sync)
* optional: ntp time sync
-* optional: status & error logging (req. ntp time sync)
## Prerequisites
* [openwrt](https://openwrt.org) (tested only with trunk > r47025), CC should also work
## Usage
* select & install adblock package (*opkg install adblock*)
-* configure /etc/config/adblock to your needs, see additional comments in *adblock.conf.sample*
+* configure */etc/config/adblock* to your needs, see additional comments in *adblock.conf.sample*
* at least configure the ip address of the local adblock interface/uhttpd instance, needs to be a different subnet from the normal LAN
+* optional: add additional domain white- or blacklist entries, one domain per line (wildcards & regex are not allowed!), both list are located in */etc/adblock*
* by default openwrts main uhttpd instance is bind to all ports of your router. For a working adblock setup you have to bind uhttpd to the standard LAN port only, please change listen_http accordingly
* start /usr/bin/adblock-update.sh and check console output or *logread -e "adblock"* for errors
stdout excerpt for successful adblock run:
- root@pi2wrt:~# /usr/bin/adblock-update.sh
- adblock[17771] info : domain adblock processing started (0.21.0)
- adblock[17771] info : get wan/update interface (wlan1), after 0 loops
- adblock[17771] info : get ntp time sync (0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org), after 0 loops
- adblock[17771] info : shallalist archive download finished
- adblock[17771] info : shallalist archive extraction finished
- adblock[17771] info : shallalist (pre-)processing finished (adv costtraps downloads spyware tracker warez)
- adblock[17771] info : source download finished (http://pgl.yoyo.org/adservers/serverlist.php?hostformat=one-line&showintro=0&mimetype=plaintext, 2426 entries)
- adblock[17771] info : source download finished (http://mirror1.malwaredomains.com/files/justdomains, 15275 entries)
- adblock[17771] info : source download finished (https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist, 3 entries)
- adblock[17771] info : source download finished (https://feodotracker.abuse.ch/blocklist/?download=domainblocklist, 0 entries)
- adblock[17771] info : source download finished (https://palevotracker.abuse.ch/blocklists.php?download=domainblocklist, 11 entries)
- adblock[17771] info : source download finished (http://www.dshield.org/feeds/suspiciousdomains_Low.txt, 4542 entries)
- adblock[17771] info : source download finished (http://spam404bl.com/spam404scamlist.txt, 5193 entries)
- adblock[17771] info : source download finished (http://winhelp2002.mvps.org/hosts.txt, 13852 entries)
- adblock[17771] info : source download finished (file:////tmp/tmp.emlDeH/shallalist.txt, 36961 entries)
- adblock[17771] info : source download finished (file:///etc/adblock/adblock.blacklist, 1 entries)
- adblock[17771] info : new adblock list with 73090 domains loaded, backup generated
- adblock[17771] info : domain adblock processing finished (0.21.0)
+ adblock[11541] info : domain adblock processing started (0.22.2, r47665, 29.11.2015 14:58:11)
+ adblock[11541] info : wan update check will be disabled
+ adblock[11541] info : get ntp time sync (192.168.254.254), after 0 loops
+ adblock[11541] info : shallalist (pre-)processing started ...
+ adblock[11541] info : shallalist (pre-)processing finished (adv costtraps spyware tracker warez)
+ adblock[11541] info : source download finished (http://pgl.yoyo.org/adservers/serverlist.php?hostformat=one-line&showintro=0&mimetype=plaintext, 2423 entries)
+ adblock[11541] info : source download finished (http://mirror1.malwaredomains.com/files/justdomains, 16016 entries)
+ adblock[11541] info : source download finished (https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist, 419 entries)
+ adblock[11541] info : source download finished (https://feodotracker.abuse.ch/blocklist/?download=domainblocklist, 0 entries)
+ adblock[11541] info : source download finished (https://palevotracker.abuse.ch/blocklists.php?download=domainblocklist, 12 entries)
+ adblock[11541] info : source download finished (http://www.dshield.org/feeds/suspiciousdomains_Low.txt, 4542 entries)
+ adblock[11541] info : source download finished (http://spam404bl.com/spam404scamlist.txt, 5193 entries)
+ adblock[11541] info : source download finished (http://winhelp2002.mvps.org/hosts.txt, 13635 entries)
+ adblock[11541] info : source download finished (file:////tmp/tmp.CgbMmO/shallalist.txt, 32446 entries)
+ adblock[11541] info : empty source download finished (file:///etc/adblock/adblock.blacklist)
+ adblock[11541] info : domain merging finished
+ adblock[11541] info : new adblock list with 69646 domains loaded, backup generated
+ adblock[11541] info : domain adblock processing finished (0.22.2, r47665, 29.11.2015 14:59:23)
generated domain blocklist for dnsmasq:
# check main uhttpd configuration
#
- check_uhttpd="$(uci get uhttpd.main.listen_http 2>/dev/null | grep -o "0.0.0.0")"
+ check_uhttpd="$(uci get uhttpd.main.listen_http 2>/dev/null | grep -Fo "0.0.0.0")"
if [ -n "${check_uhttpd}" ]
then
rc=530
if [ -z "${check}" ]
then
curl_parm="-q --insecure"
- wget_parm="--no-config --no-check-certificate"
+ wget_parm="--no-config --no-hsts --no-check-certificate"
else
curl_parm="-q"
- wget_parm="--no-config"
+ wget_parm="--no-config --no-hsts"
fi
# check total and swap memory
#
- mem_total="$(cat /proc/meminfo | grep "MemTotal" | grep -o "[0-9]*")"
- mem_free="$(cat /proc/meminfo | grep "MemFree" | grep -o "[0-9]*")"
- swap_total="$(cat /proc/meminfo | grep "SwapTotal" | grep -o "[0-9]*")"
+ mem_total="$(cat /proc/meminfo | grep -F "MemTotal" | grep -o "[0-9]*")"
+ mem_free="$(cat /proc/meminfo | grep -F "MemFree" | grep -o "[0-9]*")"
+ swap_total="$(cat /proc/meminfo | grep -F "SwapTotal" | grep -o "[0-9]*")"
if [ $((mem_total)) -le 64000 ] && [ $((swap_total)) -eq 0 ]
then
- f_log "please consider to add an external swap device to supersize your /tmp directory (total: ${mem_total}, free: ${mem_free}, swap: ${mem_swap})"
+ f_log "please consider adding an external swap device to supersize your /tmp directory (total: ${mem_total}, free: ${mem_free}, swap: ${mem_swap})"
fi
# check backup configuration
then
# check find capabilities
#
- check="$(find --help 2>&1 | grep "mtime")"
+ check="$(find --help 2>&1 | grep -F "mtime")"
if [ -z "${check}" ]
then
query_ok="false"
if [ -s "${adb_querypid}" ]
then
kill -9 "$(cat "${adb_querypid}")" >/dev/null 2>&1
- f_log "remove old dns query log background process (pid: $(cat "${adb_querypid}"))"
+ f_log "remove old dns query log background process (pid: $(cat "${adb_querypid}" 2>/dev/null))"
> "${adb_querypid}"
fi
fi
then
class="error"
log_rc=", rc: ${log_rc}"
+ log_msg="${log_msg}${log_rc}"
fi
- /usr/bin/logger -s -t "adblock[${pid}] ${class}" "${log_msg}${log_rc}"
+ /usr/bin/logger -s -t "adblock[${pid}] ${class}" "${log_msg}"
if [ "${log_ok}" = "true" ] && [ "${ntp_ok}" = "true" ]
then
- printf "%s\n" "$(/bin/date "+%d.%m.%Y %H:%M:%S") adblock[${pid}] ${class}: ${log_msg}${log_rc}" >> "${adb_logfile}"
+ printf "%s\n" "$(/bin/date "+%d.%m.%Y %H:%M:%S") adblock[${pid}] ${class}: ${log_msg}" >> "${adb_logfile}"
fi
fi
}
then
rm -rf "${adb_tmpdir}" >/dev/null 2>&1
fi
- f_log "domain adblock processing finished (${adb_version}, ${openwrt_version})"
+ f_log "domain adblock processing finished (${adb_version}, ${openwrt_version}, $(/bin/date "+%d.%m.%Y %H:%M:%S"))"
exit ${rc}
}
then
kill -9 "$(cat "${adb_querypid}")" >/dev/null 2>&1
find "${adb_backupdir}" -maxdepth 1 -type f -mtime +"${adb_queryhistory}" -name "${query_name}.*" -exec rm -f {} \; 2>/dev/null
- f_log "remove old dns query log background process (pid: $(cat "${adb_querypid}")) and do logfile housekeeping"
+ f_log "remove old domain query log background process (pid: $(cat "${adb_querypid}")) and do logfile housekeeping"
> "${adb_querypid}"
fi
if [ ! -s "${adb_querypid}" ]
then
- ( logread -f 2>/dev/null & printf ${!} > "${adb_querypid}" ) | egrep -o "(query\[A\].*)|([a-z0-9\.\-]* is ${query_ip}$)" >> "${adb_queryfile}.${query_date}" &
- f_log "new domain query log background process started (pid: $(cat "${adb_querypid}"))"
+ (logread -f 2>/dev/null & printf ${!} > "${adb_querypid}") | grep -Eo "(query\[A\].*)|([a-z0-9\.\-]* is ${query_ip}$)" >> "${adb_queryfile}.${query_date}" &
+ f_log "new domain query log background process started"
fi
fi
f_deltemp
rc=${?}
if [ -z "${dns_status}" ]
then
- dns_status="$(nslookup "${adb_domain}" 2>/dev/null | grep "${adb_ip}")"
+ dns_status="$(nslookup "${adb_domain}" 2>/dev/null | grep -F "${adb_ip}")"
rc=${?}
if [ -z "${dns_status}" ]
then
# set script version
#
-adb_version="0.22.1"
+adb_version="0.22.2"
# get current pid, script directory and openwrt version
#
# start logging
#
-f_log "domain adblock processing started (${adb_version}, ${openwrt_version})"
+f_log "domain adblock processing started (${adb_version}, ${openwrt_version}, $(/bin/date "+%d.%m.%Y %H:%M:%S"))"
# load environment
#
then
# download shallalist archive
#
+ f_log "shallalist (pre-)processing started ..."
shalla_archive="${adb_tmpdir}/shallalist.tar.gz"
shalla_file="${adb_tmpdir}/shallalist.txt"
curl ${curl_parm} --max-time "${adb_maxtime}" "${adb_arc_shalla}" --output "${shalla_archive}" 2>/dev/null
rc=${?}
- if [ $((rc)) -eq 0 ]
+ if [ $((rc)) -ne 0 ]
then
- f_log "shallalist archive download finished"
- else
f_log "shallalist archive download failed (${adb_arc_shalla})" "${rc}"
f_restore
fi
> "${shalla_file}"
for category in ${adb_cat_shalla}
do
- tar -C "${adb_tmpdir}" -xzf "${shalla_archive}" BL/${category}/domains 2>/dev/null
+ tar -xOzf "${shalla_archive}" BL/${category}/domains 2>/dev/null >> "${shalla_file}"
rc=${?}
- if [ $((rc)) -eq 0 ]
+ if [ $((rc)) -ne 0 ]
then
- if [ -r "${adb_tmpdir}/BL/${category}/domains" ]
- then
- cat "${adb_tmpdir}/BL/${category}/domains" 2>/dev/null >> "${shalla_file}"
- fi
- else
f_log "shallalist archive extraction failed (${category})" "${rc}"
f_restore
fi
# remove whitelist domains, sort domains and make them unique
# and finally rewrite ad/abuse domain information to dnsmasq file
#
-> "${adb_dnsfile}"
-grep -vxf "${adb_whitelist}" < "${adb_tmpfile}" 2>/dev/null | sort -u 2>/dev/null | eval "${adb_dnsformat}" 2>/dev/null >> "${adb_dnsfile}"
-rc=${?}
+if [ -s "${adb_whitelist}" ]
+then
+ grep -Fvxf "${adb_whitelist}" "${adb_tmpfile}" 2>/dev/null | sort -u 2>/dev/null | eval "${adb_dnsformat}" 2>/dev/null > "${adb_dnsfile}"
+ rc=${?}
+else
+ sort -u "${adb_tmpfile}" 2>/dev/null | eval "${adb_dnsformat}" 2>/dev/null > "${adb_dnsfile}"
+ rc=${?}
+fi
+
if [ $((rc)) -eq 0 ]
then
rm -f "${adb_tmpfile}" >/dev/null 2>&1
option adb_arc_shalla "http://www.shallalist.de/Downloads/shallalist.tar.gz"
list adb_catlist "adv"
list adb_catlist "costtraps"
- list adb_catlist "downloads"
list adb_catlist "spyware"
list adb_catlist "tracker"
list adb_catlist "warez"
-downloads.openwrt.org
-ftp.de.debian.org
-download.eclipse.org
-dl.sourceforge.net
+
--- /dev/null
+#
+# Copyright (C) 2007-2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=daemonlogger
+PKG_VERSION:=1.2.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/daemonlogger
+PKG_MD5SUM:=acb64aa6cd5777e297569f100b5c39ee
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/daemonlogger
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=+libpcap +libdnet
+ TITLE:=Software Network Tap
+ URL:=http://www.snort.org/snort-downloads/additional-downloads
+endef
+
+CONFIGURE_VARS += \
+ BUILD_CC="$(TARGET_CC)" \
+ HOSTCC="$(HOSTCC)"
+
+MAKE_FLAGS := CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"
+
+define Package/daemonlogger/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/daemonlogger $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,daemonlogger))
include $(TOPDIR)/rules.mk
PKG_NAME:=gnunet
-PKG_SOURCE_VERSION:=36366
+PKG_SOURCE_VERSION:=36713
PKG_VERSION:=0.10.1-svn$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=1
+PKG_RELEASE:=3
# ToDo:
# - break-out {peer,name,data}store for each backend
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-mysql),--with-mysql="$(STAGING_DIR)/usr",--without-mysql) \
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgresql="$(STAGING_DIR)/usr/bin/pg_config",--without-postgresql) \
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-sqlite),--with-sqlite="$(STAGING_DIR)/usr",--without-sqlite) \
+ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-experiments),--enable-experimental,--disable-experimental) \
--with-extractor=$(STAGING_DIR)/usr \
--with-gnutls=$(STAGING_DIR)/usr \
--with-libgnurl=$(STAGING_DIR)/usr \
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
$(INSTALL_DIR) $(1)/usr/share/gnunet/config.d $(1)/usr/share/gnunet/hellos
- ( for bin in arm ats core config ecc identity nat-server nse \
+ ( for bin in arm ats cadet core config ecc identity nat nat-server nse \
peerinfo peerstore revocation scalarproduct statistics transport uri; do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
done )
service-core service-dht service-identity service-nse \
service-peerinfo service-peerstore service-regex \
service-revocation service-scalarproduct-alice \
- service-scalarproduct-bob service-set service-statistics \
+ service-scalarproduct-bob service-scalarproduct-ecc-alice \
+ service-scalarproduct-ecc-bob service-set service-statistics \
service-transport; do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
done )
BIN_conversation:=conversation conversation-test
LIB_conversation:=conversation microphone speaker
PLUGIN_conversation:=gnsrecord_conversation
-LIBEXEC_conversation:=helper-audio-playback helper-audio-record
+LIBEXEC_conversation:=helper-audio-playback helper-audio-record service-conversation
CONF_conversation:=conversation
DEPENDS_transport-http_client:=+libgnurl
PLUGIN_transport-wlan:=transport_wlan
LIBEXEC_transport-wlan:=helper-transport-wlan
-DEPENDS_experiments:=+libglpk
-PLUGIN_experiments:=ats_mlp ats_ril
+DEPENDS_experiments:=+libglpk +gnunet-sqlite
+BIN_experiments:=multicast rps
+LIB_experiments:=consensus dv env multicast psyc psycstore psycutil rps secretsharing social
+PLUGIN_experiments:=ats_mlp ats_ril namecache_flat namestore_flat psycstore_sqlite transport_dv
+LIBEXEC_experiments:=service-consensus service-dv service-evil-consensus service-multicast service-psyc service-psycstore service-rps service-secretsharing service-social
+CONF_experiments:=consensus dv multicast psyc psycstore rps secretsharing social
DEPENDS_fs:=+gnunet-datastore +libextractor
BIN_fs:=auto-share directory download download-manager.scm fs publish unindex search
LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
DEPENDS_utils:=+certtool +openssl-util
-BIN_utils:=gns-proxy-setup-ca transport-certificate-creation
+BIN_utils:=gns-proxy-setup-ca transport-certificate-creation scrypt
DEPENDS_vpn:=+kmod-tun +iptables
BIN_vpn:=vpn
# $1 "Type"
# $2 "Name"
local __TYPE="$1"
- local __NAME="$2"
+ local __NAME="${2/_/-}"
[ "${__TYPE}" = "gnunet-config" ] && _gnunet_section="${__NAME}"
[ "${__TYPE}" = "gnunet-exit-service" ] && _gnunet_section="${__NAME}.gnunet."
}
include $(TOPDIR)/rules.mk
PKG_NAME:=gnurl
-PKG_VERSION:=7.43.0
+PKG_VERSION:=7.45.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://gnunet.org/sites/default/files
-PKG_MD5SUM:=67c6667d8843cc514b230f2ce8d80f0e
+PKG_MD5SUM:=32b18f37d3a594dba9192e7e4254ce70
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=haproxy
-PKG_VERSION:=1.5.14
-PKG_RELEASE:=16
+PKG_VERSION:=1.5.15
+PKG_RELEASE:=10
PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.5/src/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_MD5SUM:=ad9d7262b96ba85a0f8c6acc6cb9edde
+PKG_MD5SUM:=eeaa35744f84c92184cd735ee56dd0a3
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=GPL-2.0
--- /dev/null
+From 4818bc3035bccc00d8c3fc9b14ec37366cac3059 Mon Sep 17 00:00:00 2001
+From: Jerome Duval <jerome.duval@gmail.com>
+Date: Mon, 2 Nov 2015 17:47:43 +0000
+Subject: [PATCH 01/10] BUG/BUILD: replace haproxy-systemd-wrapper with
+ $(EXTRA) in install-bin.
+
+[wt: this should be backported to 1.6 and 1.5 as well since some platforms
+ don't build the systemd-wrapper]
+(cherry picked from commit 796d2fc136359c31c5c35f00c0751890ab42a016)
+(cherry picked from commit 9d0b47d96825b0584ea81c826a96ed8babcc016b)
+---
+ Makefile | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 9556069..e3199b2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -719,10 +719,9 @@ install-doc:
+ install -m 644 doc/$$x.txt "$(DESTDIR)$(DOCDIR)" ; \
+ done
+
+-install-bin: haproxy haproxy-systemd-wrapper
++install-bin: haproxy $(EXTRA)
+ install -d "$(DESTDIR)$(SBINDIR)"
+- install haproxy "$(DESTDIR)$(SBINDIR)"
+- install haproxy-systemd-wrapper "$(DESTDIR)$(SBINDIR)"
++ install haproxy $(EXTRA) "$(DESTDIR)$(SBINDIR)"
+
+ install: install-bin install-man install-doc
+
+--
+2.4.10
+
+++ /dev/null
-From df0a5960987b3cb663dcfa93d29c21acc13cd3e3 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Thu, 9 Jul 2015 11:20:00 +0200
-Subject: [PATCH 1/4] BUG/MINOR: log: missing some ARGC_* entries in
- fmt_directives()
-
-ARGC_CAP was not added to fmt_directives() which is used to format
-error messages when failing to parse log format expressions. The
-whole switch/case has been reorganized to match the declaration
-order making it easier to spot missing values. The default is not
-the "log" directive anymore but "undefined" asking to report the
-bug.
-
-Backport to 1.5 is not strictly needed but is desirable at least
-for code sanity.
-(cherry picked from commit 53e1a6d31743b1bef6063ff30b812521391ae3c3)
----
- src/log.c | 24 ++++++++++++++----------
- 1 file changed, 14 insertions(+), 10 deletions(-)
-
-diff --git a/src/log.c b/src/log.c
-index 1a5ad25..f0a3072 100644
---- a/src/log.c
-+++ b/src/log.c
-@@ -167,22 +167,26 @@ struct logformat_var_args var_args_list[] = {
- static inline const char *fmt_directive(const struct proxy *curproxy)
- {
- switch (curproxy->conf.args.ctx) {
-- case ARGC_UIF:
-- return "unique-id-format";
-+ case ARGC_ACL:
-+ return "acl";
-+ case ARGC_STK:
-+ return "stick";
-+ case ARGC_TRK:
-+ return "track-sc";
-+ case ARGC_LOG:
-+ return "log-format";
- case ARGC_HRQ:
- return "http-request";
- case ARGC_HRS:
- return "http-response";
-- case ARGC_STK:
-- return "stick";
-- case ARGC_TRK:
-- return "track-sc"; break;
-+ case ARGC_UIF:
-+ return "unique-id-format";
- case ARGC_RDR:
-- return "redirect"; break;
-- case ARGC_ACL:
-- return "acl"; break;
-+ return "redirect";
-+ case ARGC_CAP:
-+ return "capture";
- default:
-- return "log-format";
-+ return "undefined(please report this bug)"; /* must never happen */
- }
- }
-
---
-2.3.6
-
--- /dev/null
+From 1af6a324c3206902f69bd2c9838e94ffb4cee3ae Mon Sep 17 00:00:00 2001
+From: Lukas Tribus <luky-37@hotmail.com>
+Date: Thu, 5 Nov 2015 13:59:30 +0100
+Subject: [PATCH 02/10] BUG/MINOR: acl: don't use record layer in req_ssl_ver
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The initial record layer version in a SSL handshake may be set to TLSv1.0
+or similar for compatibility reasons, this is allowed as per RFC5246
+Appendix E.1 [1]. Some implementations are Openssl [2] and NSS [3].
+
+A related issue has been fixed some time ago in commit 57d229747
+("BUG/MINOR: acl: req_ssl_sni fails with SSLv3 record version").
+
+Fix this by using the real client hello version instead of the record
+layer version.
+
+This was reported by Julien Vehent and analyzed by Cyril Bonté.
+The initial patch is from Julien Vehent as well.
+
+This should be backported to stable series, the req_ssl_ver keyword was
+first introduced in 1.3.16.
+
+[1] https://tools.ietf.org/html/rfc5246#appendix-E.1
+[2] https://github.com/openssl/openssl/commit/4a1cf50187659e60c5867ecbbc36e37b2605d2c3
+[3] https://bugzilla.mozilla.org/show_bug.cgi?id=774547
+(cherry picked from commit c93242cab986087f06a4655d14fec18eecb7f5f4)
+(cherry picked from commit b048a6eb3d9cb518e4a378e20ba2a801afec553c)
+---
+ src/payload.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/src/payload.c b/src/payload.c
+index f62163c..b8f1ca3 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -148,21 +148,24 @@ smp_fetch_req_ssl_ver(struct proxy *px, struct session *s, void *l7, unsigned in
+ data = (const unsigned char *)s->req->buf->p;
+ if ((*data >= 0x14 && *data <= 0x17) || (*data == 0xFF)) {
+ /* SSLv3 header format */
+- if (bleft < 5)
++ if (bleft < 11)
+ goto too_short;
+
+- version = (data[1] << 16) + data[2]; /* version: major, minor */
++ version = (data[1] << 16) + data[2]; /* record layer version: major, minor */
+ msg_len = (data[3] << 8) + data[4]; /* record length */
+
+ /* format introduced with SSLv3 */
+ if (version < 0x00030000)
+ goto not_ssl;
+
+- /* message length between 1 and 2^14 + 2048 */
+- if (msg_len < 1 || msg_len > ((1<<14) + 2048))
++ /* message length between 6 and 2^14 + 2048 */
++ if (msg_len < 6 || msg_len > ((1<<14) + 2048))
+ goto not_ssl;
+
+ bleft -= 5; data += 5;
++
++ /* return the client hello client version, not the record layer version */
++ version = (data[4] << 16) + data[5]; /* client hello version: major, minor */
+ } else {
+ /* SSLv2 header format, only supported for hello (msg type 1) */
+ int rlen, plen, cilen, silen, chlen;
+--
+2.4.10
+
+++ /dev/null
-From ea31f225c2c93a25b8bef7a9241a89cecfd9d350 Mon Sep 17 00:00:00 2001
-From: Baptiste Assmann <bedis9@gmail.com>
-Date: Fri, 17 Jul 2015 21:59:42 +0200
-Subject: [PATCH 2/4] DOC: usesrc root privileges requirements
-
-The "usesrc" parameter of the source statement requires root privileges.
-(cherry picked from commit 91bd337d90cb347feda34b01402f3471c8a4833c)
----
- doc/configuration.txt | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/doc/configuration.txt b/doc/configuration.txt
-index 6714afb..64697a4 100644
---- a/doc/configuration.txt
-+++ b/doc/configuration.txt
-@@ -6117,6 +6117,8 @@ source <addr>[:<port>] [interface <name>]
- is possible at the server level using the "source" server option. Refer to
- section 5 for more information.
-
-+ In order to work, "usesrc" requires root privileges.
-+
- Examples :
- backend private
- # Connect to the servers using our 192.168.1.200 source address
---
-2.3.6
-
--- /dev/null
+From ef8a113d59e89b2214adf7ab9f9b0b75905a7050 Mon Sep 17 00:00:00 2001
+From: lsenta <laurent.senta@gmail.com>
+Date: Fri, 13 Nov 2015 10:44:22 +0100
+Subject: [PATCH 03/10] BUG: http: do not abort keep-alive connections on
+ server timeout
+
+When a server timeout is detected on the second or nth request of a keep-alive
+connection, HAProxy closes the connection without writing a response.
+Some clients would fail with a remote disconnected exception and some
+others would retry potentially unsafe requests.
+
+This patch removes the special case and makes sure a 504 timeout is
+written back whenever a server timeout is handled.
+
+Signed-off-by: lsenta <laurent.senta@gmail.com>
+(cherry picked from commit 1e1f41d0f3473d86da84dc3785b7d7cbef6e9044)
+(cherry picked from commit 1f279c0b116f7fbc208793fffbd256c3c736fc52)
+---
+ src/proto_http.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index 17742c6..e7e1785 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -5782,8 +5782,6 @@ int http_wait_for_response(struct session *s, struct channel *rep, int an_bit)
+ else if (rep->flags & CF_READ_TIMEOUT) {
+ if (msg->err_pos >= 0)
+ http_capture_bad_message(&s->be->invalid_rep, s, msg, msg->msg_state, s->fe);
+- else if (txn->flags & TX_NOT_FIRST)
+- goto abort_keep_alive;
+
+ s->be->be_counters.failed_resp++;
+ if (objt_server(s->target)) {
+--
+2.4.10
+
+++ /dev/null
-From eee374c28ea8ea22834ff14515b5584bc3e0c7b5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= <jca@wxcvbn.org>
-Date: Sat, 25 Jul 2015 16:50:52 -0600
-Subject: [PATCH 3/4] BUILD: ssl: Allow building against libssl without SSLv3.
-
-If SSLv3 is explicitely requested but not available, warn the user and
-bail out.
-(cherry picked from commit 17c3f6284cf605e47f6525c077bc644c45272849)
----
- src/ssl_sock.c | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/src/ssl_sock.c b/src/ssl_sock.c
-index 7d77d36..2ae45ec 100644
---- a/src/ssl_sock.c
-+++ b/src/ssl_sock.c
-@@ -1405,8 +1405,14 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, SSL_CTX *ctx, struct proxy
- ssloptions |= SSL_OP_NO_TLSv1_2;
- if (bind_conf->ssl_options & BC_SSL_O_NO_TLS_TICKETS)
- ssloptions |= SSL_OP_NO_TICKET;
-- if (bind_conf->ssl_options & BC_SSL_O_USE_SSLV3)
-+ if (bind_conf->ssl_options & BC_SSL_O_USE_SSLV3) {
-+#ifndef OPENSSL_NO_SSL3
- SSL_CTX_set_ssl_version(ctx, SSLv3_server_method());
-+#else
-+ Alert("SSLv3 support requested but unavailable.\n");
-+ cfgerr++;
-+#endif
-+ }
- if (bind_conf->ssl_options & BC_SSL_O_USE_TLSV10)
- SSL_CTX_set_ssl_version(ctx, TLSv1_server_method());
- #if SSL_OP_NO_TLSv1_1
-@@ -1750,8 +1756,14 @@ int ssl_sock_prepare_srv_ctx(struct server *srv, struct proxy *curproxy)
- options |= SSL_OP_NO_TLSv1_2;
- if (srv->ssl_ctx.options & SRV_SSL_O_NO_TLS_TICKETS)
- options |= SSL_OP_NO_TICKET;
-- if (srv->ssl_ctx.options & SRV_SSL_O_USE_SSLV3)
-+ if (srv->ssl_ctx.options & SRV_SSL_O_USE_SSLV3) {
-+#ifndef OPENSSL_NO_SSL3
- SSL_CTX_set_ssl_version(srv->ssl_ctx.ctx, SSLv3_client_method());
-+#else
-+ Alert("SSLv3 support requested but unavailable.");
-+ cfgerr++;
-+#endif
-+ }
- if (srv->ssl_ctx.options & SRV_SSL_O_USE_TLSV10)
- SSL_CTX_set_ssl_version(srv->ssl_ctx.ctx, TLSv1_client_method());
- #if SSL_OP_NO_TLSv1_1
---
-2.3.6
-
--- /dev/null
+From c0d56134320e507c82952f3d2a03f76b701945cb Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 18 Nov 2015 11:59:55 +0100
+Subject: [PATCH 04/10] BUG/MEDIUM: http: switch the request channel to
+ no-delay once done.
+
+There's an issue when sending POST data that came in a second packet,
+the CF_NEVER_WAIT flag is not always set on the request channel, while
+the server is waiting for the request. We must always set this flag in
+this case since we're not going to shut down after sending, contrary
+to the response side.
+
+Note that option http-no-delay works around this issue.
+
+Reproducer :
+
+listen px
+ mode http
+ timeout client 10s
+ timeout server 5s
+ timeout connect 3s
+ option http-server-close
+ #option http-no-delay
+ bind :8001
+ server s1 127.0.0.1:8003
+
+$ (printf "POST / HTTP/1.1\r\nTransfer-encoding: chunked\r\n\r\n"; sleep 0.01; printf "10\r\nAZERTYUIOPQSDFGH\r\n0\r\n\r\n") | nc6 0 8001
+
+Before this fix :
+
+12:03:31.946763 epoll_wait(3, {{EPOLLIN, {u32=5, u64=5}}}, 200, 1000) = 1
+12:03:32.634175 accept4(5, {sa_family=AF_INET, sin_port=htons(53849), sin_addr=inet_addr("127.0.0.1")}, [16], SOCK_NONBLOCK) = 6
+12:03:32.634318 setsockopt(6, SOL_TCP, TCP_NODELAY, [1], 4) = 0
+12:03:32.634434 accept4(5, 0x7ffccfbb2cf0, [128], SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable)
+12:03:32.634574 recvfrom(6, "POST / HTTP/1.1\r\nTransfer-encodi"..., 8192, 0, NULL, NULL) = 47
+12:03:32.634809 setsockopt(6, SOL_TCP, TCP_QUICKACK, [1], 4) = 0
+12:03:32.634952 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 7
+12:03:32.635031 fcntl(7, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
+12:03:32.635089 setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0
+12:03:32.635153 connect(7, {sa_family=AF_INET, sin_port=htons(8003), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)
+12:03:32.635315 epoll_wait(3, {}, 200, 0) = 0
+12:03:32.635394 sendto(7, "POST / HTTP/1.1\r\nTransfer-encodi"..., 66, MSG_DONTWAIT|MSG_NOSIGNAL, NULL, 0) = 66
+12:03:32.635527 recvfrom(6, 0x7f0224e66024, 8192, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
+12:03:32.635651 epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLIN|0x2000, {u32=6, u64=6}}) = 0
+12:03:32.635782 epoll_wait(3, {}, 200, 0) = 0
+12:03:32.635842 recvfrom(7, 0x7f0224e66024, 8192, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
+12:03:32.635924 epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN|0x2000, {u32=7, u64=7}}) = 0
+12:03:32.636027 epoll_wait(3, {{EPOLLIN, {u32=6, u64=6}}}, 200, 1000) = 1
+12:03:32.644892 recvfrom(6, "10\r\nAZERTYUIOPQSDFGH\r\n0\r\n\r\n", 8192, 0, NULL, NULL) = 27
+12:03:32.645016 epoll_wait(3, {}, 200, 0) = 0
+12:03:32.645105 sendto(7, "10\r\nAZERTYUIOPQSDFGH\r\n0\r\n\r\n", 27, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_MORE, NULL, 0) = 27
+
+After the fix :
+
+11:59:12.538617 connect(7, {sa_family=AF_INET, sin_port=htons(8003), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)
+11:59:12.538787 epoll_wait(3, {}, 200, 0) = 0
+11:59:12.538867 sendto(7, "POST / HTTP/1.1\r\nTransfer-encodi"..., 66, MSG_DONTWAIT|MSG_NOSIGNAL, NULL, 0) = 66
+11:59:12.539031 recvfrom(6, 0x7f832ce45024, 8192, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
+11:59:12.539161 epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLIN|0x2000, {u32=6, u64=6}}) = 0
+11:59:12.539259 epoll_wait(3, {}, 200, 0) = 0
+11:59:12.539337 recvfrom(7, 0x7f832ce45024, 8192, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
+11:59:12.539421 epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN|0x2000, {u32=7, u64=7}}) = 0
+11:59:12.539499 epoll_wait(3, {{EPOLLIN, {u32=6, u64=6}}}, 200, 1000) = 1
+11:59:12.548519 recvfrom(6, "10\r\nAZERTYUIOPQSDFGH\r\n0\r\n\r\n", 8192, 0, NULL, NULL) = 27
+11:59:12.548844 epoll_wait(3, {}, 200, 0) = 0
+11:59:12.549012 sendto(7, "10\r\nAZERTYUIOPQSDFGH\r\n0\r\n\r\n", 27, MSG_DONTWAIT|MSG_NOSIGNAL, NULL, 0) = 27
+11:59:12.549454 epoll_wait(3, {}, 200, 1000) = 0
+
+This fix must be backported to 1.6, 1.5 and 1.4.
+(cherry picked from commit 7f876a1eeb14ffae708327aad8a0b4b029da5e26)
+(cherry picked from commit 712a5339f384db62796aa4d4901e091dd7fd24dd)
+---
+ src/proto_http.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index e7e1785..b32e778 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -5001,6 +5001,13 @@ int http_sync_req_state(struct session *s)
+ */
+ chn->cons->flags |= SI_FL_NOHALF;
+
++ /* In any case we've finished parsing the request so we must
++ * disable Nagle when sending data because 1) we're not going
++ * to shut this side, and 2) the server is waiting for us to
++ * send pending data.
++ */
++ chn->flags |= CF_NEVER_WAIT;
++
+ if (txn->rsp.msg_state == HTTP_MSG_ERROR)
+ goto wait_other_side;
+
+@@ -5015,7 +5022,6 @@ int http_sync_req_state(struct session *s)
+ /* if any side switches to tunnel mode, the other one does too */
+ channel_auto_read(chn);
+ txn->req.msg_state = HTTP_MSG_TUNNEL;
+- chn->flags |= CF_NEVER_WAIT;
+ goto wait_other_side;
+ }
+
+@@ -5048,7 +5054,6 @@ int http_sync_req_state(struct session *s)
+ if ((txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_TUN) {
+ channel_auto_read(chn);
+ txn->req.msg_state = HTTP_MSG_TUNNEL;
+- chn->flags |= CF_NEVER_WAIT;
+ }
+ }
+
+--
+2.4.10
+
+++ /dev/null
-From e4766ba031e1fea8f2ca139316dc4e8209e960c2 Mon Sep 17 00:00:00 2001
-From: Daniel Jakots <vigdis@chown.me>
-Date: Wed, 29 Jul 2015 08:03:08 +0200
-Subject: [PATCH 4/4] DOC/MINOR: fix OpenBSD versions where haproxy works
-
-(cherry picked from commit 17d228be14762b282e5262262c45ecee4c265552)
----
- README | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/README b/README
-index add7f06..e267730 100644
---- a/README
-+++ b/README
-@@ -39,7 +39,7 @@ and assign it to the TARGET variable :
- - solaris for Solaris 8 or 10 (others untested)
- - freebsd for FreeBSD 5 to 10 (others untested)
- - osx for Mac OS/X
-- - openbsd for OpenBSD 3.1 to 5.2 (others untested)
-+ - openbsd for OpenBSD 3.1 and above
- - aix51 for AIX 5.1
- - aix52 for AIX 5.2
- - cygwin for Cygwin
---
-2.3.6
-
+++ /dev/null
-From 955587271031d66e9b7a768e3bb18dae00b60cc6 Mon Sep 17 00:00:00 2001
-From: Thierry FOURNIER <tfournier@arpalert.org>
-Date: Wed, 8 Jul 2015 00:15:20 +0200
-Subject: [PATCH 05/13] BUG/MINOR: http/sample: gmtime/localtime can fail
-
-The man said that gmtime() and localtime() can return a NULL value.
-This is not tested. It appears that all the values of a 32 bit integer
-are valid, but it is better to check the return of these functions.
-
-However, if the integer move from 32 bits to 64 bits, some 64 values
-can be unsupported.
-(cherry picked from commit fac9ccfb705702f211f99e67d5f5d5129002086a)
-[wt: we only have sample_conv_date() in 1.5]
----
- src/proto_http.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/proto_http.c b/src/proto_http.c
-index 5db64b5..02dc42b 100644
---- a/src/proto_http.c
-+++ b/src/proto_http.c
-@@ -11249,6 +11249,8 @@ static int sample_conv_http_date(const struct arg *args, struct sample *smp)
- curr_date += args[0].data.sint;
-
- tm = gmtime(&curr_date);
-+ if (!tm)
-+ return 0;
-
- temp = get_trash_chunk();
- temp->len = snprintf(temp->str, temp->size - temp->len,
---
-2.4.6
-
--- /dev/null
+From e77015cdc18ab74aba61cdf57de56d06be5c2a4d Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 14 Jan 2015 11:48:58 +0100
+Subject: [PATCH 05/10] MINOR: config: extend the default max hostname length
+ to 64 and beyond
+
+Some users reported that the default max hostname length of 32 is too
+short in some environments. This patch does two things :
+
+ - it relies on the system's max hostname length as found in MAXHOSTNAMELEN
+ if it is set. This is the most logical thing to do as the system libs
+ generally present the appropriate value supported by the system. This
+ value is 64 on Linux and 256 on Solaris, to give a few examples.
+
+ - otherwise it defaults to 64
+
+It is still possible to override this value by defining MAX_HOSTNAME_LEN at
+build time. After some observation time, this patch may be backported to
+1.5 if it does not cause any build issue, as it is harmless and may help
+some users.
+(cherry picked from commit 75abcb3106e2c27ef983df885558cf94e01f717a)
+
+Cc: Lukas Tribus <luky-37@hotmail.com>
+Cc: jose.castro.leon@cern.ch
+
+[wt: no issue reported so far and Jose rightfully asked for it in 1.5]
+---
+ include/common/defaults.h | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/include/common/defaults.h b/include/common/defaults.h
+index 0075509..a191b8a 100644
+--- a/include/common/defaults.h
++++ b/include/common/defaults.h
+@@ -190,8 +190,12 @@
+
+ /* Maximum host name length */
+ #ifndef MAX_HOSTNAME_LEN
+-#define MAX_HOSTNAME_LEN 32
+-#endif
++#if MAXHOSTNAMELEN
++#define MAX_HOSTNAME_LEN MAXHOSTNAMELEN
++#else
++#define MAX_HOSTNAME_LEN 64
++#endif // MAXHOSTNAMELEN
++#endif // MAX_HOSTNAME_LEN
+
+ /* Maximum health check description length */
+ #ifndef HCHK_DESC_LEN
+--
+2.4.10
+
--- /dev/null
+From 3de8e7ab8d9125402cc1a8fb48ee475ee21d7d4c Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 25 Nov 2015 20:11:11 +0100
+Subject: [PATCH 06/10] BUG/MEDIUM: http: don't enable auto-close on the
+ response side
+
+There is a bug where "option http-keep-alive" doesn't force a response
+to stay in keep-alive if the server sends the FIN along with the response
+on the second or subsequent response. The reason is that the auto-close
+was forced enabled when recycling the HTTP transaction and it's never
+disabled along the response processing chain before the SHUTR gets a
+chance to be forwarded to the client side. The MSG_DONE state of the
+HTTP response properly disables it but too late.
+
+There's no more reason for enabling auto-close here, because either it
+doesn't matter in non-keep-alive modes because the connection is closed,
+or it is automatically enabled by process_stream() when it sees there's
+no analyser on the stream.
+
+This bug also affects 1.5 so a backport is desired.
+(cherry picked from commit 714ea78c9a09fe6a35a1f2d86af8f7fc9abb64d1)
+(cherry picked from commit a15091be17f27fcf4e3a84338df1a8b732e396a1)
+---
+ src/proto_http.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index b32e778..5facfbb 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -4946,11 +4946,13 @@ void http_end_txn_clean_session(struct session *s)
+ s->rep->flags |= CF_EXPECT_MORE;
+ }
+
+- /* we're removing the analysers, we MUST re-enable events detection */
++ /* we're removing the analysers, we MUST re-enable events detection.
++ * We don't enable close on the response channel since it's either
++ * already closed, or in keep-alive with an idle connection handler.
++ */
+ channel_auto_read(s->req);
+ channel_auto_close(s->req);
+ channel_auto_read(s->rep);
+- channel_auto_close(s->rep);
+
+ /* we're in keep-alive with an idle connection, monitor it */
+ si_idle_conn(s->req->cons);
+--
+2.4.10
+
+++ /dev/null
-From 6c7351bdd0778bc171a2b54faed058eadc8c9d0d Mon Sep 17 00:00:00 2001
-From: Baptiste Assmann <bedis9@gmail.com>
-Date: Mon, 3 Aug 2015 11:42:50 +0200
-Subject: [PATCH 06/13] DOC: typo in 'redirect', 302 code meaning
-
-302 means a temprary move, not a permanent one
-(cherry picked from commit ea849c0cca63b1b56c9c36f9c3504caa5e826816)
----
- doc/configuration.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/doc/configuration.txt b/doc/configuration.txt
-index 64697a4..e8d8b2a 100644
---- a/doc/configuration.txt
-+++ b/doc/configuration.txt
-@@ -5443,7 +5443,7 @@ redirect scheme <sch> [code <code>] <option> [{if | unless} <condition>]
- is desired. Only codes 301, 302, 303, 307 and 308 are supported,
- with 302 used by default if no code is specified. 301 means
- "Moved permanently", and a browser may cache the Location. 302
-- means "Moved permanently" and means that the browser should not
-+ means "Moved temporarily" and means that the browser should not
- cache the redirection. 303 is equivalent to 302 except that the
- browser will fetch the location with a GET method. 307 is just
- like 302 but makes it clear that the same method must be reused.
---
-2.4.6
-
--- /dev/null
+From 9154bc92ed11c6de75573dec341b6a0ce68bd0eb Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 25 Nov 2015 20:17:27 +0100
+Subject: [PATCH 07/10] BUG/MEDIUM: stream: fix half-closed timeout handling
+
+client-fin and server-fin are bogus. They are applied on the write
+side after a SHUTR was seen. The immediate effect is that sometimes
+if a SHUTR was seen after a SHUTW on the same side, the timeout is
+enabled again regardless of the fact that the output is already
+closed. This results in the timeout event not to be processed and
+a busy poll loop to happen until another timeout on the stream gets
+rid of it. Note that haproxy continues its job during this, it's just
+that it eats all the CPU trying to handle an event that it ignores.
+
+An reproducible case consists in having a client stop reading data from
+a server to ensure data remain in the response buffer, then the client
+sends a shutdown(write). If abortonclose is enabled on haproxy, the
+shutdown is passed to the server side and the server responds with a
+SHUTR that cannot immediately be forwarded to the client since the
+buffer is full. During this time the event is ignored and the task is
+woken again in loops.
+
+It is worth noting that the timeout handling since 1.5 is a bit fragile
+and that it might be possible that other similar conditions still exist,
+so the timeout handling should be audited regarding this issue.
+
+Many thanks to BaiYang for providing detailed information showing the
+problem in action.
+
+This bug also affects 1.5 thus the fix must be backported.
+(cherry picked from commit f25b3573d65fd2411c7537b7b0a4817b478df909)
+[Note for 1.5, it's in session.c here]
+(cherry picked from commit 44e86286159474a52dc74f80d3271504cc6f1550)
+---
+ src/session.c | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+diff --git a/src/session.c b/src/session.c
+index 7520a85..2b2ad78 100644
+--- a/src/session.c
++++ b/src/session.c
+@@ -2213,10 +2213,6 @@ struct task *process_session(struct task *t)
+ if (unlikely((s->req->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CLOSE|CF_SHUTR)) ==
+ (CF_AUTO_CLOSE|CF_SHUTR))) {
+ channel_shutw_now(s->req);
+- if (tick_isset(s->fe->timeout.clientfin)) {
+- s->rep->wto = s->fe->timeout.clientfin;
+- s->rep->wex = tick_add(now_ms, s->rep->wto);
+- }
+ }
+
+ /* shutdown(write) pending */
+@@ -2241,10 +2237,6 @@ struct task *process_session(struct task *t)
+ if (s->req->prod->flags & SI_FL_NOHALF)
+ s->req->prod->flags |= SI_FL_NOLINGER;
+ si_shutr(s->req->prod);
+- if (tick_isset(s->fe->timeout.clientfin)) {
+- s->rep->wto = s->fe->timeout.clientfin;
+- s->rep->wex = tick_add(now_ms, s->rep->wto);
+- }
+ }
+
+ /* it's possible that an upper layer has requested a connection setup or abort.
+@@ -2391,10 +2383,6 @@ struct task *process_session(struct task *t)
+ if (unlikely((s->rep->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CLOSE|CF_SHUTR)) ==
+ (CF_AUTO_CLOSE|CF_SHUTR))) {
+ channel_shutw_now(s->rep);
+- if (tick_isset(s->be->timeout.serverfin)) {
+- s->req->wto = s->be->timeout.serverfin;
+- s->req->wex = tick_add(now_ms, s->req->wto);
+- }
+ }
+
+ /* shutdown(write) pending */
+@@ -2417,10 +2405,6 @@ struct task *process_session(struct task *t)
+ if (s->rep->prod->flags & SI_FL_NOHALF)
+ s->rep->prod->flags |= SI_FL_NOLINGER;
+ si_shutr(s->rep->prod);
+- if (tick_isset(s->be->timeout.serverfin)) {
+- s->req->wto = s->be->timeout.serverfin;
+- s->req->wex = tick_add(now_ms, s->req->wto);
+- }
+ }
+
+ if (s->req->prod->state == SI_ST_DIS || s->req->cons->state == SI_ST_DIS)
+--
+2.4.10
+
+++ /dev/null
-From c3453d53f2862b22d8c8e7d2399dfc38ec966aa4 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Sun, 9 Aug 2015 10:56:35 +0200
-Subject: [PATCH 07/13] DOC: mention that %ms is left-padded with zeroes.
-
-That's important to emit logs.
-(cherry picked from commit 812c88ec126e8fc4fc0f7853f265594d03c63956)
----
- doc/configuration.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/doc/configuration.txt b/doc/configuration.txt
-index e8d8b2a..1d95b5b 100644
---- a/doc/configuration.txt
-+++ b/doc/configuration.txt
-@@ -12381,7 +12381,7 @@ Please refer to the table below for currently defined variables :
- | | %hrl | captured_request_headers CLF style | string list |
- | | %hs | captured_response_headers default style | string |
- | | %hsl | captured_response_headers CLF style | string list |
-- | | %ms | accept date milliseconds | numeric |
-+ | | %ms | accept date milliseconds (left-padded with 0) | numeric |
- | | %pid | PID | numeric |
- | H | %r | http_request | string |
- | | %rc | retries | numeric |
---
-2.4.6
-
--- /dev/null
+From 07ccb48add8c8cb0dd8a0f7d3f4994866d0ef32e Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Thu, 26 Nov 2015 18:32:39 +0100
+Subject: [PATCH 08/10] BUG/MEDIUM: cli: changing compression rate-limiting
+ must require admin level
+
+Right now it's possible to change the global compression rate limiting
+without the CLI being at the admin level.
+
+This fix must be backported to 1.6 and 1.5.
+(cherry picked from commit a1c2b2c4f3e65d198a0a4b25a4f655f7b307a855)
+(cherry picked from commit 9e5f1489c9f2d6926729890f249f7ebb9d3bfd43)
+---
+ src/dumpstats.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/dumpstats.c b/src/dumpstats.c
+index b4be2cd..b1bbf31 100644
+--- a/src/dumpstats.c
++++ b/src/dumpstats.c
+@@ -1695,6 +1695,12 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
+ if (strcmp(args[3], "global") == 0) {
+ int v;
+
++ if (s->listener->bind_conf->level < ACCESS_LVL_ADMIN) {
++ appctx->ctx.cli.msg = stats_permission_denied_msg;
++ appctx->st0 = STAT_CLI_PRINT;
++ return 1;
++ }
++
+ if (!*args[4]) {
+ appctx->ctx.cli.msg = "Expects a maximum input byte rate in kB/s.\n";
+ appctx->st0 = STAT_CLI_PRINT;
+--
+2.4.10
+
+++ /dev/null
-From 1104336c0ba5f474fce8fe7c0125511b59f4dd3d Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 11 Aug 2015 11:20:45 +0200
-Subject: [PATCH 08/13] CLEANUP: .gitignore: ignore more test files
-
-Exclude from "git status" many of the files that often result from
-development tests and bug reports reproducers.
-(cherry picked from commit de365a320ead43168e78facfa337130759783515)
----
- .gitignore | 27 +++++++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
-
-diff --git a/.gitignore b/.gitignore
-index 762f5ad..f6ccd0e 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -18,3 +18,30 @@ make-*
- dlmalloc.c
- 00*.patch
- *.service
-+*.bak
-+contrib/base64/base64rev
-+contrib/halog/halog
-+contrib/ip6range/ip6range
-+contrib/iprange/iprange
-+tests/test_hashes
-+/*.cfg
-+/*.conf
-+/*.diff
-+/*.patch
-+/*.c
-+/*.o
-+/*.so
-+/*.txt
-+/*.TXT
-+/*.txt.*
-+/*.prof
-+/*.gprof
-+/*.prof.*
-+/*.gprof.*
-+/*.tar
-+/*.tar.gz
-+/*.tgz
-+/*.mbox
-+/*.sh
-+/bug*
-+/TAGS
---
-2.4.6
-
--- /dev/null
+From 97ef6f99b8426ffdc97864fc8bb2d85c87cfdad0 Mon Sep 17 00:00:00 2001
+From: Thierry FOURNIER <tfournier@arpalert.org>
+Date: Tue, 3 Nov 2015 19:17:37 +0100
+Subject: [PATCH 09/10] BUILD: freebsd: double declaration
+
+On freebsd, the macro LIST_PREV already exists in the header file
+<sys/queue.h>, and this makes a build error.
+
+This patch removes the macros before declaring it. This ensure
+that the error doesn't occurs.
+(cherry picked from commit 1db96672c4cd264ebca8197bec93a5ce1b23aaa9)
+(cherry picked from commit 6cf9c6b270e57f05abf72cd61f4facb5b6980d57)
+---
+ include/common/mini-clist.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/common/mini-clist.h b/include/common/mini-clist.h
+index 3c3f001..404b6fa 100644
+--- a/include/common/mini-clist.h
++++ b/include/common/mini-clist.h
+@@ -144,6 +144,7 @@ struct cond_wordlist {
+ * which contains list head <lh>, which is known as element <el> in
+ * struct pt.
+ */
++#undef LIST_PREV
+ #define LIST_PREV(lh, pt, el) (LIST_ELEM((lh)->p, pt, el))
+
+ /*
+--
+2.4.10
+
+++ /dev/null
-From 5e077624951a65e6aae381c7213fc54984768dd4 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 11 Aug 2015 11:21:47 +0200
-Subject: [PATCH 09/13] CLEANUP: .gitignore: finally ignore everything but what
- is known.
-
-Still too many files remain, it's easier to block everything but
-what we know.
-(cherry picked from commit d71f1766bdbb041f80394662b0d293f033f93005)
----
- .gitignore | 20 ++++++++++++++++++++
- 1 file changed, 20 insertions(+)
-
-diff --git a/.gitignore b/.gitignore
-index f6ccd0e..1953ba3 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -45,3 +45,23 @@ tests/test_hashes
- /*.sh
- /bug*
- /TAGS
-+# Below we forbid everything and only allow what we know, that's much easier
-+# than blocking about 500 different test files and bug report outputs.
-+/.*
-+/*
-+!/.gitignore
-+!/CHANGELOG
-+!/LICENSE
-+!/Makefile
-+!/README
-+!/ROADMAP
-+!/SUBVERS
-+!/VERDATE
-+!/VERSION
-+!/contrib
-+!/doc
-+!/ebtree
-+!/examples
-+!/include
-+!/src
-+!/tests
---
-2.4.6
-
--- /dev/null
+From 0f836e1361933721c5689c7943143fd6cd260148 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Cyril=20Bont=C3=A9?= <cyril.bonte@free.fr>
+Date: Thu, 26 Nov 2015 21:39:56 +0100
+Subject: [PATCH 10/10] BUG/MEDIUM: sample: urlp can't match an empty value
+
+Currently urlp fetching samples were able to find parameters with an empty
+value, but the return code depended on the value length. The final result was
+that acls using urlp couldn't match empty values.
+
+Example of acl which always returned "false":
+ acl MATCH_EMPTY urlp(foo) -m len 0
+
+The fix consists in unconditionally return 1 when the parameter is found.
+
+This fix must be backported to 1.6 and 1.5.
+(cherry picked from commit ce1ef4df0135f9dc1cb6691395eacb487015fe3e)
+(cherry picked from commit 6bd426cf35c95985712369ed528c10a5f80ad8fd)
+[ note: in 1.5 we have value+value_l instead of vstart+vend ]
+---
+ src/proto_http.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index 5facfbb..3af7880 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -11050,9 +11050,11 @@ find_url_param_pos(char* query_string, size_t query_string_l,
+ }
+
+ /*
+- * Given a url parameter name, returns its value and size into *value and
+- * *value_l respectively, and returns non-zero. If the parameter is not found,
+- * zero is returned and value/value_l are not touched.
++ * Given a url parameter name and a query string, find the next value.
++ * An empty url_param_name matches the first available parameter.
++ * If the parameter is found, 1 is returned and *value / *value_l are updated
++ * to respectively provide a pointer to the value and its length.
++ * Otherwise, 0 is returned and value/value_l are not modified.
+ */
+ static int
+ find_url_param_value(char* path, size_t path_l,
+@@ -11082,7 +11084,7 @@ find_url_param_value(char* path, size_t path_l,
+
+ *value = value_start;
+ *value_l = value_end - value_start;
+- return value_end != value_start;
++ return 1;
+ }
+
+ static int
+--
+2.4.10
+
+++ /dev/null
-From c7c1e55f09839727ba7defd37347fc500dabb202 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 11 Aug 2015 11:36:45 +0200
-Subject: [PATCH 10/13] MEDIUM: config: emit a warning on a frontend without
- listener
-
-Commit c6678e2 ("MEDIUM: config: authorize frontend and listen without bind")
-completely removed the test for bind lines in frontends in order to make it
-easier for automated tools to generate configs (eg: replacing a bind with
-another one passing via a temporary config without any bind line). The
-problem is that some common mistakes are totally hidden now. For example,
-this apparently valid entry is silently ignored :
-
- listen 1.2.3.4:8000
- server s1 127.0.0.1:8000
-
-Hint: 1.2.3.4:8000 is mistakenly the proxy name here.
-
-Thus instead we now emit a warning to indicate that a frontend was found
-with no listener. This should be backported to 1.5 to help spot abnormal
-configurations.
-(cherry picked from commit f82d1ca2d7ec83804d6b54e61a35747ad2f85188)
----
- src/cfgparse.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/src/cfgparse.c b/src/cfgparse.c
-index 2a5f178..d67edc5 100644
---- a/src/cfgparse.c
-+++ b/src/cfgparse.c
-@@ -6193,6 +6193,12 @@ int check_config_validity()
- break;
- }
-
-+ if ((curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->conf.listeners)) {
-+ Warning("config : %s '%s' has no 'bind' directive. Please declare it as a backend if this was intended.\n",
-+ proxy_type_str(curproxy), curproxy->id);
-+ err_code |= ERR_WARN;
-+ }
-+
- if ((curproxy->cap & PR_CAP_BE) && (curproxy->mode != PR_MODE_HEALTH)) {
- if (curproxy->lbprm.algo & BE_LB_KIND) {
- if (curproxy->options & PR_O_TRANSP) {
---
-2.4.6
-
+++ /dev/null
-From ee12145d38a7dee81a20cf232c724ccb7a46ad8b Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 18 Aug 2015 17:15:20 +0200
-Subject: [PATCH 11/13] BUG/MEDIUM: counters: ensure that src_{inc,clr}_gpc0
- creates a missing entry
-
-During 1.5-dev20 there was some code refactoring to make the src_* fetch
-function use the same code as sc_*. Unfortunately this introduced a
-regression where src_* doesn't create an entry anymore if it does not
-exist in the table. The reason is that smp_fetch_sc_stkctr() only calls
-stktable_lookup_key() while src_inc_*/src_clr_* used to make use of
-stktable_update_key() which additionally create the entry if it does
-not exist.
-
-There's no point modifying the common function for these two exceptions,
-so instead we now have a function dedicated to the creation of this entry
-for src_* only. It is called when the entry didn't exist, so that requires
-minimal modifications to existing code.
-
-Thanks to Thierry Fournier for helping diagnose the issue.
-
-This fix must be backported to 1.5.
-(cherry picked from commit 0f4eadd4830279f5ee83aa545728fb750f5c8185)
-
-[Note: the backport to 1.5 significantly differs from the version in 1.6
- since we need to use the table's type and to retrieve the source address
- directly from the connection. At least it matches the way other src_*
- fetch functions work, and it's been verified to work fine]
----
- src/session.c | 33 +++++++++++++++++++++++++++++++++
- 1 file changed, 33 insertions(+)
-
-diff --git a/src/session.c b/src/session.c
-index 5b9e407..6d62e36 100644
---- a/src/session.c
-+++ b/src/session.c
-@@ -2806,6 +2806,33 @@ smp_fetch_sc_stkctr(struct session *l4, const struct arg *args, const char *kw)
- return &l4->stkctr[num];
- }
-
-+/* same as smp_fetch_sc_stkctr() but dedicated to src_* and can create
-+ * the entry if it doesn't exist yet. This is needed for a few fetch
-+ * functions which need to create an entry, such as src_inc_gpc* and
-+ * src_clr_gpc*.
-+ */
-+struct stkctr *
-+smp_create_src_stkctr(struct session *sess, const struct arg *args, const char *kw)
-+{
-+ static struct stkctr stkctr;
-+ struct stktable_key *key;
-+ struct connection *conn = objt_conn(sess->si[0].end);
-+
-+ if (strncmp(kw, "src_", 4) != 0)
-+ return NULL;
-+
-+ if (!conn)
-+ return NULL;
-+
-+ key = addr_to_stktable_key(&conn->addr.from, args->data.prx->table.type);
-+ if (!key)
-+ return NULL;
-+
-+ stkctr.table = &args->data.prx->table;
-+ stkctr_set_entry(&stkctr, stktable_update_key(stkctr.table, key));
-+ return &stkctr;
-+}
-+
- /* set return a boolean indicating if the requested session counter is
- * currently being tracked or not.
- * Supports being called as "sc[0-9]_tracked" only.
-@@ -2887,6 +2914,9 @@ smp_fetch_sc_inc_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned i
- if (!stkctr)
- return 0;
-
-+ if (stkctr_entry(stkctr) == NULL)
-+ stkctr = smp_create_src_stkctr(l4, args, kw);
-+
- smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
-@@ -2924,6 +2954,9 @@ smp_fetch_sc_clr_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned i
- if (!stkctr)
- return 0;
-
-+ if (stkctr_entry(stkctr) == NULL)
-+ stkctr = smp_create_src_stkctr(l4, args, kw);
-+
- smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
---
-2.4.6
-
+++ /dev/null
-From 2272b4ffde38c836adfd9a9b43ff5c019ef4190a Mon Sep 17 00:00:00 2001
-From: Thierry FOURNIER <tfournier@arpalert.org>
-Date: Wed, 26 Aug 2015 08:21:26 +0200
-Subject: [PATCH 12/13] DOC: ssl: missing LF
-
-An error message miss LF
-(cherry picked from commit bc965348d7ccc0a306504232ab85dc240fd31fbf)
----
- src/ssl_sock.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/ssl_sock.c b/src/ssl_sock.c
-index 2ae45ec..8f698c0 100644
---- a/src/ssl_sock.c
-+++ b/src/ssl_sock.c
-@@ -1760,7 +1760,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv, struct proxy *curproxy)
- #ifndef OPENSSL_NO_SSL3
- SSL_CTX_set_ssl_version(srv->ssl_ctx.ctx, SSLv3_client_method());
- #else
-- Alert("SSLv3 support requested but unavailable.");
-+ Alert("SSLv3 support requested but unavailable.\n");
- cfgerr++;
- #endif
- }
---
-2.4.6
-
+++ /dev/null
-From d3a93a932430bc1a4cd5d1350820c2bec706e26d Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Thu, 27 Aug 2015 17:15:05 +0200
-Subject: [PATCH 13/13] DOC: fix example of http-request using
- ssl_fc_session_id
-
-It was missing the ",hex" resulting in raw binary data being dumped in
-the header or the logs. Now we know where these crazy logs originated
-from!
-(cherry picked from commit fca4261dacab51db960d30120f4bb4201f7e4a51)
----
- doc/configuration.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/doc/configuration.txt b/doc/configuration.txt
-index 1d95b5b..67d273b 100644
---- a/doc/configuration.txt
-+++ b/doc/configuration.txt
-@@ -3135,7 +3135,7 @@ http-request { allow | deny | tarpit | auth [realm <realm>] | redirect <rule> |
- Example:
- http-request set-header X-Haproxy-Current-Date %T
- http-request set-header X-SSL %[ssl_fc]
-- http-request set-header X-SSL-Session_ID %[ssl_fc_session_id]
-+ http-request set-header X-SSL-Session_ID %[ssl_fc_session_id,hex]
- http-request set-header X-SSL-Client-Verify %[ssl_c_verify]
- http-request set-header X-SSL-Client-DN %{+Q}[ssl_c_s_dn]
- http-request set-header X-SSL-Client-CN %{+Q}[ssl_c_s_dn(cn)]
---
-2.4.6
-
+++ /dev/null
-From bcd033699c5a4904967652de4980e4f35f17ee34 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Thu, 3 Sep 2015 17:15:21 +0200
-Subject: [PATCH 14/16] BUG/MINOR: http: remove stupid HTTP_METH_NONE entry
-
-When converting the "method" fetch to a string, we used to get an empty
-string if the first character was not an upper case. This was caused by
-the lookup function which returns HTTP_METH_NONE when a lookup is not
-possible, and this method being mapped to an empty string in the array.
-
-This is a totally stupid mechanism, there's no reason for having the
-result depend on the first char. In fact the message parser already
-checks that the syntax matches an HTTP token so we can only land there
-with a valid token, hence only HTTP_METH_OTHER should be returned.
-
-This fix should be backported to all actively supported branches.
-(cherry picked from commit b7ce424be2bc9df73a3b971fa9dd6daea0332bf1)
----
- include/types/proto_http.h | 1 -
- src/proto_http.c | 11 ++++-------
- 2 files changed, 4 insertions(+), 8 deletions(-)
-
-diff --git a/include/types/proto_http.h b/include/types/proto_http.h
-index a5a5d31..dbce972 100644
---- a/include/types/proto_http.h
-+++ b/include/types/proto_http.h
-@@ -219,7 +219,6 @@ enum {
-
- /* Known HTTP methods */
- enum http_meth_t {
-- HTTP_METH_NONE = 0,
- HTTP_METH_OPTIONS,
- HTTP_METH_GET,
- HTTP_METH_HEAD,
-diff --git a/src/proto_http.c b/src/proto_http.c
-index 02dc42b..46694cb 100644
---- a/src/proto_http.c
-+++ b/src/proto_http.c
-@@ -361,12 +361,11 @@ const struct http_method_desc http_methods[26][3] = {
- [0] = { .meth = HTTP_METH_TRACE , .len=5, .text="TRACE" },
- },
- /* rest is empty like this :
-- * [1] = { .meth = HTTP_METH_NONE , .len=0, .text="" },
-+ * [0] = { .meth = HTTP_METH_OTHER , .len=0, .text="" },
- */
- };
-
- const struct http_method_name http_known_methods[HTTP_METH_OTHER] = {
-- [HTTP_METH_NONE] = { "", 0 },
- [HTTP_METH_OPTIONS] = { "OPTIONS", 7 },
- [HTTP_METH_GET] = { "GET", 3 },
- [HTTP_METH_HEAD] = { "HEAD", 4 },
-@@ -793,8 +792,8 @@ struct chunk *http_error_message(struct session *s, int msgnum)
- }
-
- /*
-- * returns HTTP_METH_NONE if there is nothing valid to read (empty or non-text
-- * string), HTTP_METH_OTHER for unknown methods, or the identified method.
-+ * returns a known method among HTTP_METH_* or HTTP_METH_OTHER for all unknown
-+ * ones.
- */
- enum http_meth_t find_http_meth(const char *str, const int len)
- {
-@@ -810,10 +809,8 @@ enum http_meth_t find_http_meth(const char *str, const int len)
- if (likely(memcmp(str, h->text, h->len) == 0))
- return h->meth;
- };
-- return HTTP_METH_OTHER;
- }
-- return HTTP_METH_NONE;
--
-+ return HTTP_METH_OTHER;
- }
-
- /* Parse the URI from the given transaction (which is assumed to be in request
---
-2.4.6
-
+++ /dev/null
-From 3f34b5539e7ba31e44055d853b9ba496e73e0bae Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Mon, 7 Sep 2015 19:32:33 +0200
-Subject: [PATCH 15/16] BUG/MAJOR: http: don't call http_send_name_header()
- after an error
-
-A crash was reported when using the "famous" http-send-name-header
-directive. This time it's a bit tricky, it requires a certain number of
-conditions to be met including maxconn on a server, queuing, timeout in
-the queue and cookie-based persistence.
-
-The problem is that in stream.c, before calling http_send_name_header(),
-we check a number of conditions to know if we have to replace the header
-name. But prior to reaching this place, it's possible for
-sess_update_stream_int() to fail and change the stream-int's state to
-SI_ST_CLO, send an error 503 to the client, and flush all buffers. But
-http_send_name_header() can only be called with valid buffer contents
-matching the http_msg's description. So when it rewinds the stream to
-modify the header, buf->o becomes negative by the size of the incoming
-request and is used as the argument to memmove() which basically
-displaces 4GB of memory off a few bytes to write the new name, resulting
-in a core and a core file that's really not fun to play with.
-
-The solution obviously consists in refraining from calling this nasty
-function when the stream interface is already closed.
-
-This bug also affects 1.5 and possibly 1.4, so the fix must be backported
-there.
-(cherry picked from commit 9c03b33329cb4924716edc1c851913a18b0670dc)
----
- src/session.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/session.c b/src/session.c
-index 6d62e36..7520a85 100644
---- a/src/session.c
-+++ b/src/session.c
-@@ -2293,7 +2293,7 @@ struct task *process_session(struct task *t)
-
- /* Now we can add the server name to a header (if requested) */
- /* check for HTTP mode and proxy server_name_hdr_name != NULL */
-- if ((s->si[1].state >= SI_ST_CON) &&
-+ if ((s->si[1].state >= SI_ST_CON) && (s->si[1].state < SI_ST_CLO) &&
- (s->be->server_id_hdr_name != NULL) &&
- (s->be->mode == PR_MODE_HTTP) &&
- objt_server(s->target)) {
---
-2.4.6
-
+++ /dev/null
-From 36456071ea34546d98d3b66a696cd4c4c4643de5 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 8 Sep 2015 16:01:25 +0200
-Subject: [PATCH 16/16] BUG/MINOR: tools: make str2sa_range() report
- unresolvable addresses
-
-If an environment variable is used in an address, and is not set, it's
-silently considered as ":" or "0.0.0.0:0" which is not correct as it
-can hide environment issues and lead to unexpected behaviours. Let's
-report this case when it happens.
-
-This fix should be backported to 1.5.
-(cherry picked from commit 9f69f46d1f1b1d116c00b4b0483c519747f977b7)
----
- src/standard.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/src/standard.c b/src/standard.c
-index f57724c..9299882 100644
---- a/src/standard.c
-+++ b/src/standard.c
-@@ -709,6 +709,11 @@ struct sockaddr_storage *str2sa_range(const char *str, int *low, int *high, char
- goto out;
- }
-
-+ if (!*str2) {
-+ memprintf(err, "'%s' resolves to an empty address (environment variable missing?)\n", str);
-+ goto out;
-+ }
-+
- memset(&ss, 0, sizeof(ss));
-
- if (strncmp(str2, "unix@", 5) == 0) {
---
-2.4.6
-
include $(TOPDIR)/rules.mk
PKG_NAME:=ocserv
-PKG_VERSION:=0.10.9
-PKG_RELEASE:=4
+PKG_VERSION:=0.10.10
+PKG_RELEASE:=3
PKG_USE_MIPS16:=0
PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/ocserv/
-PKG_MD5SUM:=74834c59aa96beaa222c21ee6521adb2
+PKG_MD5SUM:=1f73ccb66d36cd51279323e95ae99e68
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=COPYING
EXTRA_LDFLAGS+=-lncurses
CONFIGURE_ARGS+= \
+ --with-pager="" \
--enable-local-libopts \
--with-libreadline-prefix="$(STAGING_DIR)/" \
--without-libnl \
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ocserv $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ocserv-fw $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ocpasswd $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/occtl $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d
# The following example is from linux systems. %{R} should be something
# like 192.168.2.0/24
-route-add-cmd = "/sbin/route add -net %{R} dev %{D}"
-route-del-cmd = "/sbin/route del -net %{R} dev %{D}"
+#route-add-cmd = "/usr/sbin/ip route add %{R} dev %{D}"
+#route-del-cmd = "/usr/sbin/ip route delete %{R} dev %{D}"
+
+route-add-cmd = "/sbin/route add -net %{RI} dev %{D}"
+route-del-cmd = "/sbin/route del -net %{RI} dev %{D}"
# This option allows to forward a proxy. The special strings '%{U}'
# and '%{G}', if present will be replaced by the username and group name.
# Option to allow sending arbitrary custom headers to the client after
# authentication and prior to VPN tunnel establishment.
#custom-header = "X-My-Header: hi there"
+
+expose-iroutes = true
PKG_NAME:=strongswan
PKG_VERSION:=5.3.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
--- /dev/null
+From ea651877c0bb6e129f52eb592cea3b10b2e3347b Mon Sep 17 00:00:00 2001
+From: Tobias Brunner <tobias@strongswan.org>
+Date: Thu, 19 Nov 2015 11:21:48 +0100
+Subject: [PATCH] sigwaitinfo() may fail with EINTR if an unblocked signal not
+ in the set is received
+
+ #1213.
+---
+ src/charon-cmd/charon-cmd.c | 9 ++++-----
+ src/charon-nm/charon-nm.c | 9 ++++-----
+ src/charon-systemd/charon-systemd.c | 9 ++++-----
+ src/charon-tkm/src/charon-tkm.c | 9 ++++-----
+ src/charon/charon.c | 11 +++++------
+ src/conftest/conftest.c | 2 +-
+ src/frontends/osx/charon-xpc/charon-xpc.c | 7 ++++---
+ src/libfast/fast_dispatcher.c | 6 +++++-
+ src/libstrongswan/utils/utils.c | 5 ++++-
+ 9 files changed, 35 insertions(+), 32 deletions(-)
+
+diff --git a/src/charon-cmd/charon-cmd.c b/src/charon-cmd/charon-cmd.c
+index b8f943f..d3b31cc 100644
+--- a/src/charon-cmd/charon-cmd.c
++++ b/src/charon-cmd/charon-cmd.c
+@@ -115,6 +115,10 @@ static int run()
+ sig = sigwaitinfo(&set, NULL);
+ if (sig == -1)
+ {
++ if (errno == EINTR)
++ { /* ignore signals we didn't wait for */
++ continue;
++ }
+ DBG1(DBG_DMN, "waiting for signal failed: %s", strerror(errno));
+ return 1;
+ }
+@@ -152,11 +156,6 @@ static int run()
+ charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
+ return 1;
+ }
+- default:
+- {
+- DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
+- break;
+- }
+ }
+ }
+ }
+diff --git a/src/charon-nm/charon-nm.c b/src/charon-nm/charon-nm.c
+index 1773e7c..fb090e5 100644
+--- a/src/charon-nm/charon-nm.c
++++ b/src/charon-nm/charon-nm.c
+@@ -85,6 +85,10 @@ static void run()
+ sig = sigwaitinfo(&set, NULL);
+ if (sig == -1)
+ {
++ if (errno == EINTR)
++ { /* ignore signals we didn't wait for */
++ continue;
++ }
+ DBG1(DBG_DMN, "waiting for signal failed: %s", strerror(errno));
+ return;
+ }
+@@ -102,11 +106,6 @@ static void run()
+ charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
+ return;
+ }
+- default:
+- {
+- DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
+- break;
+- }
+ }
+ }
+ }
+diff --git a/src/charon-systemd/charon-systemd.c b/src/charon-systemd/charon-systemd.c
+index f302d45..4286cde 100644
+--- a/src/charon-systemd/charon-systemd.c
++++ b/src/charon-systemd/charon-systemd.c
+@@ -254,6 +254,10 @@ static int run()
+ sig = sigwaitinfo(&set, NULL);
+ if (sig == -1)
+ {
++ if (errno == EINTR)
++ { /* ignore signals we didn't wait for */
++ continue;
++ }
+ DBG1(DBG_DMN, "waiting for signal failed: %s", strerror(errno));
+ return SS_RC_INITIALIZATION_FAILED;
+ }
+@@ -265,11 +269,6 @@ static int run()
+ charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
+ return 0;
+ }
+- default:
+- {
+- DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
+- break;
+- }
+ }
+ }
+ }
+diff --git a/src/charon-tkm/src/charon-tkm.c b/src/charon-tkm/src/charon-tkm.c
+index 52d82f3..3923c8a 100644
+--- a/src/charon-tkm/src/charon-tkm.c
++++ b/src/charon-tkm/src/charon-tkm.c
+@@ -104,6 +104,10 @@ static void run()
+ sig = sigwaitinfo(&set, NULL);
+ if (sig == -1)
+ {
++ if (errno == EINTR)
++ { /* ignore signals we didn't wait for */
++ continue;
++ }
+ DBG1(DBG_DMN, "waiting for signal failed: %s", strerror(errno));
+ return;
+ }
+@@ -121,11 +125,6 @@ static void run()
+ charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
+ return;
+ }
+- default:
+- {
+- DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
+- break;
+- }
+ }
+ }
+ }
+diff --git a/src/charon/charon.c b/src/charon/charon.c
+index f03b6e1..4c2a9a4 100644
+--- a/src/charon/charon.c
++++ b/src/charon/charon.c
+@@ -98,7 +98,7 @@ static void run()
+ {
+ sigset_t set;
+
+- /* handle SIGINT, SIGHUP ans SIGTERM in this handler */
++ /* handle SIGINT, SIGHUP and SIGTERM in this handler */
+ sigemptyset(&set);
+ sigaddset(&set, SIGINT);
+ sigaddset(&set, SIGHUP);
+@@ -112,6 +112,10 @@ static void run()
+ sig = sigwaitinfo(&set, NULL);
+ if (sig == -1)
+ {
++ if (errno == EINTR)
++ { /* ignore signals we didn't wait for */
++ continue;
++ }
+ DBG1(DBG_DMN, "waiting for signal failed: %s", strerror(errno));
+ return;
+ }
+@@ -144,11 +148,6 @@ static void run()
+ charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
+ return;
+ }
+- default:
+- {
+- DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
+- break;
+- }
+ }
+ }
+ }
+diff --git a/src/conftest/conftest.c b/src/conftest/conftest.c
+index 9348b64..edfe0ca 100644
+--- a/src/conftest/conftest.c
++++ b/src/conftest/conftest.c
+@@ -565,7 +565,7 @@ int main(int argc, char *argv[])
+ sigaddset(&set, SIGTERM);
+ sigprocmask(SIG_BLOCK, &set, NULL);
+
+- while ((sig = sigwaitinfo(&set, NULL)) != -1)
++ while ((sig = sigwaitinfo(&set, NULL)) != -1 || errno == EINTR)
+ {
+ switch (sig)
+ {
+diff --git a/src/libfast/fast_dispatcher.c b/src/libfast/fast_dispatcher.c
+index b4c6ce3..66a2ee5 100644
+--- a/src/libfast/fast_dispatcher.c
++++ b/src/libfast/fast_dispatcher.c
+@@ -21,6 +21,7 @@
+ #include <fcgiapp.h>
+ #include <signal.h>
+ #include <unistd.h>
++#include <errno.h>
+
+ #include <utils/debug.h>
+ #include <threading/thread.h>
+@@ -389,7 +390,10 @@ METHOD(fast_dispatcher_t, waitsignal, void,
+ sigaddset(&set, SIGTERM);
+ sigaddset(&set, SIGHUP);
+ sigprocmask(SIG_BLOCK, &set, NULL);
+- sigwaitinfo(&set, NULL);
++ while (sigwaitinfo(&set, NULL) == -1 && errno == EINTR)
++ {
++ /* wait for signal */
++ }
+ }
+
+ METHOD(fast_dispatcher_t, destroy, void,
+diff --git a/src/libstrongswan/utils/utils.c b/src/libstrongswan/utils/utils.c
+index 4e86165..40cb43d 100644
+--- a/src/libstrongswan/utils/utils.c
++++ b/src/libstrongswan/utils/utils.c
+@@ -124,7 +124,10 @@ void wait_sigint()
+ sigaddset(&set, SIGTERM);
+
+ sigprocmask(SIG_BLOCK, &set, NULL);
+- sigwaitinfo(&set, NULL);
++ while (sigwaitinfo(&set, NULL) == -1 && errno == EINTR)
++ {
++ /* wait for signal */
++ }
+ }
+
+ #ifndef HAVE_SIGWAITINFO
define Build/Compile/vnstat
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)"
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)"
endef
define Build/Compile/vnstati
include $(TOPDIR)/rules.mk
PKG_NAME:=xl2tpd
-PKG_VERSION:=devel-20150930
+PKG_VERSION:=devel-20151125
PKG_RELEASE:=1
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/xelerance/xl2tpd.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=5faece38704ae32063abe1d25e199c03e6f44669
+PKG_SOURCE_VERSION:=e2065bf0fc22ba33001ad503c01bba01648024a8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_INSTALL:=1
proto_l2tp_setup() {
local interface="$1"
local optfile="/tmp/l2tp/options.${interface}"
+ local ip serv_addr server host
- local ip serv_addr server
- json_get_var server server && {
- for ip in $(resolveip -t 5 "$server"); do
- ( proto_add_host_dependency "$interface" "$ip" )
- serv_addr=1
- done
- }
+ json_get_var server server
+ host="${server%:*}"
+ for ip in $(resolveip -t 5 "$host"); do
+ ( proto_add_host_dependency "$interface" "$ip" )
+ serv_addr=1
+ done
[ -n "$serv_addr" ] || {
echo "Could not resolve server address" >&2
sleep 5
IPFLAGS?= -DIP_ALLOCATION
--CFLAGS+= $(DFLAGS) -O2 -fno-builtin -Wall -DSANITY $(OSFLAGS) $(IPFLAGS)
-+OFLAGS=-O2
+-CFLAGS+= $(DFLAGS) -Os -fno-builtin -Wall -DSANITY $(OSFLAGS) $(IPFLAGS)
++OFLAGS=-Os
+CFLAGS+= $(DFLAGS) $(OFLAGS) -fno-builtin -Wall -DSANITY $(OSFLAGS) $(IPFLAGS)
HDRS=l2tp.h avp.h misc.h control.h call.h scheduler.h file.h aaa.h md5.h
OBJS=xl2tpd.o pty.o misc.o control.o avp.o call.o network.o avpsend.o scheduler.o file.o aaa.o md5.o
PKG_NAME:=avrdude
PKG_VERSION:=6.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/avrdude
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
define Package/avrdude
SECTION:=utils
PKG_NAME:=btrfs-progs
PKG_VERSION:=3.19.1
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs/
+++ /dev/null
-Index: btrfs-progs-v3.19.1/mkfs.c
-===================================================================
---- btrfs-progs-v3.19.1.orig/mkfs.c
-+++ btrfs-progs-v3.19.1/mkfs.c
-@@ -31,7 +31,7 @@
- #include <getopt.h>
- #include <uuid/uuid.h>
- #include <ctype.h>
--#include <sys/xattr.h>
-+#include <attr/xattr.h>
- #include <limits.h>
- #include <linux/limits.h>
- #include <blkid/blkid.h>
-Index: btrfs-progs-v3.19.1/props.c
-===================================================================
---- btrfs-progs-v3.19.1.orig/props.c
-+++ btrfs-progs-v3.19.1/props.c
-@@ -17,7 +17,7 @@
- #include <sys/stat.h>
- #include <sys/ioctl.h>
- #include <sys/types.h>
--#include <sys/xattr.h>
-+#include <attr/xattr.h>
- #include <fcntl.h>
- #include <unistd.h>
-
-Index: btrfs-progs-v3.19.1/cmds-receive.c
-===================================================================
---- btrfs-progs-v3.19.1.orig/cmds-receive.c
-+++ btrfs-progs-v3.19.1/cmds-receive.c
-@@ -34,7 +34,7 @@
- #include <sys/ioctl.h>
- #include <sys/time.h>
- #include <sys/types.h>
--#include <sys/xattr.h>
-+#include <attr/xattr.h>
- #include <uuid/uuid.h>
-
- #include "ctree.h"
-Index: btrfs-progs-v3.19.1/cmds-restore.c
-===================================================================
---- btrfs-progs-v3.19.1.orig/cmds-restore.c
-+++ btrfs-progs-v3.19.1/cmds-restore.c
-@@ -32,7 +32,7 @@
- #include <regex.h>
- #include <getopt.h>
- #include <sys/types.h>
--#include <sys/xattr.h>
-+#include <attr/xattr.h>
-
- #include "ctree.h"
- #include "disk-io.h"
-Index: btrfs-progs-v3.19.1/Makefile.in
-===================================================================
---- btrfs-progs-v3.19.1.orig/Makefile.in
-+++ btrfs-progs-v3.19.1/Makefile.in
-@@ -21,7 +21,7 @@ CFLAGS = @CFLAGS@ \
- LDFLAGS = @LDFLAGS@ \
- -rdynamic
-
--LIBS = @UUID_LIBS@ @BLKID_LIBS@ @ZLIB_LIBS@ @LZO2_LIBS@ -L. -pthread
-+LIBS = @ATTR_LIBS@ @UUID_LIBS@ @BLKID_LIBS@ @ZLIB_LIBS@ @LZO2_LIBS@ -L. -pthread
- LIBBTRFS_LIBS = $(LIBS)
-
- # Static compilation flags
-Index: btrfs-progs-v3.19.1/configure.ac
-===================================================================
---- btrfs-progs-v3.19.1.orig/configure.ac
-+++ btrfs-progs-v3.19.1/configure.ac
-@@ -115,6 +115,9 @@ dnl
- dnl The default PKG_CHECK_MODULES() action-if-not-found is end the
- dnl execution with error. The static libs are optional.
-
-+PKG_CHECK_MODULES(ATTR, [libattr])
-+PKG_STATIC(BLKID_LIBS_STATIC, [libattr])
-+
- PKG_CHECK_MODULES(BLKID, [blkid])
- PKG_STATIC(BLKID_LIBS_STATIC, [blkid])
-
include $(TOPDIR)/rules.mk
PKG_NAME:=cryptsetup
-PKG_VERSION:=1.6.7
+PKG_VERSION:=1.7.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
PKG_LICENSE_FILES:=COPYING COPYING.LGPL
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=@KERNEL/linux/utils/cryptsetup/v1.6
-PKG_MD5SUM:=918406eb5d2e2f5a7348c432ea9b1473
+PKG_SOURCE_URL:=@KERNEL/linux/utils/cryptsetup/v1.7
+PKG_MD5SUM:=56c385fe87fc2b6873df4b7f89202d0f
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
include $(TOPDIR)/rules.mk
PKG_NAME:=dosfstools
-PKG_VERSION:=3.0.27
+PKG_VERSION:=3.0.28
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=David Bonnes <david.bonnes@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://daniel-baumann.ch/files/software/dosfstools \
+PKG_SOURCE_URL:=https://github.com/dosfstools/dosfstools/releases/download/v$(PKG_VERSION)/ \
http://fossies.org/linux/misc
-PKG_MD5SUM:=2e31e7bdf92998e41ed17de505a4a552
+PKG_MD5SUM:=64e3b3a59b51d2a97d7ac38b23a124bb
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/dosfstools/Default
SECTION:=utils
CATEGORY:=Utilities
- URL:=http://www.daniel-baumann.ch/software/dosfstools/
+ URL:=https://github.com/dosfstools
SUBMENU:=Filesystem
DEPENDS:=$(ICONV_DEPENDS)
endef
--- /dev/null
+Index: dosfstools-3.0.28/src/mkfs.fat.c
+===================================================================
+--- dosfstools-3.0.28.orig/src/mkfs.fat.c
++++ dosfstools-3.0.28/src/mkfs.fat.c
+@@ -1412,7 +1412,7 @@ int main(int argc, char **argv)
+
+ gettimeofday(&create_timeval, NULL);
+ create_time = create_timeval.tv_sec;
+- volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
++ volume_id = (uint32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
+ check_atari();
+
+ printf("mkfs.fat " VERSION " (" VERSION_DATE ")\n");
include $(TOPDIR)/rules.mk
PKG_NAME:=gammu
-PKG_VERSION:=1.36.6
+PKG_VERSION:=1.36.7
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://dl.cihar.com/gammu/releases/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=9047f0598602144a99153f5e61104529
+PKG_MD5SUM:=3687d789fd0697a1ea4f4ef57024e865
PKG_MAINTAINER:=Vitaly Protsko <villy@sft.ru>
PKG_LICENCE:=GPL-2.0
}
:windows Bindings common to all windows
-type ^@ TO ÿ
abort ^C
abort ^K Q
abort ^K ^Q
:query Single-key query window
:inherit windows
-:querya Single-key query window for quoting
-type ^@ TO ÿ
-
-:querysr Search & replace query window
-type ^@ TO ÿ
-
:shell Input to shell windows
:inherit main
"\ 3" ^C Abort
include $(TOPDIR)/rules.mk
PKG_NAME:=LVM2
-PKG_VERSION:=2.02.132
+PKG_VERSION:=2.02.136
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0 LGPL-2.1
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2
-PKG_MD5SUM:=80af5af726949bbbb2aceb15b24b7d20
+PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2/releases
+PKG_MD5SUM:=f1ac794d1cf44e863a7fa614f4c28410
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
config MC_SUBSHELL
bool "Enable concurrent subshell"
- default n
+ default y
help
This option enables concurrent subshell support.
- Disabled by default.
+ Enabled by default.
config MC_LARGEFILE
bool "Enable largefile support"
PKG_NAME:=mc
PKG_VERSION:=4.8.15
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=Dirk Brenken <dirk@brenken.org>
PKG_LICENSE:=GPL-3.0+
--- /dev/null
+--- a/lib/global.c
++++ b/lib/global.c
+@@ -97,6 +97,7 @@ mc_global_t mc_global = {
+ #endif /* !ENABLE_SUBSHELL */
+
+ .shell = NULL,
++ .shell_realpath = NULL,
+
+ .xterm_flag = FALSE,
+ .disable_x11 = FALSE,
+--- a/lib/global.h
++++ b/lib/global.h
+@@ -255,6 +255,7 @@ typedef struct
+
+ /* The user's shell */
+ char *shell;
++ char *shell_realpath;
+
+ /* This flag is set by xterm detection routine in function main() */
+ /* It is used by function view_other_cmd() */
+--- a/lib/mcconfig/paths.c
++++ b/lib/mcconfig/paths.c
+@@ -84,6 +84,7 @@ static const struct
+ /* data */
+ { "skins", &mc_data_str, MC_SKINS_SUBDIR},
+ { "fish", &mc_data_str, FISH_PREFIX},
++ { "ashrc", &mc_data_str, "ashrc"},
+ { "bashrc", &mc_data_str, "bashrc"},
+ { "inputrc", &mc_data_str, "inputrc"},
+ { "extfs.d", &mc_data_str, MC_EXTFS_DIR},
+--- a/src/main.c
++++ b/src/main.c
+@@ -87,6 +87,9 @@
+ /*** file scope variables ************************************************************************/
+
+ /*** file scope functions ************************************************************************/
++
++static char rp_shell[PATH_MAX];
++
+ /* --------------------------------------------------------------------------------------------- */
+
+ static void
+@@ -118,6 +121,44 @@ check_codeset (void)
+ }
+
+ /* --------------------------------------------------------------------------------------------- */
++/**
++ * Get a system shell.
++ *
++ * @return newly allocated string with shell name
++ */
++
++static char *
++mc_get_system_shell (void)
++{
++ char *sh_str;
++ /* 3rd choice: look for existing shells supported as MC subshells. */
++ if (access ("/bin/bash", X_OK) == 0)
++ sh_str = g_strdup ("/bin/bash");
++ else if (access ("/bin/ash", X_OK) == 0)
++ sh_str = g_strdup ("/bin/ash");
++ else if (access ("/bin/dash", X_OK) == 0)
++ sh_str = g_strdup ("/bin/dash");
++ else if (access ("/bin/busybox", X_OK) == 0)
++ sh_str = g_strdup ("/bin/busybox");
++ else if (access ("/bin/zsh", X_OK) == 0)
++ sh_str = g_strdup ("/bin/zsh");
++ else if (access ("/bin/tcsh", X_OK) == 0)
++ sh_str = g_strdup ("/bin/tcsh");
++ /* No fish as fallback because it is so much different from other shells and
++ * in a way exotic (even though user-friendly by name) that we should not
++ * present it as a subshell without the user's explicit intention. We rather
++ * will not use a subshell but just a command line.
++ * else if (access("/bin/fish", X_OK) == 0)
++ * mc_global.tty.shell = g_strdup ("/bin/fish");
++ */
++ else
++ /* Fallback and last resort: system default shell */
++ sh_str = g_strdup ("/bin/sh");
++
++ return sh_str;
++}
++
++/* --------------------------------------------------------------------------------------------- */
+
+ /** POSIX version. The only version we support. */
+ static void
+@@ -126,9 +167,11 @@ OS_Setup (void)
+ const char *shell_env;
+ const char *datadir_env;
+
++
+ shell_env = getenv ("SHELL");
+ if ((shell_env == NULL) || (shell_env[0] == '\0'))
+ {
++ /* 2nd choice: user login shell */
+ struct passwd *pwd;
+
+ pwd = getpwuid (geteuid ());
+@@ -136,13 +179,15 @@ OS_Setup (void)
+ mc_global.tty.shell = g_strdup (pwd->pw_shell);
+ }
+ else
++ /* 1st choice: SHELL environment variable */
+ mc_global.tty.shell = g_strdup (shell_env);
+
+ if ((mc_global.tty.shell == NULL) || (mc_global.tty.shell[0] == '\0'))
+ {
+ g_free (mc_global.tty.shell);
+- mc_global.tty.shell = g_strdup ("/bin/sh");
++ mc_global.tty.shell = mc_get_system_shell ();
+ }
++ mc_global.tty.shell_realpath = mc_realpath (mc_global.tty.shell, rp_shell);
+
+ /* This is the directory, where MC was installed, on Unix this is DATADIR */
+ /* and can be overriden by the MC_DATADIR environment variable */
+--- a/src/subshell.c
++++ b/src/subshell.c
+@@ -114,6 +114,8 @@ enum
+ static enum
+ {
+ BASH,
++ ASH_BUSYBOX, /* BusyBox default shell (ash) */
++ DASH, /* Debian variant of ash */
+ TCSH,
+ ZSH,
+ FISH
+@@ -209,6 +211,7 @@ static void
+ init_subshell_child (const char *pty_name)
+ {
+ char *init_file = NULL;
++ char *putenv_str = NULL;
+ pid_t mc_sid;
+
+ (void) pty_name;
+@@ -257,32 +260,53 @@ init_subshell_child (const char *pty_nam
+ switch (subshell_type)
+ {
+ case BASH:
++ /* Do we have a custom init file ~/.local/share/mc/bashrc? */
+ init_file = mc_config_get_full_path ("bashrc");
+
++ /* Otherwise use ~/.bashrc */
+ if (access (init_file, R_OK) == -1)
+ {
+ g_free (init_file);
+ init_file = g_strdup (".bashrc");
+ }
+
+- /* Make MC's special commands not show up in bash's history */
+- putenv ((char *) "HISTCONTROL=ignorespace");
++ /* Make MC's special commands not show up in bash's history and also suppress
++ * consecutive identical commands*/
++ putenv ((char *) "HISTCONTROL=ignoreboth");
+
+ /* Allow alternative readline settings for MC */
+ {
+ char *input_file = mc_config_get_full_path ("inputrc");
+ if (access (input_file, R_OK) == 0)
+ {
+- char *putenv_str = g_strconcat ("INPUTRC=", input_file, NULL);
++ putenv_str = g_strconcat ("INPUTRC=", input_file, NULL);
+ putenv (putenv_str);
+- g_free (putenv_str);
+ }
+ g_free (input_file);
+ }
+
+ break;
+
+- /* TODO: Find a way to pass initfile to TCSH and ZSH */
++ case ASH_BUSYBOX:
++ case DASH:
++ /* Do we have a custom init file ~/.local/share/mc/ashrc? */
++ init_file = mc_config_get_full_path ("ashrc");
++
++ /* Otherwise use ~/.profile */
++ if (access (init_file, R_OK) == -1)
++ {
++ g_free (init_file);
++ init_file = g_strdup (".profile");
++ }
++
++ /* Put init file to ENV variable used by ash */
++ putenv_str = g_strconcat ("ENV=", init_file, NULL);
++ putenv (putenv_str);
++ /* Do not use "g_free (putenv_str)" here, otherwise ENV will be undefined! */
++
++ break;
++
++ /* TODO: Find a way to pass initfile to TCSH, ZSH and FISH */
+ case TCSH:
+ case ZSH:
+ case FISH:
+@@ -320,10 +344,6 @@ init_subshell_child (const char *pty_nam
+ execl (mc_global.tty.shell, "bash", "-rcfile", init_file, (char *) NULL);
+ break;
+
+- case TCSH:
+- execl (mc_global.tty.shell, "tcsh", (char *) NULL);
+- break;
+-
+ case ZSH:
+ /* Use -g to exclude cmds beginning with space from history
+ * and -Z to use the line editor on non-interactive term */
+@@ -331,8 +351,11 @@ init_subshell_child (const char *pty_nam
+
+ break;
+
++ case ASH_BUSYBOX:
++ case DASH:
++ case TCSH:
+ case FISH:
+- execl (mc_global.tty.shell, "fish", (char *) NULL);
++ execl (mc_global.tty.shell, mc_global.tty.shell, (char *) NULL);
+ break;
+
+ default:
+@@ -341,6 +364,7 @@ init_subshell_child (const char *pty_nam
+
+ /* If we get this far, everything failed miserably */
+ g_free (init_file);
++ g_free (putenv_str);
+ my_exit (FORK_FAILURE);
+ }
+
+@@ -742,6 +766,171 @@ pty_open_slave (const char *pty_name)
+ }
+ #endif /* !HAVE_GRANTPT */
+
++
++/* --------------------------------------------------------------------------------------------- */
++/**
++ * Get a subshell type and store in subshell_type variable
++ *
++ * @return TRUE if subtype was gotten, FALSE otherwise
++ */
++
++static gboolean
++init_subshell_type (void)
++{
++ gboolean result = TRUE;
++
++ /* Find out what type of shell we have. Also consider real paths (resolved symlinks)
++ * because e.g. csh might point to tcsh, ash to dash or busybox, sh to anything. */
++
++ if (strstr (mc_global.tty.shell, "/zsh") || strstr (mc_global.tty.shell_realpath, "/zsh")
++ || getenv ("ZSH_VERSION"))
++ /* Also detects ksh symlinked to zsh */
++ subshell_type = ZSH;
++ else if (strstr (mc_global.tty.shell, "/tcsh")
++ || strstr (mc_global.tty.shell_realpath, "/tcsh"))
++ /* Also detects csh symlinked to tcsh */
++ subshell_type = TCSH;
++ else if (strstr (mc_global.tty.shell, "/fish")
++ || strstr (mc_global.tty.shell_realpath, "/fish"))
++ subshell_type = FISH;
++ else if (strstr (mc_global.tty.shell, "/dash")
++ || strstr (mc_global.tty.shell_realpath, "/dash"))
++ /* Debian ash (also found if symlinked to by ash/sh) */
++ subshell_type = DASH;
++ else if (strstr (mc_global.tty.shell_realpath, "/busybox"))
++ {
++ /* If shell is symlinked to busybox, assume it is an ash, even though theoretically
++ * it could also be a hush (a mini shell for non-MMU systems deactivated by default).
++ * For simplicity's sake we assume that busybox always contains an ash, not a hush.
++ * On embedded platforms or on server systems, /bin/sh often points to busybox.
++ * Sometimes even bash is symlinked to busybox (CONFIG_FEATURE_BASH_IS_ASH option),
++ * so we need to check busybox symlinks *before* checking for the name "bash"
++ * in order to avoid that case. */
++ subshell_type = ASH_BUSYBOX;
++ }
++ else if (strstr (mc_global.tty.shell, "/bash") || getenv ("BASH"))
++ /* If bash is not symlinked to busybox, it is safe to assume it is a real bash */
++ subshell_type = BASH;
++ else
++ {
++ mc_global.tty.use_subshell = FALSE;
++ result = FALSE;
++ }
++ return result;
++}
++
++/* --------------------------------------------------------------------------------------------- */
++/**
++ * Set up `precmd' or equivalent for reading the subshell's CWD.
++ *
++ * Attention! Never forget that these are *one-liners* even though the concatenated
++ * substrings contain line breaks and indentation for better understanding of the
++ * shell code. It is vital that each one-liner ends with a line feed character ("\n" ).
++ *
++ * @return initialized pre-command string
++ */
++
++static void
++init_subshell_precmd (char *precmd, size_t buff_size)
++{
++
++ switch (subshell_type)
++ {
++ case BASH:
++ g_snprintf (precmd, buff_size,
++ " PROMPT_COMMAND='pwd>&%d; kill -STOP $$';\n", subshell_pipe[WRITE]);
++ break;
++
++ case ASH_BUSYBOX:
++ /* BusyBox ash needs a somewhat complicated precmd emulation via PS1, and it is vital
++ * that BB be built with active CONFIG_ASH_EXPAND_PRMT, but this is the default anyway.
++ *
++ * A: This leads to a stopped subshell (=frozen mc) if user calls "ash" command
++ * "PS1='$(pwd>&%d; kill -STOP $$)\\u@\\h:\\w\\$ '\n",
++ *
++ * B: This leads to "sh: precmd: not found" in sub-subshell if user calls "ash" command
++ * "precmd() { pwd>&%d; kill -STOP $$; }; "
++ * "PS1='$(precmd)\\u@\\h:\\w\\$ '\n",
++ *
++ * C: This works if user calls "ash" command because in sub-subshell
++ * PRECMD is unfedined, thus evaluated to empty string - no damage done.
++ * Attention: BusyBox must be built with FEATURE_EDITING_FANCY_PROMPT to
++ * permit \u, \w, \h, \$ escape sequences. Unfortunately this cannot be guaranteed,
++ * especially on embedded systems where people try to save space, so let's use
++ * the dash version below. It should work on virtually all systems.
++ * "precmd() { pwd>&%d; kill -STOP $$; }; "
++ * "PRECMD=precmd; "
++ * "PS1='$(eval $PRECMD)\\u@\\h:\\w\\$ '\n",
++ */
++ case DASH:
++ /* Debian ash needs a precmd emulation via PS1, similar to BusyBox ash,
++ * but does not support escape sequences for user, host and cwd in prompt.
++ * Attention! Make sure that the buffer for precmd is big enough.
++ *
++ * We want to have a fancy dynamic prompt with user@host:cwd just like in the BusyBox
++ * examples above, but because replacing the home directory part of the path by "~" is
++ * complicated, it bloats the precmd to a size > BUF_SMALL (128).
++ *
++ * The following example is a little less fancy (home directory not replaced)
++ * and shows the basic workings of our prompt for easier understanding:
++ *
++ * "precmd() { "
++ * "echo \"$USER@$(hostname -s):$PWD\"; "
++ * "pwd>&%d; "
++ * "kill -STOP $$; "
++ * "}; "
++ * "PRECMD=precmd; "
++ * "PS1='$($PRECMD)$ '\n",
++ */
++ g_snprintf (precmd, buff_size,
++ "precmd() { "
++ "if [ ! \"${PWD##$HOME}\" ]; then "
++ "MC_PWD=\"~\"; "
++ "else "
++ "[ \"${PWD##$HOME/}\" = \"$PWD\" ] && MC_PWD=\"$PWD\" || MC_PWD=\"~/${PWD##$HOME/}\"; "
++ "fi; "
++ "echo \"$USER@openwrt:$MC_PWD\"; "
++ "pwd>&%d; "
++ "kill -STOP $$; "
++ "}; " "PRECMD=precmd; " "PS1='$($PRECMD)$ '\n", subshell_pipe[WRITE]);
++ break;
++
++ case ZSH:
++ g_snprintf (precmd, buff_size,
++ " precmd() { pwd>&%d; kill -STOP $$; }; "
++ "PS1='%%n@%%m:%%~%%# '\n", subshell_pipe[WRITE]);
++ break;
++
++ case TCSH:
++ g_snprintf (precmd, buff_size,
++ "set echo_style=both; "
++ "set prompt='%%n@%%m:%%~%%# '; "
++ "alias precmd 'echo $cwd:q >>%s; kill -STOP $$'\n", tcsh_fifo);
++ break;
++
++ case FISH:
++ /* We also want a fancy user@host:cwd prompt here, but fish makes it very easy to also
++ * use colours, which is what we will do. But first here is a simpler, uncoloured version:
++ * "function fish_prompt; "
++ * "echo (whoami)@(hostname -s):(pwd)\\$\\ ; "
++ * "echo \"$PWD\">&%d; "
++ * "kill -STOP %%self; "
++ * "end\n",
++ *
++ * TODO: fish prompt is shown when panel is hidden (Ctrl-O), but not when it is visible.
++ * Find out how to fix this.
++ */
++ g_snprintf (precmd, buff_size,
++ "function fish_prompt; "
++ "echo (whoami)@(hostname -s):(set_color $fish_color_cwd)(pwd)(set_color normal)\\$\\ ; "
++ "echo \"$PWD\">&%d; " "kill -STOP %%self; " "end\n", subshell_pipe[WRITE]);
++ break;
++
++ default:
++ break;
++ }
++}
++
+ /* --------------------------------------------------------------------------------------------- */
+ /*** public functions ****************************************************************************/
+ /* --------------------------------------------------------------------------------------------- */
+@@ -761,6 +950,7 @@ init_subshell (void)
+ {
+ /* This must be remembered across calls to init_subshell() */
+ static char pty_name[BUF_SMALL];
++ /* Must be considerably longer than BUF_SMALL (128) to support fancy shell prompts */
+ char precmd[BUF_MEDIUM];
+
+ switch (check_sid ())
+@@ -782,23 +972,8 @@ init_subshell (void)
+
+ if (mc_global.tty.subshell_pty == 0)
+ { /* First time through */
+- /* Find out what type of shell we have */
+-
+- if (strstr (mc_global.tty.shell, "/zsh") || getenv ("ZSH_VERSION"))
+- subshell_type = ZSH;
+- else if (strstr (mc_global.tty.shell, "/tcsh"))
+- subshell_type = TCSH;
+- else if (strstr (mc_global.tty.shell, "/csh"))
+- subshell_type = TCSH;
+- else if (strstr (mc_global.tty.shell, "/bash") || getenv ("BASH"))
+- subshell_type = BASH;
+- else if (strstr (mc_global.tty.shell, "/fish"))
+- subshell_type = FISH;
+- else
+- {
+- mc_global.tty.use_subshell = FALSE;
++ if (!init_subshell_type ())
+ return;
+- }
+
+ /* Open a pty for talking to the subshell */
+
+@@ -844,7 +1019,7 @@ init_subshell (void)
+ return;
+ }
+ }
+- else /* subshell_type is BASH or ZSH */ if (pipe (subshell_pipe))
++ else if (pipe (subshell_pipe)) /* subshell_type is BASH, ASH_BUSYBOX, DASH or ZSH */
+ {
+ perror (__FILE__ ": couldn't create pipe");
+ mc_global.tty.use_subshell = FALSE;
+@@ -872,39 +1047,116 @@ init_subshell (void)
+ init_subshell_child (pty_name);
+ }
+
+- /* Set up 'precmd' or equivalent for reading the subshell's CWD */
++ init_subshell_precmd (precmd, BUF_MEDIUM);
++
++ /* Set up `precmd' or equivalent for reading the subshell's CWD
++ *
++ * Attention! Never forget that these are *one-liners* even though the concatenated
++ * substrings contain line breaks and indentation for better understanding of the
++ * shell code. It is vital that each one-liner ends with a line feed character ("\n" ).
++ */
+
+ switch (subshell_type)
+ {
+ case BASH:
+ g_snprintf (precmd, sizeof (precmd),
+- " PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND\n}'pwd>&%d;kill -STOP $$'\n",
+- subshell_pipe[WRITE]);
++ " PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND\n}'pwd>&%d;kill -STOP $$'\n"
++ "PS1='\\u@\\h:\\w\\$ '\n", subshell_pipe[WRITE]);
++ break;
++
++ case ASH_BUSYBOX:
++ /* BusyBox ash needs a somewhat complicated precmd emulation via PS1, and it is vital
++ * that BB be built with active CONFIG_ASH_EXPAND_PRMT, but this is the default anyway.
++ *
++ * A: This leads to a stopped subshell (=frozen mc) if user calls "ash" command
++ * "PS1='$(pwd>&%d; kill -STOP $$)\\u@\\h:\\w\\$ '\n",
++ *
++ * B: This leads to "sh: precmd: not found" in sub-subshell if user calls "ash" command
++ * "precmd() { pwd>&%d; kill -STOP $$; }; "
++ * "PS1='$(precmd)\\u@\\h:\\w\\$ '\n",
++ *
++ * C: This works if user calls "ash" command because in sub-subshell
++ * PRECMD is unfedined, thus evaluated to empty string - no damage done.
++ * Attention: BusyBox must be built with FEATURE_EDITING_FANCY_PROMPT to
++ * permit \u, \w, \h, \$ escape sequences. Unfortunately this cannot be guaranteed,
++ * especially on embedded systems where people try to save space, so let's use
++ * the dash version below. It should work on virtually all systems.
++ * "precmd() { pwd>&%d; kill -STOP $$; }; "
++ * "PRECMD=precmd; "
++ * "PS1='$(eval $PRECMD)\\u@\\h:\\w\\$ '\n",
++ */
++ case DASH:
++ /* Debian ash needs a precmd emulation via PS1, similar to BusyBox ash,
++ * but does not support escape sequences for user, host and cwd in prompt.
++ * Attention! Make sure that the buffer for precmd is big enough.
++ *
++ * We want to have a fancy dynamic prompt with user@host:cwd just like in the BusyBox
++ * examples above, but because replacing the home directory part of the path by "~" is
++ * complicated, it bloats the precmd to a size > BUF_SMALL (128).
++ *
++ * The following example is a little less fancy (home directory not replaced)
++ * and shows the basic workings of our prompt for easier understanding:
++ *
++ * "precmd() { "
++ * "echo \"$USER@$(hostname -s):$PWD\"; "
++ * "pwd>&%d; "
++ * "kill -STOP $$; "
++ * "}; "
++ * "PRECMD=precmd; "
++ * "PS1='$($PRECMD)$ '\n",
++ */
++ g_snprintf (precmd, sizeof (precmd),
++ "precmd() { "
++ "if [ ! \"${PWD##$HOME}\" ]; then "
++ "MC_PWD=\"~\"; "
++ "else "
++ "[ \"${PWD##$HOME/}\" = \"$PWD\" ] && MC_PWD=\"$PWD\" || MC_PWD=\"~/${PWD##$HOME/}\"; "
++ "fi; "
++ "echo \"$USER@openwrt:$MC_PWD\"; "
++ "pwd>&%d; "
++ "kill -STOP $$; "
++ "}; " "PRECMD=precmd; " "PS1='$($PRECMD)$ '\n", subshell_pipe[WRITE]);
+ break;
+
+ case ZSH:
+ g_snprintf (precmd, sizeof (precmd),
+- " _mc_precmd(){ pwd>&%d;kill -STOP $$ }; precmd_functions+=(_mc_precmd)\n",
+- subshell_pipe[WRITE]);
++ " _mc_precmd(){ pwd>&%d;kill -STOP $$ }; precmd_functions+=(_mc_precmd)\n"
++ "PS1='%%n@%%m:%%~%%# '\n", subshell_pipe[WRITE]);
+ break;
+
+ case TCSH:
+ g_snprintf (precmd, sizeof (precmd),
+- "set echo_style=both;"
+- "alias precmd 'echo $cwd:q >>%s;kill -STOP $$'\n", tcsh_fifo);
++ "set echo_style=both; "
++ "set prompt='%%n@%%m:%%~%%# '; "
++ "alias precmd 'echo $cwd:q >>%s; kill -STOP $$'\n", tcsh_fifo);
+ break;
++
+ case FISH:
+ /* Use fish_prompt_mc function for prompt, if not present then copy fish_prompt to it. */
++ /* We also want a fancy user@host:cwd prompt here, but fish makes it very easy to also
++ * use colours, which is what we will do. But first here is a simpler, uncoloured version:
++ * "function fish_prompt; "
++ * "echo (whoami)@(hostname -s):(pwd)\\$\\ ; "
++ * "echo \"$PWD\">&%d; "
++ * "kill -STOP %%self; "
++ * "end\n",
++ *
++ * TODO: fish prompt is shown when panel is hidden (Ctrl-O), but not when it is visible.
++ * Find out how to fix this.
++ */
+ g_snprintf (precmd, sizeof (precmd),
+ "if not functions -q fish_prompt_mc;"
+ "functions -c fish_prompt fish_prompt_mc; end;"
+- "function fish_prompt; echo $PWD>&%d; fish_prompt_mc; kill -STOP %%self; end\n",
++ "function fish_prompt;"
++ "echo (whoami)@(hostname -s):(set_color $fish_color_cwd)(pwd)(set_color normal)\\$\\ ; "
++ "echo \"$PWD\">&%d; fish_prompt_mc; kill -STOP %%self; end\n",
+ subshell_pipe[WRITE]);
+ break;
+
+ default:
+ break;
+ }
++
+ write_all (mc_global.tty.subshell_pty, precmd, strlen (precmd));
+
+ /* Wait until the subshell has started up and processed the command */
+@@ -1108,6 +1360,13 @@ subshell_name_quote (const char *s)
+ quote_cmd_start = "(printf \"%b\" '";
+ quote_cmd_end = "')";
+ }
++ /* TODO: When BusyBox printf is fixed, get rid of this "else if", see
++ http://lists.busybox.net/pipermail/busybox/2012-March/077460.html */
++ /* else if (subshell_type == ASH_BUSYBOX)
++ {
++ quote_cmd_start = "\"`echo -en '";
++ quote_cmd_end = "'`\"";
++ } */
+ else
+ {
+ quote_cmd_start = "\"`printf \"%b\" '";
--- /dev/null
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mt-st
+PKG_VERSION:=1.1
+PKG_RELEASE:=1
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_URL:=http://ftp.ibiblio.org/pub/Linux/system/backup/
+PKG_MD5SUM:=fdd5f5ec673c9f630a102ceff7612774
+
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mt-st
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Magnetic tape control tools for Linux SCSI tapes
+ URL:=http://ftp.ibiblio.org/pub/Linux/system/backup/
+ MAINTAINER:=Giuseppe Magnotta <giuseppe.magnotta@gmail.com>
+endef
+
+define Package/mt-st/description
+ Includes a mt-like program supporting additional commands using ioctls
+ specific to the Linux SCSI tape driver (up to kernel 2.6.26), and the program
+ stinit to define the SCSI tape devices in system startup scripts.
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+ CC="$(TARGET_CC)"
+endef
+
+define Package/mt-st/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/mt $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/stinit $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,mt-st))