summaryrefslogtreecommitdiff
path: root/meta/recipes-extended
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/blktool/blktool_4-6.bb14
-rw-r--r--meta/recipes-extended/bzip2/bzip2-1.0.5/Makefile.am41
-rw-r--r--meta/recipes-extended/bzip2/bzip2-1.0.5/configure.ac14
-rw-r--r--meta/recipes-extended/bzip2/bzip2_1.0.5.bb41
-rw-r--r--meta/recipes-extended/devicekit/devicekit-power_014.bb21
-rw-r--r--meta/recipes-extended/devicekit/devicekit/volatile1
-rw-r--r--meta/recipes-extended/devicekit/devicekit_003.bb16
-rw-r--r--meta/recipes-extended/devicekit/devicekit_git.bb35
-rw-r--r--meta/recipes-extended/diffutils/diffutils_2.8.1.bb38
-rw-r--r--meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch54
-rw-r--r--meta/recipes-extended/findutils/findutils-4.4.2/01-27017.patch779
-rw-r--r--meta/recipes-extended/findutils/findutils-4.4.2/02-28824.patch292
-rw-r--r--meta/recipes-extended/findutils/findutils-4.4.2/03-28872.patch56
-rw-r--r--meta/recipes-extended/findutils/findutils.inc19
-rw-r--r--meta/recipes-extended/findutils/findutils_4.2.31.bb37
-rw-r--r--meta/recipes-extended/findutils/findutils_4.4.2.bb27
-rw-r--r--meta/recipes-extended/gperf/gperf.inc22
-rw-r--r--meta/recipes-extended/gperf/gperf_3.0.3.bb7
-rw-r--r--meta/recipes-extended/gperf/gperf_3.0.4.bb3
-rw-r--r--meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch53
-rw-r--r--meta/recipes-extended/grep/grep_2.5.1a.bb40
-rw-r--r--meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch45
-rw-r--r--meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch53
-rw-r--r--meta/recipes-extended/gzip/gzip.inc38
-rw-r--r--meta/recipes-extended/gzip/gzip_1.3.12.bb39
-rw-r--r--meta/recipes-extended/gzip/gzip_1.4.bb5
-rw-r--r--meta/recipes-extended/hdparm/hdparm-6.3/bswap.patch36
-rw-r--r--meta/recipes-extended/hdparm/hdparm-6.3/uclibc.patch32
-rw-r--r--meta/recipes-extended/hdparm/hdparm_6.3.bb14
-rw-r--r--meta/recipes-extended/libidn/libidn_0.6.14.bb26
-rw-r--r--meta/recipes-extended/libidn/libidn_1.19.bb20
-rw-r--r--meta/recipes-extended/lsof/lsof_4.83.bb41
-rw-r--r--meta/recipes-extended/pam/libpam-1.1.1/99_pam1
-rw-r--r--meta/recipes-extended/pam/libpam-1.1.1/disable_crossbinary.patch34
-rw-r--r--meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-account25
-rw-r--r--meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-auth18
-rw-r--r--meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-password26
-rw-r--r--meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-session19
-rw-r--r--meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-session-noninteractive19
-rw-r--r--meta/recipes-extended/pam/libpam-1.1.1/pam.d/other27
-rw-r--r--meta/recipes-extended/pam/libpam_1.1.1.bb73
-rw-r--r--meta/recipes-extended/parted/parted-1.9.0/no_check.patch18
-rw-r--r--meta/recipes-extended/parted/parted-1.9.0/syscalls.patch53
-rw-r--r--meta/recipes-extended/parted/parted_1.9.0.bb16
-rw-r--r--meta/recipes-extended/polkit/polkit-gnome_0.96.bb18
-rw-r--r--meta/recipes-extended/polkit/polkit_0.96.bb14
-rw-r--r--meta/recipes-extended/psmisc/files/libintl-link.patch29
-rw-r--r--meta/recipes-extended/psmisc/psmisc.inc55
-rw-r--r--meta/recipes-extended/psmisc/psmisc_22.2.bb2
-rw-r--r--meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch16
-rw-r--r--meta/recipes-extended/sed/sed_4.1.2.bb32
-rw-r--r--meta/recipes-extended/sudo/files/autofoo.patch143
-rw-r--r--meta/recipes-extended/sudo/files/noexec-link.patch17
-rw-r--r--meta/recipes-extended/sudo/files/nostrip.patch23
-rw-r--r--meta/recipes-extended/sudo/site/bit-322
-rw-r--r--meta/recipes-extended/sudo/site/bit-642
-rw-r--r--meta/recipes-extended/sudo/sudo.inc36
-rw-r--r--meta/recipes-extended/sudo/sudo_1.7.2p7.bb7
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff75
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch248
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch103
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch30
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch1253
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch151
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch45
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch81
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch253
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch66
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch12
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch71
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch19
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch43
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch21
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch37
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff39
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.834
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch29
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch34
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch30
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/size_t.patch42
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch39
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.828
-rw-r--r--meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb117
-rw-r--r--meta/recipes-extended/tzcode/tzcode-native_2009r.bb17
-rw-r--r--meta/recipes-extended/tzdata/tzdata_2010j.bb160
-rw-r--r--meta/recipes-extended/unzip/unzip_6.0.bb25
-rw-r--r--meta/recipes-extended/watchdog/watchdog_5.9.bb16
-rw-r--r--meta/recipes-extended/zile/files/for_build.patch64
-rw-r--r--meta/recipes-extended/zile/zile_1.7+2.0beta6.bb19
-rw-r--r--meta/recipes-extended/zip/zip.inc24
-rw-r--r--meta/recipes-extended/zip/zip_3.0.bb6
91 files changed, 5915 insertions, 0 deletions
diff --git a/meta/recipes-extended/blktool/blktool_4-6.bb b/meta/recipes-extended/blktool/blktool_4-6.bb
new file mode 100644
index 0000000000..3313b039ce
--- /dev/null
+++ b/meta/recipes-extended/blktool/blktool_4-6.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "blktool is used for querying and/or changing settings of a block device. It is like hdparm but a more general tool, as it works on SCSI, IDE and SATA devices"
+HOMEPAGE = "http://packages.debian.org/unstable/admin/blktool"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://blktool.c;beginline=7;endline=8;md5=a5e798ea98fd50972088968a15e5f373"
+DEPENDS = "glib-2.0"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/b/blktool/blktool_4.orig.tar.gz \
+ ${DEBIAN_MIRROR}/main/b/blktool/blktool_4-6.diff.gz;apply=yes"
+
+PR = "r0"
+S = "${WORKDIR}/${PN}-4.orig"
+
+inherit autotools
diff --git a/meta/recipes-extended/bzip2/bzip2-1.0.5/Makefile.am b/meta/recipes-extended/bzip2/bzip2-1.0.5/Makefile.am
new file mode 100644
index 0000000000..070d57b243
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2-1.0.5/Makefile.am
@@ -0,0 +1,41 @@
+
+lib_LTLIBRARIES = libbz2.la
+
+libbz2_la_SOURCES = blocksort.c \
+ huffman.c \
+ crctable.c \
+ randtable.c \
+ compress.c \
+ decompress.c \
+ bzlib.c
+
+bin_PROGRAMS = bzip2 bzip2recover
+
+bzip2_SOURCES = bzip2.c
+bzip2_LDADD = libbz2.la
+bzip2_DEPENDENCIES = libbz2.la
+
+include_HEADERS = bzlib.h
+
+bzip2recover_SOURCES = bzip2recover.c
+bzip2recover_LDADD = libbz2.la
+bzip2recover_DEPENDENCIES = libbz2.la
+
+bin_SCRIPTS = bzgrep bzmore bzdiff
+
+man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1
+EXTRA_DIST = $(man_MANS)
+
+install-exec-hook:
+ ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT)
+ ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT)
+ ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT)
+ ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT)
+ ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT)
+ ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT)
+
+install-data-hook:
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1
+ echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1
+ echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1
diff --git a/meta/recipes-extended/bzip2/bzip2-1.0.5/configure.ac b/meta/recipes-extended/bzip2/bzip2-1.0.5/configure.ac
new file mode 100644
index 0000000000..14b1d1809d
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2-1.0.5/configure.ac
@@ -0,0 +1,14 @@
+AC_PREREQ([2.57])
+
+AC_INIT(bzip2, 2.0.5, , libXrender)
+AM_INIT_AUTOMAKE()
+AM_MAINTAINER_MODE
+
+#AM_CONFIG_HEADER(config.h)
+
+# Check for progs
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+AC_OUTPUT([Makefile])
+
diff --git a/meta/recipes-extended/bzip2/bzip2_1.0.5.bb b/meta/recipes-extended/bzip2/bzip2_1.0.5.bb
new file mode 100644
index 0000000000..c6339c0676
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2_1.0.5.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "Very high-quality data compression program."
+HOMEPAGE = "http://www.bzip.org/"
+SECTION = "console/utils"
+LICENSE = "bzip2"
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=8;endline=37;md5=40d9d1eb05736d1bfc86cfdd9106e6b2"
+PR = "r2"
+
+SRC_URI = "http://www.bzip.org/${PV}/${BPN}-${PV}.tar.gz \
+ file://configure.ac \
+ file://Makefile.am"
+
+CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64"
+
+inherit autotools
+
+do_configure_prepend () {
+ cp ${WORKDIR}/configure.ac ${S}/
+ cp ${WORKDIR}/Makefile.am ${S}/
+ cp ${STAGING_DATADIR_NATIVE}/automake*/install-sh ${S}/
+}
+
+do_install_append () {
+ if [ "${BUILD_ARCH}" != "${HOST_ARCH}" ]; then
+ mv ${D}${bindir}/bunzip2 ${D}${bindir}/bunzip2.${PN}
+ mv ${D}${bindir}/bzcat ${D}${bindir}/bzcat.${PN}
+ fi
+}
+
+pkg_postinst_${PN} () {
+ update-alternatives --install ${bindir}/bunzip2 bunzip2 bunzip2.${PN} 100
+ update-alternatives --install ${bindir}/bzcat bzcat bzcat.${PN} 100
+}
+
+
+pkg_prerm_${PN} () {
+ update-alternatives --remove bunzip2 bunzip2.${PN}
+ update-alternatives --remove bzcat bzcat.${PN}
+}
+
+PROVIDES_append_virtclass-native = " bzip2-full-native"
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/devicekit/devicekit-power_014.bb b/meta/recipes-extended/devicekit/devicekit-power_014.bb
new file mode 100644
index 0000000000..f69a060ef2
--- /dev/null
+++ b/meta/recipes-extended/devicekit/devicekit-power_014.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "Devicekit power"
+LICENSE = "GPLv2"
+DEPENDS = "devicekit glib-2.0 dbus-glib polkit"
+
+SRC_URI = "http://hal.freedesktop.org/releases/DeviceKit-power-${PV}.tar.gz"
+S = "${WORKDIR}/DeviceKit-power-${PV}"
+
+inherit autotools pkgconfig
+
+do_configure_prepend() {
+ sed -i -e s:-nonet:\:g ${S}/doc/man/Makefile.am
+}
+
+EXTRA_OECONF = "--with-backend=linux"
+
+FILES_${PN} += "${datadir}/dbus-1/ \
+ ${datadir}/PolicyKit \
+ ${base_libdir}/udev/* \
+ "
+
+FILES_${PN}-dbg += "${base_libdir}/udev/.debug"
diff --git a/meta/recipes-extended/devicekit/devicekit/volatile b/meta/recipes-extended/devicekit/devicekit/volatile
new file mode 100644
index 0000000000..1e399642e0
--- /dev/null
+++ b/meta/recipes-extended/devicekit/devicekit/volatile
@@ -0,0 +1 @@
+d root root 0700 /var/run/devkit none
diff --git a/meta/recipes-extended/devicekit/devicekit_003.bb b/meta/recipes-extended/devicekit/devicekit_003.bb
new file mode 100644
index 0000000000..af812935cd
--- /dev/null
+++ b/meta/recipes-extended/devicekit/devicekit_003.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "DeviceKit is a simple system service that a) can enumerate devices; b) emits signals when devices are added removed; c) provides a way to merge device information / quirks onto devices."
+LICENSE = "GPLv2"
+DEPENDS = "udev dbus-glib glib-2.0"
+
+PR = "r1"
+
+SRC_URI = "http://hal.freedesktop.org/releases/DeviceKit-${PV}.tar.gz"
+S = "${WORKDIR}/DeviceKit-${PV}"
+
+do_configure_prepend() {
+ sed -i -e s:-nonet:\:g ${S}/doc/man/Makefile.am
+}
+
+inherit autotools
+
+FILES_${PN} += "${datadir}/dbus-1/"
diff --git a/meta/recipes-extended/devicekit/devicekit_git.bb b/meta/recipes-extended/devicekit/devicekit_git.bb
new file mode 100644
index 0000000000..74b639f6c1
--- /dev/null
+++ b/meta/recipes-extended/devicekit/devicekit_git.bb
@@ -0,0 +1,35 @@
+LICENSE = "GPL"
+DEPENDS = "dbus-glib"
+
+SRC_URI = "git://anongit.freedesktop.org/DeviceKit/DeviceKit;protocol=git \
+ file://volatile"
+
+PV = "002+git${SRCREV}"
+PR = "r2"
+SRCREV = "014d168ba4bf40c9bae487bacff8bf2aa054b5f6"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "--disable-man-pages"
+
+inherit autotools pkgconfig
+
+do_install_append() {
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/volatile ${D}/etc/default/volatiles/devicekit
+}
+
+pkg_postinst_devicekit () {
+ # can't do this offline
+ if [ "x$D" != "x" ]; then
+ exit 1
+ fi
+
+ DBUSPID=`pidof dbus-daemon`
+
+ if [ "x$DBUSPID" != "x" ]; then
+ /etc/init.d/dbus-1 reload
+ fi
+}
+
+FILES_${PN} += "${datadir}/dbus-1/"
diff --git a/meta/recipes-extended/diffutils/diffutils_2.8.1.bb b/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
new file mode 100644
index 0000000000..86b46aafec
--- /dev/null
+++ b/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
@@ -0,0 +1,38 @@
+SECTION = "base"
+LICENSE = "GPL"
+DESCRIPTION = "Diffutils contains the GNU diff, diff3, \
+sdiff, and cmp utilities. These programs are usually \
+used for creating patch files."
+PR = "r3"
+
+SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.gz"
+
+inherit autotools update-alternatives gettext
+
+# diffutils assumes non-glibc compilation with uclibc and
+# this causes it to generate its own implementations of
+# standard functionality. regex.c actually breaks compilation
+# because it uses __mempcpy, there are other things (TBD:
+# see diffutils.mk in buildroot)
+EXTRA_OECONF_linux-uclibc = "--without-included-regex"
+
+do_install_append () {
+ mv ${D}${bindir}/diff ${D}${bindir}/diff.${PN}
+ mv ${D}${bindir}/cmp ${D}${bindir}/cmp.${PN}
+}
+
+ALTERNATIVE_NAME = "diff"
+ALTERNATIVE_PATH = "diff.${PN}"
+ALTERNATIVE_PRIORITY = "100"
+
+pkg_postinst_${PN} () {
+
+update-alternatives --install /usr/bin/cmp cmp cmp.diffutils 100
+
+}
+
+pkg_postrm_${PN} () {
+
+update-alternatives --remove cmp cmp.diffutils
+
+}
diff --git a/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch b/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
new file mode 100644
index 0000000000..2bc54e9290
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
@@ -0,0 +1,54 @@
+the old AC_USE_SYSTEM_EXTENSIONS won't work with AC_GNU_SOURCE
+
+against 4.2.31
+07/08/2010 - qhe
+
+diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4
+index 143a9e5..0f27ceb 100644
+--- a/gnulib/m4/extensions.m4
++++ b/gnulib/m4/extensions.m4
+@@ -12,44 +12,6 @@
+ # enough in this area it's likely we'll need to redefine
+ # AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+- AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+- AC_REQUIRE([AC_GNU_SOURCE])
+- AC_REQUIRE([AC_AIX])
+- AC_REQUIRE([AC_MINIX])
+-
+- AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris. */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+- [ac_cv_safe_to_define___extensions__],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+-# define __EXTENSIONS__ 1
+- AC_INCLUDES_DEFAULT])],
+- [ac_cv_safe_to_define___extensions__=yes],
+- [ac_cv_safe_to_define___extensions__=no])])
+- test $ac_cv_safe_to_define___extensions__ = yes &&
+- AC_DEFINE([__EXTENSIONS__])
+- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+- AC_DEFINE([_TANDEM_SOURCE])
+-])
+-
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
diff --git a/meta/recipes-extended/findutils/findutils-4.4.2/01-27017.patch b/meta/recipes-extended/findutils/findutils-4.4.2/01-27017.patch
new file mode 100644
index 0000000000..b61f67b12d
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.4.2/01-27017.patch
@@ -0,0 +1,779 @@
+commit af974034b68bf59337c7a384e488a518a77dfecd
+Author: James Youngman <jay@gnu.org>
+Date: Sat Jul 11 19:55:27 2009 +0100
+
+ Fix Savannah bug #27017: find -D opt / -fstype ext3 -print , -quit coredump.
+
+ Fix Savannah bug #27017: find -D opt / -fstype ext3 -print , -quit
+ coredumps.
+ * find/tree.c (set_new_parent): Initialise struct
+ predicate->arg_text to NULL (instead of leaving it uninitialised).
+ (get_new_pred_noarg): Likewise.
+ (get_new_pred): Initialise predicate->arg_text to
+ "ThisShouldBeSetToSomethingElse" to make it easier to notice
+ bugs.
+ (get_new_pred_chk_op): Use get_new_pred_noarg.
+ (print_predicate): Use an if statement instead of
+ two ternary operators.
+ * find/util.c (insert_primary_withpred): Accept new argument, arg,
+ being the argument (if any) of this predicate. Pass it to
+ get_new_pred_chk_op.
+ (insert_primary): Likewise (pass arg to insert_primary_withpred).
+ (insert_primary_noarg): New function; calls insert_primary with
+ arg=NULL.
+ * find/parser.c (collect_arg_stat_info): Add an output parameter;
+ the filename from which we collected the stat information.
+ (parse_closeparen, parse_delete, parse_and, parse_or,
+ parse_comma): Use get_new_pred_noarg.
+ (parse_cnewer, parse_newer, parse_anewer): Use new
+ collect_arg_stat_info and insert_primary interface.
+ (parse_print, parse_prune, parse_nouser, parse_empty): Use
+ insert_primary_noarg.
+ (parse_accesscheck, parse_false): Use insert_primary_noarg.
+ (parse_used, parse_iname, parse_fprint, insert_fprint,
+ parse_fstype, parse_ilname): Use new collect_arg and
+ insert_primary interfaces.
+ (parse_ipath, parse_lname, do_parse_xmin, parse_name, parse_path,
+ parse_perm, parse_size, parse_user, parse_time): Use new
+ collect_arg and insert_primary_withpred interface.
+ (parse_negate, parse_openparen): Use new get_new_pred_chk_op interface.
+ (parse_newerXY, parse_nogroup): Use new insert_primary interface.
+ (insert_regex, parse_samefile): Use new insert_primary_withpred
+ interface.
+ (insert_type, insert_fprintf, new_insert_exec_ok, insert_num): Use
+ new insert_primary_withpred interface.
+ * find/defs.h (struct predicate.arg_text): make const.
+ Add declarations for new function get_new_pred_noarg and
+ insert_primary_noarg. Add 'arg' parameter to get_new_pred_chk_op
+ and insert_primary_withpred.
+
+diff --git a/ChangeLog b/ChangeLog
+index 6e346b8..e8ba0f8 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,0 +1,45 @@
++2009-07-11 James Youngman <jay@gnu.org>
++
++ Fix Savannah bug #27017: find -D opt / -fstype ext3 -print , -quit
++ coredumps.
++ * find/tree.c (set_new_parent): Initialise struct
++ predicate->arg_text to NULL (instead of leaving it uninitialised).
++ (get_new_pred_noarg): Likewise.
++ (get_new_pred): Initialise predicate->arg_text to
++ "ThisShouldBeSetToSomethingElse" to make it easier to notice
++ bugs.
++ (get_new_pred_chk_op): Use get_new_pred_noarg.
++ (print_predicate): Use an if statement instead of
++ two ternary operators.
++ * find/util.c (insert_primary_withpred): Accept new argument, arg,
++ being the argument (if any) of this predicate. Pass it to
++ get_new_pred_chk_op.
++ (insert_primary): Likewise (pass arg to insert_primary_withpred).
++ (insert_primary_noarg): New function; calls insert_primary with
++ arg=NULL.
++ * find/parser.c (collect_arg_stat_info): Add an output parameter;
++ the filename from which we collected the stat information.
++ (parse_closeparen, parse_delete, parse_and, parse_or,
++ parse_comma): Use get_new_pred_noarg.
++ (parse_cnewer, parse_newer, parse_anewer): Use new
++ collect_arg_stat_info and insert_primary interface.
++ (parse_print, parse_prune, parse_nouser, parse_empty): Use
++ insert_primary_noarg.
++ (parse_accesscheck, parse_false): Use insert_primary_noarg.
++ (parse_used, parse_iname, parse_fprint, insert_fprint,
++ parse_fstype, parse_ilname): Use new collect_arg and
++ insert_primary interfaces.
++ (parse_ipath, parse_lname, do_parse_xmin, parse_name, parse_path,
++ parse_perm, parse_size, parse_user, parse_time): Use new
++ collect_arg and insert_primary_withpred interface.
++ (parse_negate, parse_openparen): Use new get_new_pred_chk_op interface.
++ (parse_newerXY, parse_nogroup): Use new insert_primary interface.
++ (insert_regex, parse_samefile): Use new insert_primary_withpred
++ interface.
++ (insert_type, insert_fprintf, new_insert_exec_ok, insert_num): Use
++ new insert_primary_withpred interface.
++ * find/defs.h (struct predicate.arg_text): make const.
++ Add declarations for new function get_new_pred_noarg and
++ insert_primary_noarg. Add 'arg' parameter to get_new_pred_chk_op
++ and insert_primary_withpred.
++
+diff --git a/find/defs.h b/find/defs.h
+index 1708d83..4539fd9 100644
+--- a/find/defs.h
++++ b/find/defs.h
+@@ -297,7 +297,7 @@ struct predicate
+ boolean artificial;
+
+ /* The raw text of the argument of this predicate. */
+- char *arg_text;
++ const char *arg_text;
+
+ /* Information needed by the predicate processor.
+ Next to each member are listed the predicates that use it. */
+@@ -480,13 +480,16 @@ void show_success_rates(const struct predicate *node);
+ /* tree.c */
+ struct predicate * build_expression_tree PARAMS((int argc, char *argv[], int end_of_leading_options));
+ struct predicate * get_eval_tree PARAMS((void));
++struct predicate *get_new_pred_noarg (const struct parser_table *entry);
+ struct predicate *get_new_pred PARAMS((const struct parser_table *entry));
+-struct predicate *get_new_pred_chk_op PARAMS((const struct parser_table *entry));
++struct predicate *get_new_pred_chk_op PARAMS((const struct parser_table *entry,
++ const char *arg));
+ float calculate_derived_rates PARAMS((struct predicate *p));
+
+ /* util.c */
+-struct predicate *insert_primary PARAMS((const struct parser_table *entry));
+-struct predicate *insert_primary_withpred PARAMS((const struct parser_table *entry, PRED_FUNC fptr));
++struct predicate *insert_primary PARAMS((const struct parser_table *entry, const char *arg));
++struct predicate *insert_primary_noarg PARAMS((const struct parser_table *entry));
++struct predicate *insert_primary_withpred PARAMS((const struct parser_table *entry, PRED_FUNC fptr, const char *arg));
+ void usage PARAMS((FILE *fp, int status, char *msg));
+ extern boolean check_nofollow(void);
+ void complete_pending_execs(struct predicate *p);
+diff --git a/find/parser.c b/find/parser.c
+index 534b670..2e6b989 100644
+--- a/find/parser.c
++++ b/find/parser.c
+@@ -640,11 +640,13 @@ collect_arg(char **argv, int *arg_ptr, const char **collected_arg)
+ }
+
+ static boolean
+-collect_arg_stat_info(char **argv, int *arg_ptr, struct stat *p)
++collect_arg_stat_info(char **argv, int *arg_ptr, struct stat *p,
++ const char **argument)
+ {
+ const char *filename;
+ if (collect_arg(argv, arg_ptr, &filename))
+ {
++ *argument = filename;
+ if (0 == (options.xstat)(filename, p))
+ {
+ return true;
+@@ -656,6 +658,7 @@ collect_arg_stat_info(char **argv, int *arg_ptr, struct stat *p)
+ }
+ else
+ {
++ *argument = NULL;
+ return false;
+ }
+ }
+@@ -679,7 +682,7 @@ parse_and (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = get_new_pred (entry);
++ our_pred = get_new_pred_noarg (entry);
+ our_pred->pred_func = pred_and;
+ our_pred->p_type = BI_OP;
+ our_pred->p_prec = AND_PREC;
+@@ -691,11 +694,12 @@ static boolean
+ parse_anewer (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ struct stat stat_newer;
++ const char *arg;
+
+ set_stat_placeholders(&stat_newer);
+- if (collect_arg_stat_info(argv, arg_ptr, &stat_newer))
++ if (collect_arg_stat_info(argv, arg_ptr, &stat_newer, &arg))
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, arg);
+ our_pred->args.reftime.xval = XVAL_ATIME;
+ our_pred->args.reftime.ts = get_stat_mtime(&stat_newer);
+ our_pred->args.reftime.kind = COMP_GT;
+@@ -713,7 +717,7 @@ parse_closeparen (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = get_new_pred (entry);
++ our_pred = get_new_pred_noarg (entry);
+ our_pred->pred_func = pred_closeparen;
+ our_pred->p_type = CLOSE_PAREN;
+ our_pred->p_prec = NO_PREC;
+@@ -725,11 +729,12 @@ static boolean
+ parse_cnewer (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ struct stat stat_newer;
++ const char *arg;
+
+ set_stat_placeholders(&stat_newer);
+- if (collect_arg_stat_info(argv, arg_ptr, &stat_newer))
++ if (collect_arg_stat_info(argv, arg_ptr, &stat_newer, &arg))
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, arg);
+ our_pred->args.reftime.xval = XVAL_CTIME; /* like -newercm */
+ our_pred->args.reftime.ts = get_stat_mtime(&stat_newer);
+ our_pred->args.reftime.kind = COMP_GT;
+@@ -747,7 +752,7 @@ parse_comma (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = get_new_pred (entry);
++ our_pred = get_new_pred_noarg (entry);
+ our_pred->pred_func = pred_comma;
+ our_pred->p_type = BI_OP;
+ our_pred->p_prec = COMMA_PREC;
+@@ -786,7 +791,7 @@ parse_delete (const struct parser_table* entry, char *argv[], int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary_noarg (entry);
+ our_pred->side_effects = our_pred->no_default_print = true;
+ /* -delete implies -depth */
+ options.do_dir_first = false;
+@@ -831,7 +836,7 @@ parse_empty (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary_noarg (entry);
+ our_pred->est_success_rate = 0.01f; /* assume 1% of files are empty. */
+ return true;
+ }
+@@ -856,7 +861,7 @@ parse_false (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary_noarg (entry);
+ our_pred->need_stat = our_pred->need_type = false;
+ our_pred->side_effects = our_pred->no_default_print = false;
+ our_pred->est_success_rate = 0.0f;
+@@ -866,7 +871,7 @@ parse_false (const struct parser_table* entry, char **argv, int *arg_ptr)
+ static boolean
+ insert_fls (const struct parser_table* entry, const char *filename)
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary_noarg (entry);
+ if (filename)
+ open_output_file (filename, &our_pred->args.printf_vec);
+ else
+@@ -899,7 +904,7 @@ parse_fprint (const struct parser_table* entry, char **argv, int *arg_ptr)
+ const char *filename;
+ if (collect_arg(argv, arg_ptr, &filename))
+ {
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, filename);
+ open_output_file (filename, &our_pred->args.printf_vec);
+ our_pred->side_effects = our_pred->no_default_print = true;
+ our_pred->need_stat = our_pred->need_type = false;
+@@ -915,7 +920,7 @@ parse_fprint (const struct parser_table* entry, char **argv, int *arg_ptr)
+ static boolean
+ insert_fprint(const struct parser_table* entry, const char *filename)
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, filename);
+ if (filename)
+ open_output_file (filename, &our_pred->args.printf_vec);
+ else
+@@ -960,7 +965,7 @@ parse_fstype (const struct parser_table* entry, char **argv, int *arg_ptr)
+ const char *typename;
+ if (collect_arg(argv, arg_ptr, &typename))
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, typename);
+ our_pred->args.str = typename;
+
+ /* This is an expensive operation, so although there are
+@@ -1090,7 +1095,7 @@ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr)
+ return false;
+ }
+ }
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, groupname);
+ our_pred->args.gid = gid;
+ our_pred->est_success_rate = (our_pred->args.numinfo.l_val < 100) ? 0.99 : 0.2;
+ return true;
+@@ -1160,7 +1165,7 @@ parse_ilname (const struct parser_table* entry, char **argv, int *arg_ptr)
+ const char *name;
+ if (collect_arg(argv, arg_ptr, &name))
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, name);
+ our_pred->args.str = name;
+ /* Use the generic glob pattern estimator to figure out how many
+ * links will match, but bear in mind that most files won't be links.
+@@ -1227,7 +1232,7 @@ parse_iname (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ if (check_name_arg("-iname", name))
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, name);
+ our_pred->need_stat = our_pred->need_type = false;
+ our_pred->args.str = name;
+ our_pred->est_success_rate = estimate_pattern_match_rate(name, 0);
+@@ -1268,7 +1273,7 @@ parse_ipath (const struct parser_table* entry, char **argv, int *arg_ptr)
+ fnmatch_sanitycheck ();
+ if (collect_arg (argv, arg_ptr, &name))
+ {
+- struct predicate *our_pred = insert_primary_withpred (entry, pred_ipath);
++ struct predicate *our_pred = insert_primary_withpred (entry, pred_ipath, name);
+ our_pred->need_stat = our_pred->need_type = false;
+ our_pred->args.str = name;
+ our_pred->est_success_rate = estimate_pattern_match_rate (name, 0);
+@@ -1316,7 +1321,7 @@ parse_lname (const struct parser_table* entry, char **argv, int *arg_ptr)
+ fnmatch_sanitycheck();
+ if (collect_arg(argv, arg_ptr, &name))
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, name);
+ our_pred->args.str = name;
+ our_pred->est_success_rate = 0.1 * estimate_pattern_match_rate(name, 0);
+ return true;
+@@ -1391,7 +1396,7 @@ do_parse_xmin (const struct parser_table* entry,
+ "arithmetic overflow while converting %s "
+ "minutes to a number of seconds"))
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, minutes);
+ our_pred->args.reftime = tval;
+ our_pred->est_success_rate = estimate_timestamp_success_rate(tval.ts.tv_sec);
+ return true;
+@@ -1427,7 +1432,7 @@ parse_name (const struct parser_table* entry, char **argv, int *arg_ptr)
+ fnmatch_sanitycheck();
+ if (check_name_arg("-name", name))
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, name);
+ our_pred->need_stat = our_pred->need_type = false;
+ our_pred->args.str = name;
+ our_pred->est_success_rate = estimate_pattern_match_rate(name, 0);
+@@ -1445,7 +1450,7 @@ parse_negate (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) &argv;
+ (void) &arg_ptr;
+
+- our_pred = get_new_pred_chk_op (entry);
++ our_pred = get_new_pred_chk_op (entry, NULL);
+ our_pred->pred_func = pred_negate;
+ our_pred->p_type = UNI_OP;
+ our_pred->p_prec = NEGATE_PREC;
+@@ -1458,11 +1463,12 @@ parse_newer (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ struct predicate *our_pred;
+ struct stat stat_newer;
++ const char *arg;
+
+ set_stat_placeholders(&stat_newer);
+- if (collect_arg_stat_info(argv, arg_ptr, &stat_newer))
++ if (collect_arg_stat_info(argv, arg_ptr, &stat_newer, &arg))
+ {
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, arg);
+ our_pred->args.reftime.ts = get_stat_mtime(&stat_newer);
+ our_pred->args.reftime.xval = XVAL_MTIME;
+ our_pred->args.reftime.kind = COMP_GT;
+@@ -1530,7 +1536,7 @@ parse_newerXY (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (*arg_ptr)++;
+ }
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, argv[*arg_ptr]);
+
+
+ switch (x)
+@@ -1623,7 +1629,7 @@ parse_nogroup (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) &argv;
+ (void) &arg_ptr;
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, NULL);
+ our_pred->est_success_rate = 1e-4;
+ #ifdef CACHE_IDS
+ if (gid_unused == NULL)
+@@ -1660,7 +1666,7 @@ parse_nouser (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) arg_ptr;
+
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary_noarg (entry);
+ our_pred->est_success_rate = 1e-3;
+ #ifdef CACHE_IDS
+ if (uid_unused == NULL)
+@@ -1716,7 +1722,7 @@ parse_openparen (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = get_new_pred_chk_op (entry);
++ our_pred = get_new_pred_chk_op (entry, NULL);
+ our_pred->pred_func = pred_openparen;
+ our_pred->p_type = OPEN_PAREN;
+ our_pred->p_prec = NO_PREC;
+@@ -1732,7 +1738,7 @@ parse_or (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = get_new_pred (entry);
++ our_pred = get_new_pred_noarg (entry);
+ our_pred->pred_func = pred_or;
+ our_pred->p_type = BI_OP;
+ our_pred->p_prec = OR_PREC;
+@@ -1756,7 +1762,7 @@ parse_path (const struct parser_table* entry, char **argv, int *arg_ptr)
+ const char *name;
+ if (collect_arg(argv, arg_ptr, &name))
+ {
+- struct predicate *our_pred = insert_primary_withpred (entry, pred_path);
++ struct predicate *our_pred = insert_primary_withpred (entry, pred_path, name);
+ our_pred->need_stat = our_pred->need_type = false;
+ our_pred->args.str = name;
+ our_pred->est_success_rate = estimate_pattern_match_rate (name, 0);
+@@ -1894,7 +1900,7 @@ parse_perm (const struct parser_table* entry, char **argv, int *arg_ptr)
+ rate = 0.9986; /* probably matches anything but a broken symlink */
+ }
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, perm_expr);
+ our_pred->est_success_rate = rate;
+ if (havekind)
+ {
+@@ -1928,7 +1934,7 @@ parse_print (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary_noarg (entry);
+ /* -print has the side effect of printing. This prevents us
+ from doing undesired multiple printing when the user has
+ already specified -print. */
+@@ -1981,7 +1987,7 @@ parse_prune (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary_noarg (entry);
+ if (options.do_dir_first == false)
+ our_pred->need_stat = our_pred->need_type = false;
+ /* -prune has a side effect that it does not descend into
+@@ -1994,7 +2000,7 @@ parse_prune (const struct parser_table* entry, char **argv, int *arg_ptr)
+ static boolean
+ parse_quit (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary_noarg (entry);
+ (void) argv;
+ (void) arg_ptr;
+ our_pred->need_stat = our_pred->need_type = false;
+@@ -2036,7 +2042,7 @@ insert_regex (char **argv,
+ {
+ struct re_pattern_buffer *re;
+ const char *error_message;
+- struct predicate *our_pred = insert_primary_withpred (entry, pred_regex);
++ struct predicate *our_pred = insert_primary_withpred (entry, pred_regex, rx);
+ our_pred->need_stat = our_pred->need_type = false;
+ re = xmalloc (sizeof (struct re_pattern_buffer));
+ our_pred->args.regex = re;
+@@ -2061,6 +2067,7 @@ static boolean
+ parse_size (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ struct predicate *our_pred;
++ char *arg;
+ uintmax_t num;
+ char suffix;
+ enum comparison_type c_type;
+@@ -2073,42 +2080,43 @@ parse_size (const struct parser_table* entry, char **argv, int *arg_ptr)
+ */
+ if ((argv == NULL) || (argv[*arg_ptr] == NULL))
+ return false;
++ arg = argv[*arg_ptr];
+
+- len = strlen (argv[*arg_ptr]);
++ len = strlen (arg);
+ if (len == 0)
+ error (1, 0, _("invalid null argument to -size"));
+
+- suffix = argv[*arg_ptr][len - 1];
++ suffix = arg[len - 1];
+ switch (suffix)
+ {
+ case 'b':
+ blksize = 512;
+- argv[*arg_ptr][len - 1] = '\0';
++ arg[len - 1] = '\0';
+ break;
+
+ case 'c':
+ blksize = 1;
+- argv[*arg_ptr][len - 1] = '\0';
++ arg[len - 1] = '\0';
+ break;
+
+ case 'k':
+ blksize = 1024;
+- argv[*arg_ptr][len - 1] = '\0';
++ arg[len - 1] = '\0';
+ break;
+
+ case 'M': /* Megabytes */
+ blksize = 1024*1024;
+- argv[*arg_ptr][len - 1] = '\0';
++ arg[len - 1] = '\0';
+ break;
+
+ case 'G': /* Gigabytes */
+ blksize = 1024*1024*1024;
+- argv[*arg_ptr][len - 1] = '\0';
++ arg[len - 1] = '\0';
+ break;
+
+ case 'w':
+ blksize = 2;
+- argv[*arg_ptr][len - 1] = '\0';
++ arg[len - 1] = '\0';
+ break;
+
+ case '0':
+@@ -2127,14 +2135,14 @@ parse_size (const struct parser_table* entry, char **argv, int *arg_ptr)
+ error (1, 0, _("invalid -size type `%c'"), argv[*arg_ptr][len - 1]);
+ }
+ /* TODO: accept fractional megabytes etc. ? */
+- if (!get_num (argv[*arg_ptr], &num, &c_type))
++ if (!get_num (arg, &num, &c_type))
+ {
+ error(1, 0,
+ _("Invalid argument `%s%c' to -size"),
+- argv[*arg_ptr], (int)suffix);
++ arg, (int)suffix);
+ return false;
+ }
+- our_pred = insert_primary (entry);
++our_pred = insert_primary (entry, arg);
+ our_pred->args.size.kind = c_type;
+ our_pred->args.size.blocksize = blksize;
+ our_pred->args.size.size = num;
+@@ -2162,9 +2170,10 @@ parse_samefile (const struct parser_table* entry, char **argv, int *arg_ptr)
+ struct predicate *our_pred;
+ struct stat st, fst;
+ int fd, openflags;
++ const char *filename;
+
+ set_stat_placeholders(&st);
+- if (!collect_arg_stat_info(argv, arg_ptr, &st))
++ if (!collect_arg_stat_info(argv, arg_ptr, &st, &filename))
+ return false;
+
+ set_stat_placeholders(&fst);
+@@ -2289,7 +2298,7 @@ parse_samefile (const struct parser_table* entry, char **argv, int *arg_ptr)
+ }
+ }
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, filename);
+ our_pred->args.samefileid.ino = st.st_ino;
+ our_pred->args.samefileid.dev = st.st_dev;
+ our_pred->args.samefileid.fd = fd;
+@@ -2350,7 +2359,7 @@ parse_true (const struct parser_table* entry, char **argv, int *arg_ptr)
+ (void) argv;
+ (void) arg_ptr;
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary_noarg (entry);
+ our_pred->need_stat = our_pred->need_type = false;
+ our_pred->est_success_rate = 1.0f;
+ return true;
+@@ -2369,7 +2378,7 @@ parse_accesscheck (const struct parser_table* entry, char **argv, int *arg_ptr)
+ struct predicate *our_pred;
+ (void) argv;
+ (void) arg_ptr;
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary_noarg (entry);
+ our_pred->need_stat = our_pred->need_type = false;
+ our_pred->side_effects = our_pred->no_default_print = false;
+ if (pred_is(our_pred, pred_executable))
+@@ -2414,7 +2423,7 @@ parse_used (const struct parser_table* entry, char **argv, int *arg_ptr)
+ struct timespec zero = {0,0};
+ if (get_relative_timestamp(offset_str, &tval, zero, DAYSECS, errmsg))
+ {
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, offset_str);
+ our_pred->args.reftime = tval;
+ our_pred->est_success_rate = estimate_file_age_success_rate(tval.ts.tv_sec / DAYSECS);
+ return true;
+@@ -2472,7 +2481,7 @@ parse_user (const struct parser_table* entry, char **argv, int *arg_ptr)
+ return false;
+ }
+ }
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, username);
+ our_pred->args.uid = uid;
+ our_pred->est_success_rate = (our_pred->args.uid < 100) ? 0.99 : 0.2;
+ return true;
+@@ -2650,7 +2659,7 @@ insert_type (char **argv, int *arg_ptr,
+ error(1, 0, _("Unknown argument to -type: %c"), (*typeletter));
+ return false;
+ }
+- our_pred = insert_primary_withpred (entry, which_pred);
++ our_pred = insert_primary_withpred (entry, which_pred, typeletter);
+ our_pred->est_success_rate = rate;
+
+ /* Figure out if we will need to stat the file, because if we don't
+@@ -2706,7 +2715,7 @@ insert_fprintf (struct format_val *vec,
+ struct segment **segmentp; /* Address of current segment. */
+ struct predicate *our_pred;
+
+- our_pred = insert_primary_withpred (entry, func);
++ our_pred = insert_primary_withpred (entry, func, format_const);
+ our_pred->side_effects = our_pred->no_default_print = true;
+ our_pred->args.printf_vec = *vec;
+ our_pred->need_type = false;
+@@ -3045,7 +3054,7 @@ new_insert_exec_ok (const char *action,
+ if ((argv == NULL) || (argv[*arg_ptr] == NULL))
+ return false;
+
+- our_pred = insert_primary_withpred (entry, func);
++ our_pred = insert_primary_withpred (entry, func, "(some -exec* arguments)");
+ our_pred->side_effects = our_pred->no_default_print = true;
+ our_pred->need_type = our_pred->need_stat = false;
+
+@@ -3374,7 +3383,7 @@ parse_time (const struct parser_table* entry, char *argv[], int *arg_ptr)
+ if (!get_relative_timestamp(timearg, &tval, origin, DAYSECS, errmsg))
+ return false;
+
+- our_pred = insert_primary (entry);
++ our_pred = insert_primary (entry, orig_timearg);
+ our_pred->args.reftime = tval;
+ our_pred->est_success_rate = estimate_timestamp_success_rate(tval.ts.tv_sec);
+
+@@ -3487,7 +3496,7 @@ insert_num (char **argv, int *arg_ptr, const struct parser_table *entry)
+
+ if (get_num (numstr, &num, &c_type))
+ {
+- struct predicate *our_pred = insert_primary (entry);
++ struct predicate *our_pred = insert_primary (entry, numstr);
+ our_pred->args.numinfo.kind = c_type;
+ our_pred->args.numinfo.l_val = num;
+
+diff --git a/find/tree.c b/find/tree.c
+index 7420c60..60a0601 100644
+--- a/find/tree.c
++++ b/find/tree.c
+@@ -269,10 +269,14 @@ predicate_is_cost_free(const struct predicate *p)
+ /* Prints a predicate */
+ void print_predicate(FILE *fp, const struct predicate *p)
+ {
+- fprintf (fp, "%s%s%s",
+- p->p_name,
+- p->arg_text ? " " : "",
+- p->arg_text ? p->arg_text : "");
++ if (p->arg_text)
++ {
++ fprintf (fp, "%s %s", p->p_name, p->arg_text);
++ }
++ else
++ {
++ fprintf (fp, "%s", p->p_name);
++ }
+ }
+
+
+@@ -832,7 +836,8 @@ set_new_parent (struct predicate *curr, enum predicate_precedence high_prec, str
+ new_parent->need_stat = false;
+ new_parent->need_type = false;
+ new_parent->p_cost = NeedsNothing;
+-
++ new_parent->arg_text = NULL;
++
+ switch (high_prec)
+ {
+ case COMMA_PREC:
+@@ -1393,6 +1398,18 @@ init_pred_perf(struct predicate *pred)
+ p->visits = p->successes = 0;
+ }
+
++
++struct predicate *
++get_new_pred_noarg (const struct parser_table *entry)
++{
++ struct predicate *p = get_new_pred(entry);
++ if (p)
++ {
++ p->arg_text = NULL;
++ }
++ return p;
++}
++
+
+ /* Return a pointer to a new predicate structure, which has been
+ linked in as the last one in the predicates list.
+@@ -1433,6 +1450,8 @@ get_new_pred (const struct parser_table *entry)
+ last_pred->no_default_print = false;
+ last_pred->need_stat = true;
+ last_pred->need_type = true;
++ last_pred->p_cost = NeedsUnknown;
++ last_pred->arg_text = "ThisShouldBeSetToSomethingElse";
+ last_pred->args.str = NULL;
+ last_pred->pred_next = NULL;
+ last_pred->pred_left = NULL;
+@@ -1449,7 +1468,8 @@ get_new_pred (const struct parser_table *entry)
+ predicate is an operator. If it isn't, the AND operator is inserted. */
+
+ struct predicate *
+-get_new_pred_chk_op (const struct parser_table *entry)
++get_new_pred_chk_op (const struct parser_table *entry,
++ const char *arg)
+ {
+ struct predicate *new_pred;
+ static const struct parser_table *entry_and = NULL;
+@@ -1471,13 +1491,14 @@ get_new_pred_chk_op (const struct parser_table *entry)
+ case PRIMARY_TYPE:
+ case CLOSE_PAREN:
+ /* We need to interpose the and operator. */
+- new_pred = get_new_pred (entry_and);
++ new_pred = get_new_pred_noarg (entry_and);
+ new_pred->pred_func = pred_and;
+ new_pred->p_name = "-a";
+ new_pred->p_type = BI_OP;
+ new_pred->p_prec = AND_PREC;
+ new_pred->need_stat = false;
+ new_pred->need_type = false;
++ new_pred->arg_text = NULL;
+ new_pred->args.str = NULL;
+ new_pred->side_effects = false;
+ new_pred->no_default_print = false;
+@@ -1488,6 +1509,7 @@ get_new_pred_chk_op (const struct parser_table *entry)
+ }
+
+ new_pred = get_new_pred (entry);
++ new_pred->arg_text = arg;
+ new_pred->parser_entry = entry;
+ return new_pred;
+ }
+diff --git a/find/util.c b/find/util.c
+index a06eada..cc9a3eb 100644
+--- a/find/util.c
++++ b/find/util.c
+@@ -89,11 +89,13 @@ static struct debug_option_assoc debugassoc[] =
+ operator. */
+
+ struct predicate *
+-insert_primary_withpred (const struct parser_table *entry, PRED_FUNC pred_func)
++insert_primary_withpred (const struct parser_table *entry,
++ PRED_FUNC pred_func,
++ const char *arg)
+ {
+ struct predicate *new_pred;
+
+- new_pred = get_new_pred_chk_op (entry);
++ new_pred = get_new_pred_chk_op (entry, arg);
+ new_pred->pred_func = pred_func;
+ new_pred->p_name = entry->parser_name;
+ new_pred->args.str = NULL;
+@@ -118,10 +120,16 @@ insert_primary_withpred (const struct parser_table *entry, PRED_FUNC pred_func)
+ either not there at all (we are the very first node) or is an
+ operator. */
+ struct predicate *
+-insert_primary (const struct parser_table *entry)
++insert_primary (const struct parser_table *entry, const char *arg)
+ {
+ assert (entry->pred_func != NULL);
+- return insert_primary_withpred(entry, entry->pred_func);
++ return insert_primary_withpred(entry, entry->pred_func, arg);
++}
++
++struct predicate *
++insert_primary_noarg (const struct parser_table *entry)
++{
++ return insert_primary(entry, NULL);
+ }
+
+
diff --git a/meta/recipes-extended/findutils/findutils-4.4.2/02-28824.patch b/meta/recipes-extended/findutils/findutils-4.4.2/02-28824.patch
new file mode 100644
index 0000000000..3469712d90
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.4.2/02-28824.patch
@@ -0,0 +1,292 @@
+commit 76ed377d6d3e4a83a00cabd401f751b37ecd1e7b
+Author: James Youngman <jay@gnu.org>
+Date: Sat Feb 20 13:11:45 2010 +0000
+
+ Fix Savannah bug# 28824: "-ctime x" yields "missing argument to `-ctime'".
+
+ * find/parser.c (parse_fls): If the argument is invalid, reverse
+ the change that collect_arg() made to *arg_ptr (that is, don't
+ consume the argument).
+ (parse_fprint0): Likewise.
+ (parse_gid): Likewise.
+ (parse_group): Likewise.
+ (parse_inum): Likewise.
+ (parse_links): Likewise.
+ (do_parse_xmin): Likewise.
+ (parse_name): Likewise.
+ (parse_printf): Likewise.
+ (parse_uid): Likewise.
+ (parse_used): Likewise.
+ (parse_time): Likewise.
+
+ Signed-off-by: James Youngman <jay@gnu.org>
+
+diff --git a/ChangeLog b/ChangeLog
+index d0ce1fe..13539a4 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,0 +1,19 @@
++2010-02-20 James Youngman <jay@gnu.org>
++
++ Fix Savannah bug# 28824: "-ctime x" yields "missing argument to
++ `-ctime'".
++ * find/parser.c (parse_fls): If the argument is invalid, reverse
++ the change that collect_arg() made to *arg_ptr (that is, don't
++ consume the argument).
++ (parse_fprint0): Likewise.
++ (parse_gid): Likewise.
++ (parse_group): Likewise.
++ (parse_inum): Likewise.
++ (parse_links): Likewise.
++ (do_parse_xmin): Likewise.
++ (parse_name): Likewise.
++ (parse_printf): Likewise.
++ (parse_uid): Likewise.
++ (parse_used): Likewise.
++ (parse_time): Likewise.
++
+diff --git a/NEWS b/NEWS
+index 5394311..4e910df 100644
+--- a/NEWS
++++ b/NEWS
+@@ -4,5 +4,8 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
+
+ ** Bug Fixes
+
++#28824: Corrected error message for "-ctime x".
++ Likewise for -gid, -inum, -links, -mmin, -cmin, -amin,
++ -uid, -used, -atime, -mtime, -ctime.
+ #26537: find -prune now makes sure it has valid stat() information.
+
+diff --git a/find/parser.c b/find/parser.c
+index 2e6b989..08758ee 100644
+--- a/find/parser.c
++++ b/find/parser.c
+@@ -886,8 +886,14 @@ static boolean
+ parse_fls (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ const char *filename;
+- return collect_arg(argv, arg_ptr, &filename)
+- && insert_fls(entry, filename);
++ if (collect_arg(argv, arg_ptr, &filename))
++ {
++ if (insert_fls(entry, filename))
++ return true;
++ else
++ --*arg_ptr; /* don't consume the invalid arg. */
++ }
++ return false;
+ }
+
+ static boolean
+@@ -937,9 +943,13 @@ parse_fprint0 (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ const char *filename;
+ if (collect_arg(argv, arg_ptr, &filename))
+- return insert_fprint(entry, filename);
+- else
+- return false;
++ {
++ if (insert_fprint(entry, filename))
++ return true;
++ else
++ --*arg_ptr; /* don't consume the bad arg. */
++ }
++ return false;
+ }
+
+ static float estimate_fstype_success_rate(const char *fsname)
+@@ -993,6 +1003,7 @@ parse_gid (const struct parser_table* entry, char **argv, int *arg_ptr)
+ }
+ else
+ {
++ --*arg_ptr; /* don't consume the invalid argument. */
+ return false;
+ }
+ }
+@@ -1049,6 +1060,7 @@ static boolean
+ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ const char *groupname;
++ const int saved_argc = *arg_ptr;
+
+ if (collect_arg(argv, arg_ptr, &groupname))
+ {
+@@ -1077,6 +1089,7 @@ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr)
+ "because it has the unexpected suffix %s"),
+ quotearg_n_style(0, options.err_quoting_style, groupname),
+ quotearg_n_style(1, options.err_quoting_style, groupname+gid_len));
++ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
+ return false;
+ }
+ }
+@@ -1092,6 +1105,7 @@ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ error(1, 0, _("argument to -group is empty, but should be a group name"));
+ }
++ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
+ return false;
+ }
+ }
+@@ -1256,6 +1270,7 @@ parse_inum (const struct parser_table* entry, char **argv, int *arg_ptr)
+ }
+ else
+ {
++ --*arg_ptr; /* don't consume the invalid argument. */
+ return false;
+ }
+ }
+@@ -1310,6 +1325,7 @@ parse_links (const struct parser_table* entry, char **argv, int *arg_ptr)
+ }
+ else
+ {
++ --*arg_ptr; /* don't consume the invalid argument. */
+ return false;
+ }
+ }
+@@ -1358,6 +1374,7 @@ insert_depthspec(const struct parser_table* entry, char **argv, int *arg_ptr,
+ error(1, 0, _("Expected a positive decimal integer argument to %s, but got %s"),
+ predicate,
+ quotearg_n_style(0, options.err_quoting_style, depthstr));
++ /* NOTREACHED */
+ return false;
+ }
+ /* missing argument */
+@@ -1385,6 +1402,7 @@ do_parse_xmin (const struct parser_table* entry,
+ enum xval xv)
+ {
+ const char *minutes;
++ const int saved_argc = *arg_ptr;
+
+ if (collect_arg(argv, arg_ptr, &minutes))
+ {
+@@ -1401,6 +1419,11 @@ do_parse_xmin (const struct parser_table* entry,
+ our_pred->est_success_rate = estimate_timestamp_success_rate(tval.ts.tv_sec);
+ return true;
+ }
++ else
++ {
++ /* Don't consume the invalid argument. */
++ *arg_ptr = saved_argc;
++ }
+ }
+ return false;
+ }
+@@ -1427,6 +1450,8 @@ static boolean
+ parse_name (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ const char *name;
++ const int saved_argc = *arg_ptr;
++
+ if (collect_arg(argv, arg_ptr, &name))
+ {
+ fnmatch_sanitycheck();
+@@ -1438,6 +1463,10 @@ parse_name (const struct parser_table* entry, char **argv, int *arg_ptr)
+ our_pred->est_success_rate = estimate_pattern_match_rate(name, 0);
+ return true;
+ }
++ else
++ {
++ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
++ }
+ }
+ return false;
+ }
+@@ -1954,11 +1983,21 @@ static boolean
+ parse_printf (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ const char *format;
++ const int saved_argc = *arg_ptr;
++
+ if (collect_arg(argv, arg_ptr, &format))
+ {
+ struct format_val fmt;
+ open_stdout(&fmt);
+- return insert_fprintf (&fmt, entry, pred_fprintf, format);
++ if (insert_fprintf (&fmt, entry, pred_fprintf, format))
++ {
++ return true;
++ }
++ else
++ {
++ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
++ return false;
++ }
+ }
+ return false;
+ }
+@@ -1967,15 +2006,21 @@ static boolean
+ parse_fprintf (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+ const char *format, *filename;
++ int saved_argc = *arg_ptr;
++
+ if (collect_arg(argv, arg_ptr, &filename))
+ {
+ if (collect_arg(argv, arg_ptr, &format))
+ {
+ struct format_val fmt;
+ open_output_file (filename, &fmt);
+- return insert_fprintf (&fmt, entry, pred_fprintf, format);
++ saved_argc = *arg_ptr;
++
++ if (insert_fprintf (&fmt, entry, pred_fprintf, format))
++ return true;
+ }
+ }
++ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
+ return false;
+ }
+
+@@ -2405,6 +2450,7 @@ parse_uid (const struct parser_table* entry, char **argv, int *arg_ptr)
+ }
+ else
+ {
++ --*arg_ptr; /* don't consume the invalid argument. */
+ return false;
+ }
+ }
+@@ -2431,6 +2477,7 @@ parse_used (const struct parser_table* entry, char **argv, int *arg_ptr)
+ else
+ {
+ error(1, 0, _("Invalid argument %s to -used"), offset_str);
++ /*NOTREACHED*/
+ return false;
+ }
+ }
+@@ -2610,6 +2657,7 @@ insert_type (char **argv, int *arg_ptr,
+ if (strlen(typeletter) != 1u)
+ {
+ error(1, 0, _("Arguments to -type should contain only one letter"));
++ /*NOTREACHED*/
+ return false;
+ }
+
+@@ -2657,6 +2705,7 @@ insert_type (char **argv, int *arg_ptr,
+ #endif
+ default: /* None of the above ... nuke 'em. */
+ error(1, 0, _("Unknown argument to -type: %c"), (*typeletter));
++ /*NOTREACHED*/
+ return false;
+ }
+ our_pred = insert_primary_withpred (entry, which_pred, typeletter);
+@@ -3349,6 +3398,7 @@ parse_time (const struct parser_table* entry, char *argv[], int *arg_ptr)
+ const char *errmsg = "arithmetic overflow while converting %s "
+ "days to a number of seconds";
+ struct timespec origin;
++ const int saved_argc = *arg_ptr;
+
+ if (!collect_arg(argv, arg_ptr, &timearg))
+ return false;
+@@ -3381,7 +3431,10 @@ parse_time (const struct parser_table* entry, char *argv[], int *arg_ptr)
+ timearg = orig_timearg;
+
+ if (!get_relative_timestamp(timearg, &tval, origin, DAYSECS, errmsg))
+- return false;
++ {
++ *arg_ptr = saved_argc; /* don't consume the invalid argument */
++ return false;
++ }
+
+ our_pred = insert_primary (entry, orig_timearg);
+ our_pred->args.reftime = tval;
diff --git a/meta/recipes-extended/findutils/findutils-4.4.2/03-28872.patch b/meta/recipes-extended/findutils/findutils-4.4.2/03-28872.patch
new file mode 100644
index 0000000000..8bede38920
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.4.2/03-28872.patch
@@ -0,0 +1,56 @@
+commit 5f5eb921765794e8fc58c4bdffa2daa2ae34800f
+Author: James Youngman <jay@gnu.org>
+Date: Sat Feb 20 19:53:13 2010 +0000
+
+ Fix Savannah bug#28872, Mistake in "Problems with -exec and filenames"
+
+ * doc/find.texi (Problems with -exec and filenames): Add missing
+ $0 argument in example for sh -c 'something "$@" sh ...
+ * NEWS: Mention this change.
+
+ Signed-off-by: James Youngman <jay@gnu.org>
+
+diff --git a/ChangeLog b/ChangeLog
+index 13539a4..e94ba96 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,5 +1,10 @@
+ 2010-02-20 James Youngman <jay@gnu.org>
+
++ Fix Savannah bug#28872, Mistake in "Problems with -exec and filenames"
++ * doc/find.texi (Problems with -exec and filenames): Add missing
++ $0 argument in example for sh -c 'something "$@" sh ...
++ * NEWS: Mention this change.
++
+ Fix Savannah bug# 28824: "-ctime x" yields "missing argument to
+ `-ctime'".
+ * find/parser.c (parse_fls): If the argument is invalid, reverse
+diff --git a/NEWS b/NEWS
+index 4e910df..4c97be9 100644
+--- a/NEWS
++++ b/NEWS
+@@ -4,6 +4,9 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
+
+ ** Bug Fixes
+
++#28872: Mistake in "#safer" example in "Problems with -exec and
++ filenames" section of the Texinfo manual.
++
+ #28824: Corrected error message for "-ctime x".
+ Likewise for -gid, -inum, -links, -mmin, -cmin, -amin,
+ -uid, -used, -atime, -mtime, -ctime.
+diff --git a/doc/find.texi b/doc/find.texi
+index 2e5958d..391ffa0 100644
+--- a/doc/find.texi
++++ b/doc/find.texi
+@@ -4830,8 +4830,8 @@ problem:
+
+ @example
+ # safer
+-find -exec sh -c 'something "$@@"' @{@} \;
+-find -execdir sh -c 'something "$@@"' @{@}\;
++find -exec sh -c 'something "$@@"' sh @{@} \;
++find -execdir sh -c 'something "$@@"' sh @{@}\;
+ @end example
+
+ This approach is not guaranteed to avoid every problem, but it is much
diff --git a/meta/recipes-extended/findutils/findutils.inc b/meta/recipes-extended/findutils/findutils.inc
new file mode 100644
index 0000000000..08ca2022ee
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils.inc
@@ -0,0 +1,19 @@
+DESCRIPTION = "find, locate, and xargs binaries."
+HOMEPAGE = "http://www.gnu.org/software/findutils/"
+BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils"
+SECTION = "console/utils"
+
+# GPLv2+ (<< 4.2.32), GPLv3+ (>= 4.2.32)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
+
+SRC_URI = "${GNU_MIRROR}/findutils/findutils-${PV}.tar.gz"
+
+inherit autotools gettext
+
+# diffutils assumes non-glibc compilation with uclibc and
+# this causes it to generate its own implementations of
+# standard functionality. regex.c actually breaks compilation
+# because it uses __mempcpy, there are other things (TBD:
+# see diffutils.mk in buildroot)
+EXTRA_OECONF_linux-uclibc = "--without-included-regex"
diff --git a/meta/recipes-extended/findutils/findutils_4.2.31.bb b/meta/recipes-extended/findutils/findutils_4.2.31.bb
new file mode 100644
index 0000000000..2804a3ba3a
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils_4.2.31.bb
@@ -0,0 +1,37 @@
+DESCRIPTION = "find, locate, and xargs binaries."
+HOMEPAGE = "http://www.gnu.org/software/findutils/"
+BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/findutils/findutils-${PV}.tar.gz \
+ file://gnulib-extension.patch"
+
+inherit autotools gettext
+
+# diffutils assumes non-glibc compilation with uclibc and
+# this causes it to generate its own implementations of
+# standard functionality. regex.c actually breaks compilation
+# because it uses __mempcpy, there are other things (TBD:
+# see diffutils.mk in buildroot)
+EXTRA_OECONF_linux-uclibc = "--without-included-regex"
+
+do_install_append () {
+ if [ -e ${D}${bindir}/find ]; then
+ mv ${D}${bindir}/find ${D}${bindir}/find.${PN}
+ mv ${D}${bindir}/xargs ${D}${bindir}/xargs.${PN}
+ fi
+}
+
+pkg_postinst_${PN} () {
+ for i in find xargs; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done
+}
+
+pkg_prerm_${PN} () {
+ for i in find xargs; do update-alternatives --remove $i $i.${PN}; done
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/findutils/findutils_4.4.2.bb b/meta/recipes-extended/findutils/findutils_4.4.2.bb
new file mode 100644
index 0000000000..18514f36ea
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils_4.4.2.bb
@@ -0,0 +1,27 @@
+require findutils.inc
+
+PR = "r0"
+
+SRC_URI += "file://01-27017.patch \
+ file://02-28824.patch \
+ file://03-28872.patch"
+
+# http://savannah.gnu.org/bugs/?27299
+EXTRA_OECONF += "gl_cv_func_wcwidth_works=yes"
+
+do_install_append () {
+ if [ -e ${D}${bindir}/find ]; then
+ mv ${D}${bindir}/find ${D}${bindir}/find.${PN}
+ mv ${D}${bindir}/xargs ${D}${bindir}/xargs.${PN}
+ fi
+}
+
+pkg_postinst_${PN} () {
+ for i in find xargs; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done
+}
+
+pkg_prerm_${PN} () {
+ for i in find xargs; do update-alternatives --remove $i $i.${PN}; done
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/gperf/gperf.inc b/meta/recipes-extended/gperf/gperf.inc
new file mode 100644
index 0000000000..a521e0943b
--- /dev/null
+++ b/meta/recipes-extended/gperf/gperf.inc
@@ -0,0 +1,22 @@
+DESCRIPTION = "GNU gperf is a perfect hash function generator"
+HOMEPAGE = "http://www.gnu.org/software/gperf"
+SUMMARY = "Generate a perfect hash function from a set of keywords"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://src/main.cc;firstline=8;endline=19;md5=24688d2dff69bcf5cbea4bc3e4174c5a"
+
+SRC_URI = "${GNU_MIRROR}/gperf/gperf-${PV}.tar.gz"
+
+inherit autotools
+
+# autoreconf couldn't find acinclude.m4 when stepping into subdirectory. Instead of
+# duplicating acinclude.m4 in every subdirectory, use absolute include path to aclocal
+EXTRA_AUTORECONF += " -I ${S}"
+
+do_configure_prepend() {
+ if [ ! -e acinclude.m4 ]; then
+ cat aclocal.m4 > acinclude.m4
+ fi
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/gperf/gperf_3.0.3.bb b/meta/recipes-extended/gperf/gperf_3.0.3.bb
new file mode 100644
index 0000000000..5cccdf1adb
--- /dev/null
+++ b/meta/recipes-extended/gperf/gperf_3.0.3.bb
@@ -0,0 +1,7 @@
+require gperf.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5f84abb0070adf8a0925d7d534b6e0a \
+ file://src/main.cc;firstline=8;endline=19;md5=3eab12ba436c4da725b19b131def6de9"
+
+PR = "r1"
diff --git a/meta/recipes-extended/gperf/gperf_3.0.4.bb b/meta/recipes-extended/gperf/gperf_3.0.4.bb
new file mode 100644
index 0000000000..ee532c98d8
--- /dev/null
+++ b/meta/recipes-extended/gperf/gperf_3.0.4.bb
@@ -0,0 +1,3 @@
+require gperf.inc
+
+PR = "r0"
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch b/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
new file mode 100644
index 0000000000..8fc7c4852f
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
@@ -0,0 +1,53 @@
+# Fix to use mempcpy instead of __mempcpy. This is needed for uclibc which
+# doesn't define __mempcpy, only mempcpy. Since both uclibc and glibc have
+# mempcpy, we'll just use that instead.
+# Patch source: OpenEmbedded
+
+Index: grep-2.5.1/intl/localealias.c
+===================================================================
+--- grep-2.5.1.orig/intl/localealias.c 2002-03-14 00:39:06.000000000 +1100
++++ grep-2.5.1/intl/localealias.c 2007-05-17 13:53:58.000000000 +1000
+@@ -65,7 +65,7 @@
+ # define strcasecmp __strcasecmp
+
+ # ifndef mempcpy
+-# define mempcpy __mempcpy
++# error "mempcpy not detected"
+ # endif
+ # define HAVE_MEMPCPY 1
+ # define HAVE___FSETLOCKING 1
+Index: grep-2.5.1/lib/getopt.c
+===================================================================
+--- grep-2.5.1.orig/lib/getopt.c 2001-03-04 16:33:12.000000000 +1100
++++ grep-2.5.1/lib/getopt.c 2007-05-17 13:51:44.000000000 +1000
+@@ -326,7 +326,7 @@
+ nonoption_flags_len = nonoption_flags_max_len = 0;
+ else
+ {
+- memset (__mempcpy (new_str, __getopt_nonoption_flags,
++ memset (mempcpy (new_str, __getopt_nonoption_flags,
+ nonoption_flags_max_len),
+ '\0', top + 1 - nonoption_flags_max_len);
+ nonoption_flags_max_len = top + 1;
+@@ -437,7 +437,7 @@
+ if (__getopt_nonoption_flags == NULL)
+ nonoption_flags_max_len = -1;
+ else
+- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
++ memset (mempcpy (__getopt_nonoption_flags, orig_str, len),
+ '\0', nonoption_flags_max_len - len);
+ }
+ }
+Index: grep-2.5.1/lib/regex.c
+===================================================================
+--- grep-2.5.1.orig/lib/regex.c 2001-04-03 04:04:45.000000000 +1000
++++ grep-2.5.1/lib/regex.c 2007-05-17 13:51:48.000000000 +1000
+@@ -7842,7 +7842,7 @@
+ if (msg_size > errbuf_size)
+ {
+ #if defined HAVE_MEMPCPY || defined _LIBC
+- *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
++ *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
+ #else
+ memcpy (errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size - 1] = 0;
diff --git a/meta/recipes-extended/grep/grep_2.5.1a.bb b/meta/recipes-extended/grep/grep_2.5.1a.bb
new file mode 100644
index 0000000000..d50d5a374e
--- /dev/null
+++ b/meta/recipes-extended/grep/grep_2.5.1a.bb
@@ -0,0 +1,40 @@
+DESCRIPTION = "grep GNU utility"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.bz2 \
+ file://uclibc-fix.patch"
+
+SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c"
+SRC_URI[sha256sum] = "38c8a2bb9223d1fb1b10bdd607cf44830afc92fd451ac4cd07619bf92bdd3132"
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--disable-perl-regexp --disable-ncurses"
+
+do_configure_prepend () {
+ rm -f ${S}/m4/init.m4
+}
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/grep ${D}${base_bindir}/grep.${PN}
+ mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep.${PN}
+ mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep.${PN}
+}
+
+pkg_postinst_${PN} () {
+ update-alternatives --install ${base_bindir}/grep grep grep.${PN} 100
+ update-alternatives --install ${base_bindir}/egrep egrep egrep.${PN} 100
+ update-alternatives --install ${base_bindir}/fgrep fgrep fgrep.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+ update-alternatives --remove grep grep.${PN}
+ update-alternatives --remove egrep egrep.${PN}
+ update-alternatives --remove fgrep fgrep.${PN}
+}
diff --git a/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch b/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
new file mode 100644
index 0000000000..8308865a25
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
@@ -0,0 +1,45 @@
+gzip uses gnulib, whose header conflict with glibc. This patch rename some function to avoid conflict.
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+Index: gzip-1.3.12/gzip.c
+===================================================================
+--- gzip-1.3.12.orig/gzip.c 2010-08-13 10:29:38.000000000 +0800
++++ gzip-1.3.12/gzip.c 2010-08-13 10:29:44.000000000 +0800
+@@ -1637,7 +1637,7 @@
+ }
+ }
+
+- if (futimens (ofd, ofname, timespec) != 0)
++ if (futimens_gnulib (ofd, ofname, timespec) != 0)
+ {
+ int e = errno;
+ WARN ((stderr, "%s: ", program_name));
+Index: gzip-1.3.12/lib/utimens.c
+===================================================================
+--- gzip-1.3.12.orig/lib/utimens.c 2010-08-13 10:33:47.000000000 +0800
++++ gzip-1.3.12/lib/utimens.c 2010-08-13 10:34:02.000000000 +0800
+@@ -75,7 +75,7 @@
+ Return 0 on success, -1 (setting errno) on failure. */
+
+ int
+-futimens (int fd ATTRIBUTE_UNUSED,
++futimens_gnulib (int fd ATTRIBUTE_UNUSED,
+ char const *file, struct timespec const timespec[2])
+ {
+ /* Some Linux-based NFS clients are buggy, and mishandle time stamps
+@@ -185,5 +185,5 @@
+ int
+ utimens (char const *file, struct timespec const timespec[2])
+ {
+- return futimens (-1, file, timespec);
++ return futimens_gnulib (-1, file, timespec);
+ }
+Index: gzip-1.3.12/lib/utimens.h
+===================================================================
+--- gzip-1.3.12.orig/lib/utimens.h 2010-08-13 10:14:57.000000000 +0800
++++ gzip-1.3.12/lib/utimens.h 2010-08-13 10:21:45.000000000 +0800
+@@ -1,3 +1,3 @@
+ #include <time.h>
+-int futimens (int, char const *, struct timespec const [2]);
++int futimens_gnulib (int, char const *, struct timespec const [2]);
+ int utimens (char const *, struct timespec const [2]);
diff --git a/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch b/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
new file mode 100644
index 0000000000..927377286f
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
@@ -0,0 +1,53 @@
+remove AC_USE_SYSTEM_EXTENSIONS to fix the autoconf error "AC_REQUIRE: circular
+dependency of AC_GNU_SOURCE"
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+Index: gzip-1.3.12/m4/extensions.m4
+===================================================================
+--- gzip-1.3.12.orig/m4/extensions.m4 2010-08-16 14:18:16.000000000 +0800
++++ gzip-1.3.12/m4/extensions.m4 2010-08-16 14:21:54.000000000 +0800
+@@ -12,44 +12,6 @@
+ # enough in this area it's likely we'll need to redefine
+ # AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+- AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+- AC_REQUIRE([AC_GNU_SOURCE])
+- AC_REQUIRE([AC_AIX])
+- AC_REQUIRE([AC_MINIX])
+-
+- AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris. */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+- [ac_cv_safe_to_define___extensions__],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+-# define __EXTENSIONS__ 1
+- AC_INCLUDES_DEFAULT])],
+- [ac_cv_safe_to_define___extensions__=yes],
+- [ac_cv_safe_to_define___extensions__=no])])
+- test $ac_cv_safe_to_define___extensions__ = yes &&
+- AC_DEFINE([__EXTENSIONS__])
+- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+- AC_DEFINE([_TANDEM_SOURCE])
+-])
+-
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
diff --git a/meta/recipes-extended/gzip/gzip.inc b/meta/recipes-extended/gzip/gzip.inc
new file mode 100644
index 0000000000..28df4d4a5d
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip.inc
@@ -0,0 +1,38 @@
+DESCRIPTION = "GNU Gzip is a popular data compression program originally written by Jean-loup Gailly for the GNU project. Mark Adler wrote the decompression part"
+HOMEPAGE = "http://www.gnu.org/software/gzip/"
+SECTION = "console/utils"
+# change to GPLv3+ in 2007/07. Previous GPLv2 version is 1.3.12
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://gzip.h;firstline=8;endline=20;md5=e2ec6b91fbe43a18f6081f3bbae46a01"
+
+SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz"
+
+inherit autotools
+
+do_install () {
+ autotools_do_install
+ if [ "${PN}" = "${BPN}" ] ; then
+ # Rename and move files into /bin (FHS), which is typical place for gzip
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip.${PN}
+ mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip.${PN}
+ mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat.${PN}
+ fi
+}
+
+pkg_postinst_${PN} () {
+ if [ "${PN}" = "${BPN}" ] ; then
+ update-alternatives --install ${base_bindir}/gunzip gunzip gunzip.${PN} 100
+ update-alternatives --install ${base_bindir}/gzip gzip gzip.${PN} 100
+ update-alternatives --install ${base_bindir}/zcat zcat zcat.${PN} 100
+ fi
+}
+
+pkg_prerm_${PN} () {
+ if [ "${PN}" = "${BPN}" ] ; then
+ update-alternatives --remove gunzip gunzip.${PN}
+ update-alternatives --remove gzip gzip.${PN}
+ update-alternatives --remove zcat zcat.${PN}
+ fi
+}
diff --git a/meta/recipes-extended/gzip/gzip_1.3.12.bb b/meta/recipes-extended/gzip/gzip_1.3.12.bb
new file mode 100644
index 0000000000..c111e2e24d
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip_1.3.12.bb
@@ -0,0 +1,39 @@
+DESCRIPTION = "Standard GNU compressor"
+HOMEPAGE = "http://www.gnu.org/software/gzip"
+SECTION = "base"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://gzip.h;endline=22;md5=c0934ad1900d927f86556153d4c76d23 \
+ file://lzw.h;endline=19;md5=c273e09a02edd9801cc74d39683049e9 "
+
+SRC_URI = "${GNU_MIRROR}/gzip/gzip-${PV}.tar.gz \
+ file://m4-extensions-fix.patch;patch=1 \
+ file://dup-def-fix.patch;patch=1"
+
+PR = "r0"
+
+inherit autotools
+
+do_install () {
+ autotools_do_install
+ # move files into /bin (FHS)
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip.${PN}
+ mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip.${PN}
+ mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat.${PN}
+}
+
+pkg_postinst_${PN} () {
+ update-alternatives --install ${base_bindir}/gunzip gunzip gunzip.${PN} 100
+ update-alternatives --install ${base_bindir}/gzip gzip gzip.${PN} 100
+ update-alternatives --install ${base_bindir}/zcat zcat zcat.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+ update-alternatives --remove gunzip gunzip.${PN}
+ update-alternatives --remove gzip gzip.${PN}
+ update-alternatives --remove zcat zcat.${PN}
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/gzip/gzip_1.4.bb b/meta/recipes-extended/gzip/gzip_1.4.bb
new file mode 100644
index 0000000000..93020ba50b
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip_1.4.bb
@@ -0,0 +1,5 @@
+require gzip.inc
+
+PR = "r0"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/hdparm/hdparm-6.3/bswap.patch b/meta/recipes-extended/hdparm/hdparm-6.3/bswap.patch
new file mode 100644
index 0000000000..37fbcb7b38
--- /dev/null
+++ b/meta/recipes-extended/hdparm/hdparm-6.3/bswap.patch
@@ -0,0 +1,36 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- hdparm-5.8/hdparm.c~bswap
++++ hdparm-5.8/hdparm.c
+@@ -20,7 +20,9 @@
+ #include <linux/types.h>
+ #include <linux/hdreg.h>
+ #include <linux/major.h>
+-#include <asm/byteorder.h>
++#include <byteswap.h>
++
++#define le16_to_cpus(x) bswap_16(htons(x))
+
+ #include "hdparm.h"
+
+@@ -1160,7 +1162,7 @@
+ }
+ } else {
+ for(i = 0; i < 0x100; ++i) {
+- __le16_to_cpus(&id[i]);
++ le16_to_cpus(&id[i]);
+ }
+ identify((void *)id, NULL);
+ }
+@@ -1380,7 +1382,7 @@
+ }
+ for (i = 0; count >= 4; ++i) {
+ sbuf[i] = (fromhex(b[0]) << 12) | (fromhex(b[1]) << 8) | (fromhex(b[2]) << 4) | fromhex(b[3]);
+- __le16_to_cpus((__u16 *)(&sbuf[i]));
++ le16_to_cpus((__u16 *)(&sbuf[i]));
+ b += 5;
+ count -= 5;
+ }
diff --git a/meta/recipes-extended/hdparm/hdparm-6.3/uclibc.patch b/meta/recipes-extended/hdparm/hdparm-6.3/uclibc.patch
new file mode 100644
index 0000000000..495d7491bb
--- /dev/null
+++ b/meta/recipes-extended/hdparm/hdparm-6.3/uclibc.patch
@@ -0,0 +1,32 @@
+--- hdparm-5.8/hdparm.c.ark 2005-05-22 19:48:34.000000000 +0000
++++ hdparm-5.8/hdparm.c 2005-05-22 19:52:18.000000000 +0000
+@@ -17,7 +17,9 @@
+ #include <sys/times.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
++#ifndef __UCLIBC__
+ #include <linux/types.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/major.h>
+ #include <byteswap.h>
+--- hdparm-5.8/hdparm.h.ark 2005-05-22 19:51:49.000000000 +0000
++++ hdparm-5.8/hdparm.h 2005-05-22 19:54:54.000000000 +0000
+@@ -1,6 +1,6 @@
+ /* Some prototypes for extern functions. */
+
+-#include <linux/types.h> /* for __u16 */
++#include <stdint.h>
+
+ #if !defined(__GNUC__) && !defined(__attribute__)
+ #define __attribute__(x) /* if not using GCC, turn off the __attribute__
+@@ -11,7 +11,7 @@
+ others, though, were declared in hdparm.c with global scope; since other
+ functions in that file have static (file) scope, I assume the difference is
+ intentional. */
+-extern void identify (__u16 *id_supplied, const char *devname);
++extern void identify (uint16_t *id_supplied, const char *devname);
+
+ extern void usage_error(int out) __attribute__((noreturn));
+ extern int main(int argc, char **argv) __attribute__((noreturn));
+
diff --git a/meta/recipes-extended/hdparm/hdparm_6.3.bb b/meta/recipes-extended/hdparm/hdparm_6.3.bb
new file mode 100644
index 0000000000..94d1e6e9bf
--- /dev/null
+++ b/meta/recipes-extended/hdparm/hdparm_6.3.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "hdparm is a Linux shell utility for viewing \
+and manipulating various IDE drive and driver parameters."
+SECTION = "console/utils"
+PRIORITY = "optional"
+LICENSE = "BSD"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/hdparm-${PV}.tar.gz \
+ file://bswap.patch;patch=1 \
+ file://uclibc.patch;patch=1"
+
+do_install () {
+ install -d ${D}/${sbindir} ${D}/${mandir}/man8
+ oe_runmake 'DESTDIR=${D}' install
+}
diff --git a/meta/recipes-extended/libidn/libidn_0.6.14.bb b/meta/recipes-extended/libidn/libidn_0.6.14.bb
new file mode 100644
index 0000000000..17bb103d9e
--- /dev/null
+++ b/meta/recipes-extended/libidn/libidn_0.6.14.bb
@@ -0,0 +1,26 @@
+DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group."
+HOMEPAGE = "http://www.gnu.org/software/libidn/"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+ file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://lib/idna.h;firstline=6;endline=18;md5=6d9d5532eb28b99e860262281c540d02 \
+ file://src/idn.c;firstline=6;endline=18;md5=41b6aec531cc6a9d54a6c4deee251bf5"
+PR = "r0"
+
+inherit pkgconfig autotools gettext
+
+SRC_URI = "http://alpha.gnu.org/gnu/libidn/${P}.tar.gz"
+
+EXTRA_OECONF = " --disable-tld"
+
+do_configure_prepend() {
+ # this version of libidn copies AC_USE_SYSTEM_EXTENSIONS from
+ # autoconf CVS because atm the autoconf it uses is a bit old
+ # now with cross autotool, that macro is already there and this
+ # local definition causes circular dependency. Actually AC_GNU_SOURCE
+ # is identical to AC_USE_SYSTEM_EXTENSIONS. So remove all local
+ # references to the latter here.
+ sed -i -e "/AC_REQUIRE(\[gl_USE_SYSTEM_EXTENSIONS/d" ${S}/lib/gl/m4/gnulib-comp.m4
+ rm -f ${S}/lib/gl/m4/extensions.m4
+}
diff --git a/meta/recipes-extended/libidn/libidn_1.19.bb b/meta/recipes-extended/libidn/libidn_1.19.bb
new file mode 100644
index 0000000000..2e29ade14c
--- /dev/null
+++ b/meta/recipes-extended/libidn/libidn_1.19.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group."
+HOMEPAGE = "http://www.gnu.org/software/libidn/"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+ & GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://lib/idna.h;firstline=6;endline=18;md5=643beb30bf98d8c4aed59a51b86fe9ea \
+ file://src/idn.c;firstline=6;endline=18;md5=07a57d46977b38a2557aac446dda35dd"
+PR = "r0"
+
+inherit pkgconfig autotools gettext
+
+SRC_URI = "http://ftp.gnu.org/gnu/libidn/${P}.tar.gz"
+
+# command tool is under GPLv3+, while libidn itself is under LGPLv2.1+
+# so package command into a separate package
+PACKAGES =+ "idn"
+FILES_idn = "${bindir}/*"
+
+EXTRA_OECONF = " --disable-tld"
diff --git a/meta/recipes-extended/lsof/lsof_4.83.bb b/meta/recipes-extended/lsof/lsof_4.83.bb
new file mode 100644
index 0000000000..078da64305
--- /dev/null
+++ b/meta/recipes-extended/lsof/lsof_4.83.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "Lsof is a Unix-specific diagnostic tool. \
+Its name stands for LiSt Open Files, and it does just that."
+SECTION = "devel"
+LICENSE = "BSD"
+
+PR = "r0"
+
+SRC_URI = "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2"
+LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar"
+S = "${WORKDIR}/lsof_${PV}_src"
+
+python do_unpack () {
+ bb.build.exec_func('base_do_unpack', d)
+ src_uri = bb.data.getVar('SRC_URI', d)
+ bb.data.setVar('SRC_URI', '${LOCALSRC}', d)
+ bb.build.exec_func('base_do_unpack', d)
+ bb.data.setVar('SRC_URI', src_uri, d)
+}
+
+export LSOF_OS = "${TARGET_OS}"
+LSOF_OS_linux-uclibc = "linux"
+LSOF_OS_linux-gnueabi = "linux"
+export LSOF_INCLUDE = "${STAGING_INCDIR}"
+
+do_configure () {
+ yes | ./Configure ${LSOF_OS}
+}
+
+export I = "${STAGING_INCDIR}"
+export L = "${STAGING_INCDIR}"
+export EXTRA_OEMAKE = ""
+
+do_compile () {
+ oe_runmake 'CC=${CC}' 'CFGL=${LDFLAGS} -L./lib -llsof' 'DEBUG=' 'INCL=${CFLAGS}'
+}
+
+do_install () {
+ install -d ${D}${sbindir} ${D}${mandir}/man8
+ install -m 4755 lsof ${D}${sbindir}/lsof
+ install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8
+}
diff --git a/meta/recipes-extended/pam/libpam-1.1.1/99_pam b/meta/recipes-extended/pam/libpam-1.1.1/99_pam
new file mode 100644
index 0000000000..97e990d10b
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam-1.1.1/99_pam
@@ -0,0 +1 @@
+d root root 0755 /var/run/sepermit none
diff --git a/meta/recipes-extended/pam/libpam-1.1.1/disable_crossbinary.patch b/meta/recipes-extended/pam/libpam-1.1.1/disable_crossbinary.patch
new file mode 100644
index 0000000000..43359b08fe
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam-1.1.1/disable_crossbinary.patch
@@ -0,0 +1,34 @@
+padout should be compiled using the native compiler but isn't.
+Disable this piece of documentation for now.
+
+RP
+
+Index: Linux-PAM-1.0.2/doc/specs/Makefile.am
+===================================================================
+--- Linux-PAM-1.0.2.orig/doc/specs/Makefile.am 2008-11-04 21:06:23.000000000 +0000
++++ Linux-PAM-1.0.2/doc/specs/Makefile.am 2008-11-04 21:07:06.000000000 +0000
+@@ -2,21 +2,8 @@
+ # Copyright (c) 2005, 2006 Thorsten Kukuk <kukuk@suse.de>
+ #
+
+-CLEANFILES = draft-morgan-pam-current.txt *~
++CLEANFILES = *~
+
+-EXTRA_DIST = draft-morgan-pam.raw std-agent-id.raw rfc86.0.txt
++EXTRA_DIST = std-agent-id.raw rfc86.0.txt
+
+-draft-morgan-pam-current.txt: padout draft-morgan-pam.raw
+- ./padout < $(srcdir)/draft-morgan-pam.raw > draft-morgan-pam-current.txt
+-
+-AM_YFLAGS = -d
+-
+-BUILT_SOURCES = parse_y.h
+-
+-noinst_PROGRAMS = padout
+-
+-padout_SOURCES = parse_l.l parse_y.y
+-
+-padout_LDADD = @LEXLIB@
+-
+-doc_DATA = draft-morgan-pam-current.txt rfc86.0.txt
++doc_DATA = rfc86.0.txt
diff --git a/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-account b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-account
new file mode 100644
index 0000000000..316b17337b
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-account
@@ -0,0 +1,25 @@
+#
+# /etc/pam.d/common-account - authorization settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authorization modules that define
+# the central access policy for use on the system. The default is to
+# only deny service to users whose accounts are expired in /etc/shadow.
+#
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules. See
+# pam-auth-update(8) for details.
+#
+
+# here are the per-package modules (the "Primary" block)
+account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
+# here's the fallback if no module succeeds
+account requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+account required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+# end of pam-auth-update config
diff --git a/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-auth b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-auth
new file mode 100644
index 0000000000..460b69f198
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-auth
@@ -0,0 +1,18 @@
+#
+# /etc/pam.d/common-auth - authentication settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authentication modules that define
+# the central authentication scheme for use on the system
+# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
+# traditional Unix authentication mechanisms.
+
+# here are the per-package modules (the "Primary" block)
+auth [success=1 default=ignore] pam_unix.so nullok_secure
+# here's the fallback if no module succeeds
+auth requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+auth required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
diff --git a/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-password b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-password
new file mode 100644
index 0000000000..3896057328
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-password
@@ -0,0 +1,26 @@
+#
+# /etc/pam.d/common-password - password-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define the services to be
+# used to change user passwords. The default is pam_unix.
+
+# Explanation of pam_unix options:
+#
+# The "sha512" option enables salted SHA512 passwords. Without this option,
+# the default is Unix crypt. Prior releases used the option "md5".
+#
+# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in
+# login.defs.
+#
+# See the pam_unix manpage for other options.
+
+# here are the per-package modules (the "Primary" block)
+password [success=1 default=ignore] pam_unix.so obscure sha512
+# here's the fallback if no module succeeds
+password requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+password required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
diff --git a/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-session b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-session
new file mode 100644
index 0000000000..a594dd9d90
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-session
@@ -0,0 +1,19 @@
+#
+# /etc/pam.d/common-session - session-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of sessions of *any* kind (both interactive and
+# non-interactive).
+#
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+session required pam_unix.so
diff --git a/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-session-noninteractive b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-session-noninteractive
new file mode 100644
index 0000000000..b110bb2b49
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/common-session-noninteractive
@@ -0,0 +1,19 @@
+#
+# /etc/pam.d/common-session-noninteractive - session-related modules
+# common to all non-interactive services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of all non-interactive sessions.
+#
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+session required pam_unix.so
diff --git a/meta/recipes-extended/pam/libpam-1.1.1/pam.d/other b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/other
new file mode 100644
index 0000000000..6e40cd0c02
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam-1.1.1/pam.d/other
@@ -0,0 +1,27 @@
+#
+# /etc/pam.d/other - specify the PAM fallback behaviour
+#
+# Note that this file is used for any unspecified service; for example
+#if /etc/pam.d/cron specifies no session modules but cron calls
+#pam_open_session, the session module out of /etc/pam.d/other is
+#used.
+
+#If you really want nothing to happen then use pam_permit.so or
+#pam_deny.so as appropriate.
+
+# We use pam_warn.so to generate syslog notes that the 'other'
+#fallback rules are being used (as a hint to suggest you should setup
+#specific PAM rules for the service and aid to debugging). We then
+#fall back to the system default in /etc/pam.d/common-*
+
+auth required pam_warn.so
+auth include common-auth
+
+account required pam_warn.so
+account include common-account
+
+password required pam_warn.so
+password include common-password
+
+session required pam_warn.so
+session include common-session
diff --git a/meta/recipes-extended/pam/libpam_1.1.1.bb b/meta/recipes-extended/pam/libpam_1.1.1.bb
new file mode 100644
index 0000000000..536a0f5ce9
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam_1.1.1.bb
@@ -0,0 +1,73 @@
+DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), Basically, it is a flexible mechanism for authenticating users"
+HOMEPAGE = "http://www.kernel.org/pub/linux/libs/pam/"
+BUGTRACKER = "http://sourceforge.net/projects/pam/support"
+# PAM allows dual licensed under GPL and BSD.
+# /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time
+# libpam-runtime-1.0.1 is GPLv2+), by openembedded
+LICENSE = "GPLv2+ | BSD"
+PR = "r1"
+
+DEPENDS = "bison flex"
+RDEPENDS_${PN}-runtime = "libpam pam-plugin-deny pam-plugin-permit pam-plugin-warn pam-plugin-unix"
+RRECOMMENDS_${PN} = "libpam-runtime"
+
+SRC_URI = "http://www.kernel.org/pub/linux/libs/pam/library/Linux-PAM-${PV}.tar.bz2 \
+ file://disable_crossbinary.patch \
+ file://99_pam \
+ file://pam.d/*"
+
+EXTRA_OECONF = "--with-db-uniquename=_pam \
+ --includedir=${includedir}/security \
+ --libdir=${base_libdir} \
+ --disable-regenerate-docu"
+CFLAGS_append = " -fPIC "
+
+S = "${WORKDIR}/Linux-PAM-${PV}"
+
+inherit autotools gettext
+
+PACKAGES += "${PN}-runtime"
+FILES_${PN} = "${base_libdir}/lib*${SOLIBS}"
+FILES_${PN}-dbg += "${base_libdir}/security/.debug \
+ ${base_libdir}/security/pam_filter/.debug"
+FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-runtime = "${sysconfdir}"
+
+PACKAGES_DYNAMIC += " pam-plugin-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ def pam_plugin_append_file(pn, dir, file):
+ nf = os.path.join(dir, file)
+ of = bb.data.getVar('FILES_' + pn, d, True)
+ if of:
+ nf = of + " " + nf
+ bb.data.setVar('FILES_' + pn, nf, d)
+
+ dvar = bb.data.expand('${WORKDIR}/package', d, True)
+ pam_libdir = bb.data.expand('${base_libdir}/security', d)
+ pam_sbindir = bb.data.expand('${sbindir}', d)
+ pam_filterdir = bb.data.expand('${base_libdir}/security/pam_filter', d)
+
+ do_split_packages(d, pam_libdir, '^pam(.*)\.so$', 'pam-plugin%s', 'PAM plugin for %s', extra_depends='')
+ pam_plugin_append_file('pam-plugin-unix', pam_sbindir, 'unix_chkpwd')
+ pam_plugin_append_file('pam-plugin-unix', pam_sbindir, 'unix_update')
+ pam_plugin_append_file('pam-plugin-tally', pam_sbindir, 'pam_tally')
+ pam_plugin_append_file('pam-plugin-tally2', pam_sbindir, 'pam_tally2')
+ pam_plugin_append_file('pam-plugin-timestamp', pam_sbindir, 'pam_timestamp_check')
+ pam_plugin_append_file('pam-plugin-mkhomedir', pam_sbindir, 'mkhomedir_helper')
+ do_split_packages(d, pam_filterdir, '^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='')
+}
+
+do_install() {
+ autotools_do_install
+
+ # don't install /var/run when populating rootfs. Do it through volatile
+ rm -rf ${D}/var
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/99_pam ${D}/etc/default/volatiles
+
+ install -d ${D}${sysconfdir}/pam.d/
+ install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
+}
diff --git a/meta/recipes-extended/parted/parted-1.9.0/no_check.patch b/meta/recipes-extended/parted/parted-1.9.0/no_check.patch
new file mode 100644
index 0000000000..24a328ceea
--- /dev/null
+++ b/meta/recipes-extended/parted/parted-1.9.0/no_check.patch
@@ -0,0 +1,18 @@
+If check is detected, it makes the builds non-determinstic so just force
+it to be disabled.
+
+RP - 4/11/08
+
+Index: parted-1.9.0/configure.ac
+===================================================================
+--- parted-1.9.0.orig/configure.ac 2009-07-23 18:52:08.000000000 +0100
++++ parted-1.9.0/configure.ac 2010-02-02 14:13:56.013905093 +0000
+@@ -477,7 +477,7 @@
+ AM_CONDITIONAL([BUILD_LINUX], [test "$OS" = linux])
+
+ dnl check for "check", unit testing library/header
+-PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
++have_check=no
+ if test "$have_check" != "yes"; then
+ AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building])
+ fi
diff --git a/meta/recipes-extended/parted/parted-1.9.0/syscalls.patch b/meta/recipes-extended/parted/parted-1.9.0/syscalls.patch
new file mode 100644
index 0000000000..6be49968f3
--- /dev/null
+++ b/meta/recipes-extended/parted/parted-1.9.0/syscalls.patch
@@ -0,0 +1,53 @@
+---
+ libparted/arch/linux.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+Index: parted-1.9.0/libparted/arch/linux.c
+===================================================================
+--- parted-1.9.0.orig/libparted/arch/linux.c 2009-07-23 18:52:08.000000000 +0100
++++ parted-1.9.0/libparted/arch/linux.c 2010-02-02 14:14:16.523904768 +0000
+@@ -17,6 +17,8 @@
+
+ #define PROC_DEVICES_BUFSIZ 16384
+
++#include <linux/version.h>
++
+ #include <config.h>
+ #include <arch/linux.h>
+
+@@ -1477,12 +1479,14 @@
+
+ #if SIZEOF_OFF_T < 8
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+ static _syscall5(int,_llseek,
+ unsigned int, fd,
+ unsigned long, offset_high,
+ unsigned long, offset_low,
+ loff_t*, result,
+ unsigned int, origin)
++#endif
+
+ loff_t
+ llseek (unsigned int fd, loff_t offset, unsigned int whence)
+@@ -1490,11 +1494,20 @@
+ loff_t result;
+ int retval;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+ retval = _llseek(fd,
+ ((unsigned long long)offset) >> 32,
+ ((unsigned long long)offset) & 0xffffffff,
+ &result,
+ whence);
++#else
++ retval = syscall(__NR__llseek, fd,
++ ((unsigned long long)offset) >> 32,
++ ((unsigned long long)offset) & 0xffffffff,
++ &result,
++ whence);
++#endif
++
+ return (retval==-1 ? (loff_t) retval : result);
+ }
+
diff --git a/meta/recipes-extended/parted/parted_1.9.0.bb b/meta/recipes-extended/parted/parted_1.9.0.bb
new file mode 100644
index 0000000000..f2a265187f
--- /dev/null
+++ b/meta/recipes-extended/parted/parted_1.9.0.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "parted, the GNU partition resizing program"
+HOMEPAGE = "http://www.gnu.org/software/parted/parted.html"
+LICENSE = "GPLv2"
+SECTION = "console/tools"
+DEPENDS = "readline e2fsprogs"
+PR = "r3"
+
+SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.gz \
+ file://no_check.patch;patch=1 \
+ file://syscalls.patch;patch=1 "
+
+EXTRA_OECONF = "--disable-Werror --disable-device-mapper"
+
+inherit autotools pkgconfig gettext
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/polkit/polkit-gnome_0.96.bb b/meta/recipes-extended/polkit/polkit-gnome_0.96.bb
new file mode 100644
index 0000000000..e103e631c8
--- /dev/null
+++ b/meta/recipes-extended/polkit/polkit-gnome_0.96.bb
@@ -0,0 +1,18 @@
+HOMEPAGE = "http://www.packagekit.org/"
+DEPENDS = "polkit dbus-glib gconf gtk+"
+
+SRC_URI = "http://hal.freedesktop.org/releases/polkit-gnome-${PV}.tar.bz2 \
+ "
+
+EXTRA_OECONF = " --disable-scrollkeeper \
+ --disable-man-pages \
+ --disable-examples \
+ --disable-gtk-doc \
+ --disable-introspection "
+
+inherit autotools pkgconfig
+
+FILES_${PN} += " ${datadir}/dbus-1 \
+ ${datadir}/PolicyKit \
+ "
+
diff --git a/meta/recipes-extended/polkit/polkit_0.96.bb b/meta/recipes-extended/polkit/polkit_0.96.bb
new file mode 100644
index 0000000000..e6e030b19a
--- /dev/null
+++ b/meta/recipes-extended/polkit/polkit_0.96.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "The polkit package is an application-level toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes."
+HOMEPAGE = "http://code.google.com/p/polkit/"
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=155db86cdbafa7532b41f390409283eb \
+ file://src/polkit/polkit.h;md5=8aa8924570fc5570d20e4a4ad5d2db51 \
+ file://docs/polkit/html/license.html;md5=4c17ef1587e0f096c82157160d4e340e"
+
+SRC_URI = "http://hal.freedesktop.org/releases/polkit-${PV}.tar.gz"
+PR = "r2"
+DEPENDS = "libpam expat dbus-glib eggdbus intltool"
+RDEPENDS = "libpam"
+EXTRA_OECONF = "--with-authfw=pam --with-os-type=moblin --disable-man-pages --disable-gtk-doc --disable-introspection"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-extended/psmisc/files/libintl-link.patch b/meta/recipes-extended/psmisc/files/libintl-link.patch
new file mode 100644
index 0000000000..d9cdd90d71
--- /dev/null
+++ b/meta/recipes-extended/psmisc/files/libintl-link.patch
@@ -0,0 +1,29 @@
+uClibc needs to link against an external libintl but it doesn't do this by
+default. The configure script correctly figures out if this is needed, but
+doesn't actually link to the libraries it decides on. This makes it link to
+them if they are needed:
+
+--- psmisc-22.2/src/Makefile.am 2006/06/28 00:14:07 1.1
++++ psmisc-22.2/src/Makefile.am 2006/06/28 00:14:24
+@@ -5,15 +5,19 @@
+
+ oldfuser_SOURCES = oldfuser.c comm.h signals.c signals.h loop.h i18n.h
+
++oldfuser_LDADD = @INTLLIBS@
++
+ fuser_SOURCES = fuser.c comm.h signals.c signals.h i18n.h fuser.h
+
++fuser_LDADD = @INTLLIBS@
++
+ killall_SOURCES = killall.c comm.h signals.c signals.h i18n.h
+
+-killall_LDADD = @SELINUX_LIB@
++killall_LDADD = @SELINUX_LIB@ @INTLLIBS@
+
+ pstree_SOURCES = pstree.c comm.h i18n.h
+
+-pstree_LDADD = @TERMCAP_LIB@ @SELINUX_LIB@
++pstree_LDADD = @TERMCAP_LIB@ @SELINUX_LIB@ @INTLLIBS@
+
+ BUILT_SOURCES = signames.h
+
diff --git a/meta/recipes-extended/psmisc/psmisc.inc b/meta/recipes-extended/psmisc/psmisc.inc
new file mode 100644
index 0000000000..d489891d64
--- /dev/null
+++ b/meta/recipes-extended/psmisc/psmisc.inc
@@ -0,0 +1,55 @@
+LICENSE = "GPL"
+DESCRIPTION = "procfs tools"
+SECTION = "base"
+PRIORITY = "required"
+DEPENDS = "ncurses virtual/libintl"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz \
+ file://libintl-link.patch;patch=1"
+S = "${WORKDIR}/psmisc-${PV}"
+
+inherit autotools gettext
+
+ALLOW_EMPTY = "1"
+
+PACKAGES = "${PN} \
+ fuser-dbg fuser fuser-doc \
+ killall-dbg killall killall-doc \
+ pstree-dbg pstree pstree-doc"
+
+FILES_${PN} = ""
+RDEPENDS_${PN} = "fuser killall pstree"
+
+FILES_fuser = "${bindir}/fuser.${PN}"
+FILES_fuser-doc = "${mandir}/man1/fuser*"
+FILES_fuser-dbg = "${bindir}/.debug/fuser"
+
+FILES_killall = "${bindir}/killall.${PN}"
+FILES_killall-doc = "${mandir}/man1/killall*"
+FILES_killall-dbg = "${bindir}/.debug/killall*"
+
+FILES_pstree = "${bindir}/pstree"
+FILES_pstree-doc = "${mandir}/man1/pstree*"
+FILES_pstree-dbg = "${bindir}/.debug/pstree"
+
+do_install_append() {
+ mv ${D}${bindir}/killall ${D}${bindir}/killall.${PN}
+ mv ${D}${bindir}/fuser ${D}${bindir}/fuser.${PN}
+}
+
+pkg_postinst_killall() {
+ update-alternatives --install ${bindir}/killall killall killall.${PN} 90
+}
+
+pkg_postrm_killall() {
+ update-alternatives --remove ${bindir}/killall killall.${PN}
+}
+
+pkg_postinst_fuser() {
+ update-alternatives --install ${bindir}/fuser fuser fuser.${PN} 90
+}
+
+pkg_postrm_fuser() {
+ update-alternatives --remove ${bindir}/fuser fuser.${PN}
+}
+
diff --git a/meta/recipes-extended/psmisc/psmisc_22.2.bb b/meta/recipes-extended/psmisc/psmisc_22.2.bb
new file mode 100644
index 0000000000..62327fa4d6
--- /dev/null
+++ b/meta/recipes-extended/psmisc/psmisc_22.2.bb
@@ -0,0 +1,2 @@
+require psmisc.inc
+PR = "r1"
diff --git a/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch b/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
new file mode 100644
index 0000000000..d91960b3ee
--- /dev/null
+++ b/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
@@ -0,0 +1,16 @@
+Change the getline return type to match its declaration.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -urN sed-4.1.2-orig/lib/getline.c sed-4.1.2/lib/getline.c
+--- sed-4.1.2-orig/lib/getline.c 2010-08-31 08:47:50.070094024 +0800
++++ sed-4.1.2/lib/getline.c 2010-08-31 08:48:50.982178172 +0800
+@@ -30,7 +30,7 @@
+ necessary. Returns the number of characters read (not including the
+ null terminator), or -1 on error or EOF. */
+
+-size_t
++ssize_t
+ getline (lineptr, n, stream)
+ char **lineptr;
+ size_t *n;
diff --git a/meta/recipes-extended/sed/sed_4.1.2.bb b/meta/recipes-extended/sed/sed_4.1.2.bb
new file mode 100644
index 0000000000..09bd3e18cc
--- /dev/null
+++ b/meta/recipes-extended/sed/sed_4.1.2.bb
@@ -0,0 +1,32 @@
+DESCRIPTION = "sed is a Stream EDitor."
+HOMEPAGE = "http://www.gnu.org/software/sed/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://sed/sed.h;beginline=1;endline=17;md5=e00ffd1837f298439a214fd197f6a407"
+SECTION = "console/utils"
+PR = "r3"
+
+DEPENDS = "gettext"
+
+SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \
+ file://fix_return_type.patch"
+
+inherit autotools
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/sed ${D}${base_bindir}/sed.${PN}
+}
+
+
+pkg_postinst_${PN} () {
+ update-alternatives --install ${base_bindir}/sed sed sed.${PN} 100
+}
+
+
+pkg_prerm_${PN} () {
+ update-alternatives --remove sed sed.${PN}
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/sudo/files/autofoo.patch b/meta/recipes-extended/sudo/files/autofoo.patch
new file mode 100644
index 0000000000..4f24737610
--- /dev/null
+++ b/meta/recipes-extended/sudo/files/autofoo.patch
@@ -0,0 +1,143 @@
+# fix underquotes, rebased to 1.7.2p7
+#
+# by Kevin Tian <kevin.tian@intel.com>, 06/23/2010
+Index: sudo-1.7.2p7/aclocal.m4
+===================================================================
+--- sudo-1.7.2p7.orig/aclocal.m4 2010-06-23 13:33:57.000000000 +0800
++++ sudo-1.7.2p7/aclocal.m4 2010-06-23 13:36:41.000000000 +0800
+@@ -10,7 +10,7 @@
+ dnl
+ dnl check for sendmail
+ dnl
+-AC_DEFUN(SUDO_PROG_SENDMAIL, [AC_MSG_CHECKING(for sendmail)
++AC_DEFUN([SUDO_PROG_SENDMAIL], [AC_MSG_CHECKING(for sendmail)
+ if test -f "/usr/sbin/sendmail"; then
+ AC_MSG_RESULT(/usr/sbin/sendmail)
+ SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/sbin/sendmail")
+@@ -37,7 +37,7 @@
+ dnl
+ dnl check for vi
+ dnl
+-AC_DEFUN(SUDO_PROG_VI, [AC_MSG_CHECKING(for vi)
++AC_DEFUN([SUDO_PROG_VI], [AC_MSG_CHECKING(for vi)
+ if test -f "/usr/bin/vi"; then
+ AC_MSG_RESULT(/usr/bin/vi)
+ SUDO_DEFINE(_PATH_VI, "/usr/bin/vi")
+@@ -61,7 +61,7 @@
+ dnl
+ dnl check for mv
+ dnl
+-AC_DEFUN(SUDO_PROG_MV, [AC_MSG_CHECKING(for mv)
++AC_DEFUN([SUDO_PROG_MV], [AC_MSG_CHECKING(for mv)
+ if test -f "/usr/bin/mv"; then
+ AC_MSG_RESULT(/usr/bin/mv)
+ SUDO_DEFINE(_PATH_MV, "/usr/bin/mv")
+@@ -82,7 +82,7 @@
+ dnl
+ dnl check for bourne shell
+ dnl
+-AC_DEFUN(SUDO_PROG_BSHELL, [AC_MSG_CHECKING(for bourne shell)
++AC_DEFUN([SUDO_PROG_BSHELL], [AC_MSG_CHECKING(for bourne shell)
+ if test -f "/bin/sh"; then
+ AC_MSG_RESULT(/bin/sh)
+ SUDO_DEFINE(_PATH_BSHELL, "/bin/sh")
+@@ -115,7 +115,7 @@
+ dnl
+ dnl Where the log file goes, use /var/log if it exists, else /{var,usr}/adm
+ dnl
+-AC_DEFUN(SUDO_LOGFILE, [AC_MSG_CHECKING(for log file location)
++AC_DEFUN([SUDO_LOGFILE], [AC_MSG_CHECKING(for log file location)
+ if test -n "$with_logpath"; then
+ AC_MSG_RESULT($with_logpath)
+ SUDO_DEFINE_UNQUOTED(_PATH_SUDO_LOGFILE, "$with_logpath")
+@@ -136,7 +136,7 @@
+ dnl
+ dnl Where the log file goes, use /var/log if it exists, else /{var,usr}/adm
+ dnl
+-AC_DEFUN(SUDO_TIMEDIR, [AC_MSG_CHECKING(for timestamp file location)
++AC_DEFUN([SUDO_TIMEDIR], [AC_MSG_CHECKING(for timestamp file location)
+ if test -n "$with_timedir"; then
+ AC_MSG_RESULT($with_timedir)
+ SUDO_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$with_timedir")
+@@ -160,7 +160,7 @@
+ dnl SUDO_CHECK_TYPE(TYPE, DEFAULT)
+ dnl XXX - should require the check for unistd.h...
+ dnl
+-AC_DEFUN(SUDO_CHECK_TYPE,
++AC_DEFUN([SUDO_CHECK_TYPE],
+ [AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_MSG_CHECKING(for $1)
+ AC_CACHE_VAL(sudo_cv_type_$1,
+@@ -181,31 +181,31 @@
+ dnl
+ dnl Check for size_t declation
+ dnl
+-AC_DEFUN(SUDO_TYPE_SIZE_T,
++AC_DEFUN([SUDO_TYPE_SIZE_T],
+ [SUDO_CHECK_TYPE(size_t, int)])
+
+ dnl
+ dnl Check for ssize_t declation
+ dnl
+-AC_DEFUN(SUDO_TYPE_SSIZE_T,
++AC_DEFUN([SUDO_TYPE_SSIZE_T],
+ [SUDO_CHECK_TYPE(ssize_t, int)])
+
+ dnl
+ dnl Check for dev_t declation
+ dnl
+-AC_DEFUN(SUDO_TYPE_DEV_T,
++AC_DEFUN([SUDO_TYPE_DEV_T],
+ [SUDO_CHECK_TYPE(dev_t, int)])
+
+ dnl
+ dnl Check for ino_t declation
+ dnl
+-AC_DEFUN(SUDO_TYPE_INO_T,
++AC_DEFUN([SUDO_TYPE_INO_T],
+ [SUDO_CHECK_TYPE(ino_t, unsigned int)])
+
+ dnl
+ dnl check for working fnmatch(3)
+ dnl
+-AC_DEFUN(SUDO_FUNC_FNMATCH,
++AC_DEFUN([SUDO_FUNC_FNMATCH],
+ [AC_MSG_CHECKING([for working fnmatch with FNM_CASEFOLD])
+ AC_CACHE_VAL(sudo_cv_func_fnmatch,
+ [rm -f conftestdata; > conftestdata
+@@ -271,7 +271,7 @@
+ dnl
+ dnl check for sa_len field in struct sockaddr
+ dnl
+-AC_DEFUN(SUDO_SOCK_SA_LEN,
++AC_DEFUN([SUDO_SOCK_SA_LEN],
+ [AC_MSG_CHECKING(for sa_len field in struct sockaddr)
+ AC_CACHE_VAL(sudo_cv_sock_sa_len,
+ [AC_TRY_RUN([#include <sys/types.h>
+@@ -294,7 +294,7 @@
+ dnl we can't really trust UID_MAX or MAXUID since they may exist
+ dnl only for backwards compatibility.
+ dnl
+-AC_DEFUN(SUDO_UID_T_LEN,
++AC_DEFUN([SUDO_UID_T_LEN],
+ [AC_REQUIRE([AC_TYPE_UID_T])
+ AC_MSG_CHECKING(max length of uid_t)
+ AC_CACHE_VAL(sudo_cv_uid_t_len,
+@@ -327,7 +327,7 @@
+ dnl
+ dnl Check for presence of long long and for sizeof(long long) == sizeof(long)
+ dnl
+-AC_DEFUN(SUDO_TYPE_LONG_LONG,
++AC_DEFUN([SUDO_TYPE_LONG_LONG],
+ [AC_CHECK_TYPES(long long, [AC_DEFINE(HAVE_LONG_LONG, 1, [Define if your compiler supports the "long long" type.])]
+ [AC_MSG_CHECKING(for long and long long equivalence)
+ AC_CACHE_VAL(sudo_cv_type_long_is_quad,
+@@ -347,7 +347,7 @@
+ dnl
+ dnl append a libpath to an LDFLAGS style variable
+ dnl
+-AC_DEFUN(SUDO_APPEND_LIBPATH, [
++AC_DEFUN([SUDO_APPEND_LIBPATH], [
+ if test X"$with_rpath" = X"yes"; then
+ case "$host" in
+ *-*-hpux*) $1="${$1} -L$2 -Wl,+b,$2"
diff --git a/meta/recipes-extended/sudo/files/noexec-link.patch b/meta/recipes-extended/sudo/files/noexec-link.patch
new file mode 100644
index 0000000000..e0d35d0e25
--- /dev/null
+++ b/meta/recipes-extended/sudo/files/noexec-link.patch
@@ -0,0 +1,17 @@
+# libtool requires library's name to start with 'lib', or else error is reported. with "-module" option
+# that check is skipped
+#
+# comments added by Kevin Tian <kevin.tian@intel.com>, 06/23/2010
+Index: sudo-1.6.8p6/Makefile.in
+===================================================================
+--- sudo-1.6.8p6.orig/Makefile.in 2005-01-21 19:09:26.963276656 -0500
++++ sudo-1.6.8p6/Makefile.in 2005-01-21 19:16:11.918714072 -0500
+@@ -187,7 +187,7 @@
+ $(CC) -o $@ $(TESTOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS)
+
+ sudo_noexec.la: sudo_noexec.lo
+- $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir)
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -module -rpath $(noexecdir)
+
+ # Uncomment the following if you want "make distclean" to clean the parser
+ @DEV@PARSESRCS = sudo.tab.h sudo.tab.c lex.yy.c def_data.c def_data.h
diff --git a/meta/recipes-extended/sudo/files/nostrip.patch b/meta/recipes-extended/sudo/files/nostrip.patch
new file mode 100644
index 0000000000..3c71b4fd86
--- /dev/null
+++ b/meta/recipes-extended/sudo/files/nostrip.patch
@@ -0,0 +1,23 @@
+# this could be pushed upstream to allowing conditional strip. Now it's not applied.
+# we use sed in recipe for same purpose. Keep here as reminder for upstream
+#
+# comment added by Kevin Tian <kevin.tian@intel.com>, 07/01/2010
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+Index: sudo-1.6.8p5/Makefile.in
+===================================================================
+--- sudo-1.6.8p5.orig/Makefile.in 2005-01-21 18:19:05.762568976 -0500
++++ sudo-1.6.8p5/Makefile.in 2005-01-21 18:19:34.701169640 -0500
+@@ -307,8 +307,8 @@
+ $(DESTDIR)$(noexecdir)
+
+ install-binaries: $(PROGS)
+- $(INSTALL) $(install_owncmd) -m 4555 -s sudo $(DESTDIR)$(sudodir)/sudo
+- $(INSTALL) $(install_owncmd) -m 0555 -s visudo $(DESTDIR)$(visudodir)/visudo
++ $(INSTALL) $(install_owncmd) -m 4555 sudo $(DESTDIR)$(sudodir)/sudo
++ $(INSTALL) $(install_owncmd) -m 0555 visudo $(DESTDIR)$(visudodir)/visudo
+ rm -f $(DESTDIR)$(sudodir)/sudoedit
+ ln $(DESTDIR)$(sudodir)/sudo $(DESTDIR)$(sudodir)/sudoedit
+
diff --git a/meta/recipes-extended/sudo/site/bit-32 b/meta/recipes-extended/sudo/site/bit-32
new file mode 100644
index 0000000000..9b7ca5c81b
--- /dev/null
+++ b/meta/recipes-extended/sudo/site/bit-32
@@ -0,0 +1,2 @@
+# is sizeof(long long) == sizeof(long)
+sudo_cv_type_long_is_quad=${sudo_cv_type_long_is_quad=no}
diff --git a/meta/recipes-extended/sudo/site/bit-64 b/meta/recipes-extended/sudo/site/bit-64
new file mode 100644
index 0000000000..05846ff0aa
--- /dev/null
+++ b/meta/recipes-extended/sudo/site/bit-64
@@ -0,0 +1,2 @@
+# is sizeof(long long) == sizeof(long)
+sudo_cv_type_long_is_quad=${sudo_cv_type_long_is_quad=yes}
diff --git a/meta/recipes-extended/sudo/sudo.inc b/meta/recipes-extended/sudo/sudo.inc
new file mode 100644
index 0000000000..2add94bef4
--- /dev/null
+++ b/meta/recipes-extended/sudo/sudo.inc
@@ -0,0 +1,36 @@
+DESCRIPTION = "Sudo (superuser do) allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root while logging all commands and arguments."
+HOMEPAGE = "http://www.courtesan.com/sudo/"
+BUGTRACKER = "http://www.sudo.ws/bugs/"
+PRIORITY = "optional"
+SECTION = "admin"
+LICENSE = "ISC & UCB & MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a7dfe8895011d65d0c2e24aaf5ad0843 \
+ file://nonunix.h;startline=4;endline=28;md5=1e70feedac93a3fd7f5254e3fec52677 \
+ file://vasgroups.c;startline=4;endline=28;md5=1e70feedac93a3fd7f5254e3fec52677 \
+ file://fnmatch.c;startline=6;endline=31;md5=0779058eafd6e23b966585b45bfa54f3 \
+ file://getcwd.c;startline=5;endline=27;md5=08d82914995224a0ca42116d7ca2a218 \
+ file://glob.c;startline=6;endline=31;md5=299cb38ec8d56e89118ce57fb83b4f78 \
+ file://snprintf.c;startline=6;endline=31;md5=dabd56a89a7a773850dc06ee4f1ecde2"
+
+inherit autotools
+
+EXTRA_OECONF = "--with-editor=/bin/vi --with-env-editor"
+
+do_configure_prepend () {
+ # Prevent binaries from being stripped on the host
+ sed -i 's/\($(INSTALL).*\) -s \(.*[(sudo|visudo)]\)/\1 \2/g' Makefile.in
+
+ rm -f acsite.m4
+ if [ ! -e acinclude.m4 ]; then
+ cat aclocal.m4 > acinclude.m4
+ fi
+}
+
+pkg_postinst() {
+ if [ "x$D" != "x" ]; then
+ exit 1
+ fi
+
+ chmod 4111 /usr/bin/sudo
+ chmod 0440 /etc/sudoers
+}
diff --git a/meta/recipes-extended/sudo/sudo_1.7.2p7.bb b/meta/recipes-extended/sudo/sudo_1.7.2p7.bb
new file mode 100644
index 0000000000..3dd6cdf059
--- /dev/null
+++ b/meta/recipes-extended/sudo/sudo_1.7.2p7.bb
@@ -0,0 +1,7 @@
+PR = "r0"
+
+SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-1.7.2p7.tar.gz \
+ file://noexec-link.patch"
+
+require sudo.inc
+EXTRA_OECONF += " --with-pam=no"
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff
new file mode 100644
index 0000000000..ff60a843e4
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff
@@ -0,0 +1,75 @@
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 1995-01-30 19:51:47.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-09 16:59:45.000000000 +0200
+@@ -173,7 +173,7 @@
+ Patterns like these can be used when the machine has different internet
+ addresses with different internet hostnames. Service providers can use
+ this facility to offer FTP, GOPHER or WWW archives with internet names
+-that may even belong to different organizations. See also the `twist'
++that may even belong to different organizations. See also the `twist\'
+ option in the hosts_options(5) document. Some systems (Solaris,
+ FreeBSD) can have more than one internet address on one physical
+ interface; with other systems you may have to resort to SLIP or PPP
+@@ -236,10 +236,10 @@
+ Before accepting a client request, the wrappers can use the IDENT
+ service to find out that the client did not send the request at all.
+ When the client host provides IDENT service, a negative IDENT lookup
+-result (the client matches `UNKNOWN@host') is strong evidence of a host
++result (the client matches `UNKNOWN@host\') is strong evidence of a host
+ spoofing attack.
+ .PP
+-A positive IDENT lookup result (the client matches `KNOWN@host') is
++A positive IDENT lookup result (the client matches `KNOWN@host\') is
+ less trustworthy. It is possible for an intruder to spoof both the
+ client connection and the IDENT lookup, although doing so is much
+ harder than spoofing just a client connection. It may also be that
+diff -ruN tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5
+--- tcp_wrappers_7.6.orig/hosts_options.5 1994-12-28 17:42:29.000000000 +0100
++++ tcp_wrappers_7.6/hosts_options.5 2004-04-09 16:59:49.000000000 +0200
+@@ -124,7 +124,7 @@
+ value is taken.
+ .SH MISCELLANEOUS
+ .IP "banners /some/directory"
+-Look for a file in `/some/directory' with the same name as the daemon
++Look for a file in `/some/directory\' with the same name as the daemon
+ process (for example in.telnetd for the telnet service), and copy its
+ contents to the client. Newline characters are replaced by
+ carriage-return newline, and %<letter> sequences are expanded (see
+diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8
+--- tcp_wrappers_7.6.orig/tcpdmatch.8 1996-02-11 17:01:36.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.8 2004-04-09 17:00:49.000000000 +0200
+@@ -26,7 +26,7 @@
+ A daemon process name. Typically, the last component of a daemon
+ executable pathname.
+ .IP client
+-A host name or network address, or one of the `unknown' or `paranoid'
++A host name or network address, or one of the `unknown\' or `paranoid\'
+ wildcard patterns.
+ .sp
+ When a client host name is specified, \fItcpdmatch\fR gives a
+@@ -37,13 +37,13 @@
+ .PP
+ Optional information specified with the \fIdaemon@server\fR form:
+ .IP server
+-A host name or network address, or one of the `unknown' or `paranoid'
+-wildcard patterns. The default server name is `unknown'.
++A host name or network address, or one of the `unknown\' or `paranoid\'
++wildcard patterns. The default server name is `unknown\'.
+ .PP
+ Optional information specified with the \fIuser@client\fR form:
+ .IP user
+ A client user identifier. Typically, a login name or a numeric userid.
+-The default user name is `unknown'.
++The default user name is `unknown\'.
+ .SH OPTIONS
+ .IP -d
+ Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current
+@@ -70,7 +70,7 @@
+ .ti +5
+ tcpdmatch in.telnetd paranoid
+ .PP
+-On some systems, daemon names have no `in.' prefix, or \fItcpdmatch\fR
++On some systems, daemon names have no `in.\' prefix, or \fItcpdmatch\fR
+ may need some help to locate the inetd configuration file.
+ .SH FILES
+ .PP
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch
new file mode 100644
index 0000000000..4963f82eb8
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch
@@ -0,0 +1,248 @@
+diff -ruNp tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3
+--- tcp_wrappers_7.6.orig/hosts_access.3 2005-03-09 18:30:25.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.3 2005-03-09 18:27:03.000000000 +0100
+@@ -3,7 +3,7 @@
+ hosts_access, hosts_ctl, request_init, request_set \- access control library
+ .SH SYNOPSIS
+ .nf
+-#include "tcpd.h"
++#include <tcpd.h>
+
+ extern int allow_severity;
+ extern int deny_severity;
+diff -ruNp tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2005-03-09 18:30:25.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5 2005-03-09 18:30:18.000000000 +0100
+@@ -8,9 +8,9 @@ name, host name/address) patterns. Exam
+ impatient reader is encouraged to skip to the EXAMPLES section for a
+ quick introduction.
+ .PP
+-An extended version of the access control language is described in the
+-\fIhosts_options\fR(5) document. The extensions are turned on at
+-program build time by building with -DPROCESS_OPTIONS.
++The extended version of the access control language is described in the
++\fIhosts_options\fR(5) document. \fBNote that this language supersedes
++the meaning of \fIshell_command\fB as documented below.\fR
+ .PP
+ In the following text, \fIdaemon\fR is the the process name of a
+ network daemon process, and \fIclient\fR is the name and/or address of
+@@ -346,8 +346,8 @@ in.tftpd: LOCAL, .my.domain
+ /etc/hosts.deny:
+ .in +3
+ .nf
+-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
+- /usr/ucb/mail -s %d-%h root) &
++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
++ /usr/bin/mail -s %d-%h root) &
+ .fi
+ .PP
+ The safe_finger command comes with the tcpd wrapper and should be
+@@ -383,6 +383,7 @@ that shouldn\'t. All problems are repor
+ .fi
+ .SH SEE ALSO
+ .nf
++hosts_options(5) extended syntax.
+ tcpd(8) tcp/ip daemon wrapper program.
+ tcpdchk(8), tcpdmatch(8), test programs.
+ .SH BUGS
+diff -ruNp tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5
+--- tcp_wrappers_7.6.orig/hosts_options.5 2005-03-09 18:30:24.000000000 +0100
++++ tcp_wrappers_7.6/hosts_options.5 2005-03-09 18:27:03.000000000 +0100
+@@ -2,10 +2,8 @@
+ .SH NAME
+ hosts_options \- host access control language extensions
+ .SH DESCRIPTION
+-This document describes optional extensions to the language described
+-in the hosts_access(5) document. The extensions are enabled at program
+-build time. For example, by editing the Makefile and turning on the
+-PROCESS_OPTIONS compile-time option.
++This document describes extensions to the language described
++in the hosts_access(5) document.
+ .PP
+ The extensible language uses the following format:
+ .sp
+@@ -58,12 +56,12 @@ Notice the leading dot on the domain nam
+ Execute, in a child process, the specified shell command, after
+ performing the %<letter> expansions described in the hosts_access(5)
+ manual page. The command is executed with stdin, stdout and stderr
+-connected to the null device, so that it won\'t mess up the
++connected to the null device, so that it won't mess up the
+ conversation with the client host. Example:
+ .sp
+ .nf
+ .ti +3
+-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
+ .fi
+ .sp
+ executes, in a background child process, the shell command "safe_finger
+diff -ruNp tcp_wrappers_7.6.orig/inetcf.c tcp_wrappers_7.6/inetcf.c
+--- tcp_wrappers_7.6.orig/inetcf.c 1997-02-12 02:13:24.000000000 +0100
++++ tcp_wrappers_7.6/inetcf.c 2005-03-09 18:27:03.000000000 +0100
+@@ -26,13 +26,17 @@ extern void exit();
+ * guesses. Shorter names follow longer ones.
+ */
+ char *inet_files[] = {
++#if 0
+ "/private/etc/inetd.conf", /* NEXT */
+ "/etc/inet/inetd.conf", /* SYSV4 */
+ "/usr/etc/inetd.conf", /* IRIX?? */
++#endif
+ "/etc/inetd.conf", /* BSD */
++#if 0
+ "/etc/net/tlid.conf", /* SYSV4?? */
+ "/etc/saf/tlid.conf", /* SYSV4?? */
+ "/etc/tlid.conf", /* SYSV4?? */
++#endif
+ 0,
+ };
+
+diff -ruNp tcp_wrappers_7.6.orig/tcpd.8 tcp_wrappers_7.6/tcpd.8
+--- tcp_wrappers_7.6.orig/tcpd.8 1996-02-21 16:39:16.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.8 2005-03-09 18:27:03.000000000 +0100
+@@ -12,7 +12,11 @@ The program supports both 4.3BSD-style s
+ TLI. Functionality may be limited when the protocol underneath TLI is
+ not an internet protocol.
+ .PP
+-Operation is as follows: whenever a request for service arrives, the
++There are two possible modes of operation: execution of \fItcpd\fP
++before a service started by \fIinetd\fP, or linking a daemon with
++the \fIlibwrap\fP shared library as documented in the \fIhosts_access\fR(3)
++manual page. Operation when started by \fIinetd\fP
++is as follows: whenever a request for service arrives, the
+ \fIinetd\fP daemon is tricked into running the \fItcpd\fP program
+ instead of the desired server. \fItcpd\fP logs the request and does
+ some additional checks. When all is well, \fItcpd\fP runs the
+@@ -88,11 +92,11 @@ configuration files.
+ .sp
+ .in +5
+ # mkdir /other/place
+-# mv /usr/etc/in.fingerd /other/place
+-# cp tcpd /usr/etc/in.fingerd
++# mv /usr/sbin/in.fingerd /other/place
++# cp tcpd /usr/sbin/in.fingerd
+ .fi
+ .PP
+-The example assumes that the network daemons live in /usr/etc. On some
++The example assumes that the network daemons live in /usr/sbin. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, or have
+ no `in.\' prefix to their name.
+ .SH EXAMPLE 2
+@@ -101,35 +105,34 @@ are left in their original place.
+ .PP
+ In order to monitor access to the \fIfinger\fR service, perform the
+ following edits on the \fIinetd\fR configuration file (usually
+-\fI/etc/inetd.conf\fR or \fI/etc/inet/inetd.conf\fR):
++\fI/etc/inetd.conf\fR):
+ .nf
+ .sp
+ .ti +5
+-finger stream tcp nowait nobody /usr/etc/in.fingerd in.fingerd
++finger stream tcp nowait nobody /usr/sbin/in.fingerd in.fingerd
+ .sp
+ becomes:
+ .sp
+ .ti +5
+-finger stream tcp nowait nobody /some/where/tcpd in.fingerd
++finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd
+ .sp
+ .fi
+ .PP
+-The example assumes that the network daemons live in /usr/etc. On some
++The example assumes that the network daemons live in /usr/sbin. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, the
+ daemons have no `in.\' prefix to their name, or there is no userid
+ field in the inetd configuration file.
+ .PP
+ Similar changes will be needed for the other services that are to be
+ covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8)
+-process to make the changes effective. AIX users may also have to
+-execute the `inetimp\' command.
++process to make the changes effective.
+ .SH EXAMPLE 3
+ In the case of daemons that do not live in a common directory ("secret"
+ or otherwise), edit the \fIinetd\fR configuration file so that it
+ specifies an absolute path name for the process name field. For example:
+ .nf
+ .sp
+- ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd
++ ntalk dgram udp wait root /usr/sbin/tcpd /usr/local/lib/ntalkd
+ .sp
+ .fi
+ .PP
+@@ -164,6 +167,7 @@ The default locations of the host access
+ .SH SEE ALSO
+ .na
+ .nf
++hosts_access(3), functions provided by the libwrap library.
+ hosts_access(5), format of the tcpd access control tables.
+ syslog.conf(5), format of the syslogd control file.
+ inetd.conf(5), format of the inetd control file.
+diff -ruNp tcp_wrappers_7.6.orig/tcpdchk.8 tcp_wrappers_7.6/tcpdchk.8
+--- tcp_wrappers_7.6.orig/tcpdchk.8 1995-01-08 17:00:31.000000000 +0100
++++ tcp_wrappers_7.6/tcpdchk.8 2005-03-09 18:27:03.000000000 +0100
+@@ -9,8 +9,8 @@ tcpdchk [-a] [-d] [-i inet_conf] [-v]
+ potential and real problems it can find. The program examines the
+ \fItcpd\fR access control files (by default, these are
+ \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR), and compares the
+-entries in these files against entries in the \fIinetd\fR or \fItlid\fR
+-network configuration files.
++entries in these files against entries in the \fIinetd\fR
++network configuration file.
+ .PP
+ \fItcpdchk\fR reports problems such as non-existent pathnames; services
+ that appear in \fItcpd\fR access control rules, but are not controlled
+@@ -26,14 +26,13 @@ problem.
+ .SH OPTIONS
+ .IP -a
+ Report access control rules that permit access without an explicit
+-ALLOW keyword. This applies only when the extended access control
+-language is enabled (build with -DPROCESS_OPTIONS).
++ALLOW keyword.
+ .IP -d
+ Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current
+ directory instead of the default ones.
+ .IP "-i inet_conf"
+ Specify this option when \fItcpdchk\fR is unable to find your
+-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when
++\fIinetd.conf\fR network configuration file, or when
+ you suspect that the program uses the wrong one.
+ .IP -v
+ Display the contents of each access control rule. Daemon lists, client
+@@ -54,7 +53,6 @@ tcpdmatch(8), explain what tcpd would do
+ hosts_access(5), format of the tcpd access control tables.
+ hosts_options(5), format of the language extensions.
+ inetd.conf(5), format of the inetd control file.
+-tlid.conf(5), format of the tlid control file.
+ .SH AUTHORS
+ .na
+ .nf
+diff -ruNp tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8
+--- tcp_wrappers_7.6.orig/tcpdmatch.8 2005-03-09 18:30:24.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.8 2005-03-09 18:27:03.000000000 +0100
+@@ -13,7 +13,7 @@ request for service. Examples are given
+ The program examines the \fItcpd\fR access control tables (default
+ \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR) and prints its
+ conclusion. For maximal accuracy, it extracts additional information
+-from your \fIinetd\fR or \fItlid\fR network configuration file.
++from your \fIinetd\fR network configuration file.
+ .PP
+ When \fItcpdmatch\fR finds a match in the access control tables, it
+ identifies the matched rule. In addition, it displays the optional
+@@ -50,7 +50,7 @@ Examine \fIhosts.allow\fR and \fIhosts.d
+ directory instead of the default ones.
+ .IP "-i inet_conf"
+ Specify this option when \fItcpdmatch\fR is unable to find your
+-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when
++\fIinetd.conf\fR network configuration file, or when
+ you suspect that the program uses the wrong one.
+ .SH EXAMPLES
+ To predict how \fItcpd\fR would handle a telnet request from the local
+@@ -86,7 +86,6 @@ tcpdchk(8), tcpd configuration checker
+ hosts_access(5), format of the tcpd access control tables.
+ hosts_options(5), format of the language extensions.
+ inetd.conf(5), format of the inetd control file.
+-tlid.conf(5), format of the tlid control file.
+ .SH AUTHORS
+ .na
+ .nf
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch
new file mode 100644
index 0000000000..a168f6d5a5
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch
@@ -0,0 +1,103 @@
+See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=17847
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 18:54:33.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 18:54:27.000000000 +0200
+@@ -89,6 +89,10 @@
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
++.IP \(bu
++Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This
++method of matching cannot be used in conjunction with `net/mask\' matching,
++hostname matching beginning with `.\' or IP address matching ending with `.\'.
+ .SH WILDCARDS
+ The access control language supports explicit wildcards:
+ .IP ALL
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 1997-02-12 02:13:23.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 18:52:21.000000000 +0200
+@@ -289,6 +289,11 @@
+ {
+ int n;
+
++#ifndef DISABLE_WILDCARD_MATCHING
++ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */
++ return (match_pattern_ylo(string,tok));
++ } else
++#endif
+ if (tok[0] == '.') { /* suffix */
+ n = strlen(string) - strlen(tok);
+ return (n > 0 && STR_EQ(tok, string + n));
+@@ -329,3 +334,71 @@
+ }
+ return ((addr & mask) == net);
+ }
++
++#ifndef DISABLE_WILDCARD_MATCHING
++/* Note: this feature has been adapted in a pretty straightforward way
++ from Tatu Ylonen's last SSH version under free license by
++ Pekka Savola <pekkas@netcore.fi>.
++
++ Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
++*/
++
++/* Returns true if the given string matches the pattern (which may contain
++ ? and * as wildcards), and zero if it does not match. */
++
++int match_pattern_ylo(const char *s, const char *pattern)
++{
++ while (1)
++ {
++ /* If at end of pattern, accept if also at end of string. */
++ if (!*pattern)
++ return !*s;
++
++ /* Process '*'. */
++ if (*pattern == '*')
++ {
++ /* Skip the asterisk. */
++ pattern++;
++
++ /* If at end of pattern, accept immediately. */
++ if (!*pattern)
++ return 1;
++
++ /* If next character in pattern is known, optimize. */
++ if (*pattern != '?' && *pattern != '*')
++ {
++ /* Look instances of the next character in pattern, and try
++ to match starting from those. */
++ for (; *s; s++)
++ if (*s == *pattern &&
++ match_pattern_ylo(s + 1, pattern + 1))
++ return 1;
++ /* Failed. */
++ return 0;
++ }
++
++ /* Move ahead one character at a time and try to match at each
++ position. */
++ for (; *s; s++)
++ if (match_pattern_ylo(s, pattern))
++ return 1;
++ /* Failed. */
++ return 0;
++ }
++
++ /* There must be at least one more character in the string. If we are
++ at the end, fail. */
++ if (!*s)
++ return 0;
++
++ /* Check if the next character of the string is acceptable. */
++ if (*pattern != '?' && *pattern != *s)
++ return 0;
++
++ /* Move to the next character, both in string and in pattern. */
++ s++;
++ pattern++;
++ }
++ /*NOTREACHED*/
++}
++#endif /* DISABLE_WILDCARD_MATCHING */
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
new file mode 100644
index 0000000000..d06aaef13b
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
@@ -0,0 +1,30 @@
+* Mon Feb 5 2001 Preston Brown <pbrown@redhat.com>
+- fix gethostbyname to work better with dot "." notation (#16949)
+
+--- tcp_wrappers_7.6/socket.c.fixgethostbyname Fri Mar 21 13:27:25 1997
++++ tcp_wrappers_7.6/socket.c Mon Feb 5 14:09:40 2001
+@@ -52,7 +52,8 @@
+ char *name;
+ {
+ char dot_name[MAXHOSTNAMELEN + 1];
+-
++ struct hostent *hp;
++
+ /*
+ * Don't append dots to unqualified names. Such names are likely to come
+ * from local hosts files or from NIS.
+@@ -61,8 +62,12 @@
+ if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) {
+ return (gethostbyname(name));
+ } else {
+- sprintf(dot_name, "%s.", name);
+- return (gethostbyname(dot_name));
++ sprintf(dot_name, "%s.", name);
++ hp = gethostbyname(dot_name);
++ if (hp)
++ return hp;
++ else
++ return (gethostbyname(name));
+ }
+ }
+
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch
new file mode 100644
index 0000000000..5c8be5c27c
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch
@@ -0,0 +1,1253 @@
+diff -ruN tcp_wrappers_7.6.orig/fix_options.c tcp_wrappers_7.6/fix_options.c
+--- tcp_wrappers_7.6.orig/fix_options.c 1997-04-08 02:29:19.000000000 +0200
++++ tcp_wrappers_7.6/fix_options.c 2004-04-10 19:07:43.000000000 +0200
+@@ -11,6 +11,9 @@
+
+ #include <sys/types.h>
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <netinet/in_systm.h>
+ #include <netinet/ip.h>
+@@ -41,6 +44,22 @@
+ unsigned int opt;
+ int optlen;
+ struct in_addr dummy;
++#ifdef INET6
++ struct sockaddr_storage ss;
++ int sslen;
++
++ /*
++ * check if this is AF_INET socket
++ * XXX IPv6 support?
++ */
++ sslen = sizeof(ss);
++ if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) {
++ syslog(LOG_ERR, "getpeername: %m");
++ clean_exit(request);
++ }
++ if (ss.ss_family != AF_INET)
++ return;
++#endif
+
+ if ((ip = getprotobyname("ip")) != 0)
+ ipproto = ip->p_proto;
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:07:43.000000000 +0200
+@@ -85,11 +85,18 @@
+ for daemon process names or for client user names.
+ .IP \(bu
+ An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
+-`net/mask\' pair. A host address is matched if `net\' is equal to the
++`net/mask\' pair. An IPv4 host address is matched if `net\' is equal to the
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
+ .IP \(bu
++An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a
++`[net]/prefixlen\' pair. An IPv6 host address is matched if
++`prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the
++address. For example, the [net]/prefixlen pattern
++`[3ffe:505:2:1::]/64\' matches every address in the range
++`3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'.
++.IP \(bu
+ Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This
+ method of matching cannot be used in conjunction with `net/mask\' matching,
+ hostname matching beginning with `.\' or IP address matching ending with `.\'.
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:07:43.000000000 +0200
+@@ -24,7 +24,13 @@
+ /* System libraries. */
+
+ #include <sys/types.h>
++#ifdef INT32_T
++ typedef uint32_t u_int32_t;
++#endif
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -33,6 +39,9 @@
+ #include <errno.h>
+ #include <setjmp.h>
+ #include <string.h>
++#ifdef INET6
++#include <netdb.h>
++#endif
+
+ extern char *fgets();
+ extern int errno;
+@@ -82,6 +91,10 @@
+ static int host_match();
+ static int string_match();
+ static int masked_match();
++#ifdef INET6
++static int masked_match4();
++static int masked_match6();
++#endif
+
+ /* Size of logical line buffer. */
+
+@@ -289,6 +302,13 @@
+ {
+ int n;
+
++#ifdef INET6
++ /* convert IPv4 mapped IPv6 address to IPv4 address */
++ if (STRN_EQ(string, "::ffff:", 7)
++ && dot_quad_addr(string + 7) != INADDR_NONE) {
++ string += 7;
++ }
++#endif
+ #ifndef DISABLE_WILDCARD_MATCHING
+ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */
+ return (match_pattern_ylo(string,tok));
+@@ -304,20 +324,72 @@
+ } else if (tok[(n = strlen(tok)) - 1] == '.') { /* prefix */
+ return (STRN_EQ(tok, string, n));
+ } else { /* exact match */
++#ifdef INET6
++ struct addrinfo hints, *res;
++ struct sockaddr_in6 pat, addr;
++ int len, ret;
++ char ch;
++
++ len = strlen(tok);
++ if (*tok == '[' && tok[len - 1] == ']') {
++ ch = tok[len - 1];
++ tok[len - 1] = '\0';
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if ((ret = getaddrinfo(tok + 1, NULL, &hints, &res)) == 0) {
++ memcpy(&pat, res->ai_addr, sizeof(pat));
++ freeaddrinfo(res);
++ }
++ tok[len - 1] = ch;
++ if (ret != 0 || getaddrinfo(string, NULL, &hints, &res) != 0)
++ return NO;
++ memcpy(&addr, res->ai_addr, sizeof(addr));
++ freeaddrinfo(res);
++#ifdef NI_WITHSCOPEID
++ if (pat.sin6_scope_id != 0 &&
++ addr.sin6_scope_id != pat.sin6_scope_id)
++ return NO;
++#endif
++ return (!memcmp(&pat.sin6_addr, &addr.sin6_addr,
++ sizeof(struct in6_addr)));
++ return (ret);
++ }
++#endif
+ return (STR_EQ(tok, string));
+ }
+ }
+
+ /* masked_match - match address against netnumber/netmask */
+
++#ifdef INET6
+ static int masked_match(net_tok, mask_tok, string)
+ char *net_tok;
+ char *mask_tok;
+ char *string;
+ {
++ return (masked_match4(net_tok, mask_tok, string) ||
++ masked_match6(net_tok, mask_tok, string));
++}
++
++static int masked_match4(net_tok, mask_tok, string)
++#else
++static int masked_match(net_tok, mask_tok, string)
++#endif
++char *net_tok;
++char *mask_tok;
++char *string;
++{
++#ifdef INET6
++ u_int32_t net;
++ u_int32_t mask;
++ u_int32_t addr;
++#else
+ unsigned long net;
+ unsigned long mask;
+ unsigned long addr;
++#endif
+
+ /*
+ * Disallow forms other than dotted quad: the treatment that inet_addr()
+@@ -329,12 +401,78 @@
+ return (NO);
+ if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+ || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++#ifndef INET6
+ tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
++#endif
+ return (NO); /* not tcpd_jump() */
+ }
+ return ((addr & mask) == net);
+ }
+
++#ifdef INET6
++static int masked_match6(net_tok, mask_tok, string)
++char *net_tok;
++char *mask_tok;
++char *string;
++{
++ struct addrinfo hints, *res;
++ struct sockaddr_in6 net, addr;
++ u_int32_t mask;
++ int len, mask_len, i = 0;
++ char ch;
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(string, NULL, &hints, &res) != 0)
++ return NO;
++ memcpy(&addr, res->ai_addr, sizeof(addr));
++ freeaddrinfo(res);
++
++ if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) {
++ if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE
++ || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE)
++ return (NO);
++ return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]);
++ }
++
++ /* match IPv6 address against netnumber/prefixlen */
++ len = strlen(net_tok);
++ if (*net_tok != '[' || net_tok[len - 1] != ']')
++ return NO;
++ ch = net_tok[len - 1];
++ net_tok[len - 1] = '\0';
++ if (getaddrinfo(net_tok + 1, NULL, &hints, &res) != 0) {
++ net_tok[len - 1] = ch;
++ return NO;
++ }
++ memcpy(&net, res->ai_addr, sizeof(net));
++ freeaddrinfo(res);
++ net_tok[len - 1] = ch;
++ if ((mask_len = atoi(mask_tok)) < 0 || mask_len > 128)
++ return NO;
++
++#ifdef NI_WITHSCOPEID
++ if (net.sin6_scope_id != 0 && addr.sin6_scope_id != net.sin6_scope_id)
++ return NO;
++#endif
++ while (mask_len > 0) {
++ if (mask_len < 32) {
++ mask = htonl(~(0xffffffff >> mask_len));
++ if ((*(u_int32_t *)&addr.sin6_addr.s6_addr[i] & mask) != (*(u_int32_t *)&net.sin6_addr.s6_addr[i] & mask))
++ return NO;
++ break;
++ }
++ if (*(u_int32_t *)&addr.sin6_addr.s6_addr[i] != *(u_int32_t *)&net.sin6_addr.s6_addr[i])
++ return NO;
++ i += 4;
++ mask_len -= 32;
++ }
++ return YES;
++}
++#endif /* INET6 */
++
+ #ifndef DISABLE_WILDCARD_MATCHING
+ /* Note: this feature has been adapted in a pretty straightforward way
+ from Tatu Ylonen's last SSH version under free license by
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile 1997-03-21 19:27:21.000000000 +0100
++++ tcp_wrappers_7.6/Makefile 2004-04-10 19:22:44.000000000 +0200
+@@ -21,7 +21,7 @@
+ @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
+ @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
+ @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
+- @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
++ @echo " sunos40 sunos5 solaris8 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
+ @echo " uts215 uxp"
+ @echo
+ @echo "If none of these match your environment, edit the system"
+@@ -131,20 +131,34 @@
+ NETGROUP=-DNETGROUP TLI= SYSTYPE="-systype bsd43" all
+
+ # Freebsd and linux by default have no NIS.
+-386bsd netbsd bsdos:
++386bsd bsdos:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+ EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
+
+ freebsd:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS="-L/usr/local/v6/lib -linet6" \
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+- EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" \
++ VSYSLOG= all
++
++netbsd:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" VSYSLOG= all
+
+ linux:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
+- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
++
++gnu:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all
+
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -196,6 +210,13 @@
+ NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
+ BUGS="$(BUGS) -DSOLARIS_24_GETHOSTBYNAME_BUG" all
+
++# SunOS 5.8 is another SYSV4 variant, but has IPv6 support
++solaris8:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv VSYSLOG= \
++ NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
++ EXTRA_CFLAGS="-DINET6 -DNO_CLONE_DEVICE -DINT32_T" all
++
+ # Generic SYSV40
+ esix sysv4:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c
+--- tcp_wrappers_7.6.orig/misc.c 1996-02-11 17:01:30.000000000 +0100
++++ tcp_wrappers_7.6/misc.c 2004-04-10 19:07:43.000000000 +0200
+@@ -58,9 +58,31 @@
+ {
+ char *cp;
+
++#ifdef INET6
++ int bracket = 0;
++
++ for (cp = string; cp && *cp; cp++) {
++ switch (*cp) {
++ case '[':
++ bracket++;
++ break;
++ case ']':
++ bracket--;
++ break;
++ default:
++ if (bracket == 0 && *cp == delimiter) {
++ *cp++ = 0;
++ return cp;
++ }
++ break;
++ }
++ }
++ return (NULL);
++#else
+ if ((cp = strchr(string, delimiter)) != 0)
+ *cp++ = 0;
+ return (cp);
++#endif
+ }
+
+ /* dot_quad_addr - convert dotted quad to internal form */
+diff -ruN tcp_wrappers_7.6.orig/refuse.c tcp_wrappers_7.6/refuse.c
+--- tcp_wrappers_7.6.orig/refuse.c 1994-12-28 17:42:40.000000000 +0100
++++ tcp_wrappers_7.6/refuse.c 2004-04-10 19:07:43.000000000 +0200
+@@ -25,7 +25,12 @@
+ void refuse(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ syslog(deny_severity, "refused connect from %s (%s)",
++ eval_client(request), eval_hostaddr(request->client));
++#else
+ syslog(deny_severity, "refused connect from %s", eval_client(request));
++#endif
+ clean_exit(request);
+ /* NOTREACHED */
+ }
+diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c 1995-01-02 16:11:34.000000000 +0100
++++ tcp_wrappers_7.6/rfc931.c 2004-04-10 19:07:43.000000000 +0200
+@@ -68,20 +68,50 @@
+ /* rfc931 - return remote user name, given socket structures */
+
+ void rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
+ struct sockaddr_in *rmt_sin;
+ struct sockaddr_in *our_sin;
++#endif
+ char *dest;
+ {
+ unsigned rmt_port;
+ unsigned our_port;
++#ifdef INET6
++ struct sockaddr_storage rmt_query_sin;
++ struct sockaddr_storage our_query_sin;
++ int alen;
++#else
+ struct sockaddr_in rmt_query_sin;
+ struct sockaddr_in our_query_sin;
++#endif
+ char user[256]; /* XXX */
+ char buffer[512]; /* XXX */
+ char *cp;
+ char *result = unknown;
+ FILE *fp;
+
++#ifdef INET6
++ /* address family must be the same */
++ if (rmt_sin->sa_family != our_sin->sa_family) {
++ STRN_CPY(dest, result, STRING_LENGTH);
++ return;
++ }
++ switch (our_sin->sa_family) {
++ case AF_INET:
++ alen = sizeof(struct sockaddr_in);
++ break;
++ case AF_INET6:
++ alen = sizeof(struct sockaddr_in6);
++ break;
++ default:
++ STRN_CPY(dest, result, STRING_LENGTH);
++ return;
++ }
++#endif
++
+ /*
+ * Use one unbuffered stdio stream for writing to and for reading from
+ * the RFC931 etc. server. This is done because of a bug in the SunOS
+@@ -92,7 +122,11 @@
+ * sockets.
+ */
+
++#ifdef INET6
++ if ((fp = fsocket(our_sin->sa_family, SOCK_STREAM, 0)) != 0) {
++#else
+ if ((fp = fsocket(AF_INET, SOCK_STREAM, 0)) != 0) {
++#endif
+ setbuf(fp, (char *) 0);
+
+ /*
+@@ -112,6 +146,25 @@
+ * addresses from the query socket.
+ */
+
++#ifdef INET6
++ memcpy(&our_query_sin, our_sin, alen);
++ memcpy(&rmt_query_sin, rmt_sin, alen);
++ switch (our_sin->sa_family) {
++ case AF_INET:
++ ((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT);
++ ((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC931_PORT);
++ break;
++ case AF_INET6:
++ ((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT);
++ ((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC931_PORT);
++ break;
++ }
++
++ if (bind(fileno(fp), (struct sockaddr *) & our_query_sin,
++ alen) >= 0 &&
++ connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
++ alen) >= 0) {
++#else
+ our_query_sin = *our_sin;
+ our_query_sin.sin_port = htons(ANY_PORT);
+ rmt_query_sin = *rmt_sin;
+@@ -121,6 +174,7 @@
+ sizeof(our_query_sin)) >= 0 &&
+ connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
+ sizeof(rmt_query_sin)) >= 0) {
++#endif
+
+ /*
+ * Send query to server. Neglect the risk that a 13-byte
+@@ -129,8 +183,13 @@
+ */
+
+ fprintf(fp, "%u,%u\r\n",
++#ifdef INET6
++ ntohs(((struct sockaddr_in *)rmt_sin)->sin_port),
++ ntohs(((struct sockaddr_in *)our_sin)->sin_port));
++#else
+ ntohs(rmt_sin->sin_port),
+ ntohs(our_sin->sin_port));
++#endif
+ fflush(fp);
+
+ /*
+@@ -144,8 +203,13 @@
+ && ferror(fp) == 0 && feof(fp) == 0
+ && sscanf(buffer, "%u , %u : USERID :%*[^:]:%255s",
+ &rmt_port, &our_port, user) == 3
++#ifdef INET6
++ && ntohs(((struct sockaddr_in *)rmt_sin)->sin_port) == rmt_port
++ && ntohs(((struct sockaddr_in *)our_sin)->sin_port) == our_port) {
++#else
+ && ntohs(rmt_sin->sin_port) == rmt_port
+ && ntohs(our_sin->sin_port) == our_port) {
++#endif
+
+ /*
+ * Strip trailing carriage return. It is part of the
+diff -ruN tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
+--- tcp_wrappers_7.6.orig/scaffold.c 1997-03-21 19:27:24.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.c 2004-04-10 19:07:43.000000000 +0200
+@@ -25,7 +25,9 @@
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+ #endif
+
++#ifndef INET6
+ extern char *malloc();
++#endif
+
+ /* Application-specific. */
+
+@@ -39,6 +41,7 @@
+ int deny_severity = LOG_WARNING;
+ int rfc931_timeout = RFC931_TIMEOUT;
+
++#ifndef INET6
+ /* dup_hostent - create hostent in one memory block */
+
+ static struct hostent *dup_hostent(hp)
+@@ -73,9 +76,46 @@
+ }
+ return (&hb->host);
+ }
++#endif
+
+ /* find_inet_addr - find all addresses for this host, result to free() */
+
++#ifdef INET6
++struct addrinfo *find_inet_addr(host)
++char *host;
++{
++ struct addrinfo hints, *res;
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(host, NULL, &hints, &res) == 0)
++ return (res);
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++ if (getaddrinfo(host, NULL, &hints, &res) != 0) {
++ tcpd_warn("%s: host not found", host);
++ return (0);
++ }
++ if (res->ai_family != AF_INET6 && res->ai_family != AF_INET) {
++ tcpd_warn("%d: not an internet host", res->ai_family);
++ freeaddrinfo(res);
++ return (0);
++ }
++ if (!res->ai_canonname) {
++ tcpd_warn("%s: hostname alias", host);
++ tcpd_warn("(cannot obtain official name)", res->ai_canonname);
++ } else if (STR_NE(host, res->ai_canonname)) {
++ tcpd_warn("%s: hostname alias", host);
++ tcpd_warn("(official name: %.*s)", STRING_LENGTH, res->ai_canonname);
++ }
++ return (res);
++}
++#else
+ struct hostent *find_inet_addr(host)
+ char *host;
+ {
+@@ -118,6 +158,7 @@
+ }
+ return (dup_hostent(hp));
+ }
++#endif
+
+ /* check_dns - give each address thorough workout, return address count */
+
+@@ -125,8 +166,13 @@
+ char *host;
+ {
+ struct request_info request;
++#ifdef INET6
++ struct sockaddr_storage sin;
++ struct addrinfo *hp, *res;
++#else
+ struct sockaddr_in sin;
+ struct hostent *hp;
++#endif
+ int count;
+ char *addr;
+
+@@ -134,11 +180,18 @@
+ return (0);
+ request_init(&request, RQ_CLIENT_SIN, &sin, 0);
+ sock_methods(&request);
++#ifndef INET6
+ memset((char *) &sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
++#endif
+
++#ifdef INET6
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&sin, res->ai_addr, res->ai_addrlen);
++#else
+ for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ memcpy((char *) &sin.sin_addr, addr, sizeof(sin.sin_addr));
++#endif
+
+ /*
+ * Force host name and address conversions. Use the request structure
+@@ -151,7 +204,11 @@
+ tcpd_warn("host address %s->name lookup failed",
+ eval_hostaddr(request.client));
+ }
++#ifdef INET6
++ freeaddrinfo(hp);
++#else
+ free((char *) hp);
++#endif
+ return (count);
+ }
+
+diff -ruN tcp_wrappers_7.6.orig/scaffold.h tcp_wrappers_7.6/scaffold.h
+--- tcp_wrappers_7.6.orig/scaffold.h 1994-12-31 18:19:20.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.h 2004-04-10 19:07:43.000000000 +0200
+@@ -4,6 +4,10 @@
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
++#ifdef INET6
++extern struct addrinfo *find_inet_addr();
++#else
+ extern struct hostent *find_inet_addr();
++#endif
+ extern int check_dns();
+ extern int check_path();
+diff -ruN tcp_wrappers_7.6.orig/socket.c tcp_wrappers_7.6/socket.c
+--- tcp_wrappers_7.6.orig/socket.c 2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/socket.c 2004-04-10 19:07:43.000000000 +0200
+@@ -24,13 +24,22 @@
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
++#ifdef INT32_T
++typedef uint32_t u_int32_t;
++#endif
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+
++#ifdef INET6
++#ifndef NI_WITHSCOPEID
++#define NI_WITHSCOPEID 0
++#endif
++#else
+ extern char *inet_ntoa();
++#endif
+
+ /* Local stuff. */
+
+@@ -79,8 +88,13 @@
+ void sock_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ static struct sockaddr_storage client;
++ static struct sockaddr_storage server;
++#else
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
++#endif
+ int len;
+ char buf[BUFSIZ];
+ int fd = request->fd;
+@@ -109,7 +123,11 @@
+ memset(buf, 0 sizeof(buf));
+ #endif
+ }
++#ifdef INET6
++ request->client->sin = (struct sockaddr *)&client;
++#else
+ request->client->sin = &client;
++#endif
+
+ /*
+ * Determine the server binding. This is used for client username
+@@ -122,7 +140,11 @@
+ tcpd_warn("getsockname: %m");
+ return;
+ }
++#ifdef INET6
++ request->server->sin = (struct sockaddr *)&server;
++#else
+ request->server->sin = &server;
++#endif
+ }
+
+ /* sock_hostaddr - map endpoint address to printable form */
+@@ -130,10 +152,26 @@
+ void sock_hostaddr(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++ struct sockaddr *sin = host->sin;
++ int salen;
++
++ if (!sin)
++ return;
++#ifdef SIN6_LEN
++ salen = sin->sa_len;
++#else
++ salen = (sin->sa_family == AF_INET) ? sizeof(struct sockaddr_in)
++ : sizeof(struct sockaddr_in6);
++#endif
++ getnameinfo(sin, salen, host->addr, sizeof(host->addr),
++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++#else
+ struct sockaddr_in *sin = host->sin;
+
+ if (sin != 0)
+ STRN_CPY(host->addr, inet_ntoa(sin->sin_addr), sizeof(host->addr));
++#endif
+ }
+
+ /* sock_hostname - map endpoint address to host name */
+@@ -141,6 +179,160 @@
+ void sock_hostname(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++ struct sockaddr *sin = host->sin;
++ struct sockaddr_in sin4;
++ struct addrinfo hints, *res, *res0 = NULL;
++ int salen, alen, err = 1;
++ char *ap = NULL, *rap, hname[NI_MAXHOST];
++
++ if (sin != NULL) {
++ if (sin->sa_family == AF_INET6) {
++ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sin;
++
++ if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
++ memset(&sin4, 0, sizeof(sin4));
++#ifdef SIN6_LEN
++ sin4.sin_len = sizeof(sin4);
++#endif
++ sin4.sin_family = AF_INET;
++ sin4.sin_port = sin6->sin6_port;
++ sin4.sin_addr.s_addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12];
++ sin = (struct sockaddr *)&sin4;
++ }
++ }
++ switch (sin->sa_family) {
++ case AF_INET:
++ ap = (char *)&((struct sockaddr_in *)sin)->sin_addr;
++ alen = sizeof(struct in_addr);
++ salen = sizeof(struct sockaddr_in);
++ break;
++ case AF_INET6:
++ ap = (char *)&((struct sockaddr_in6 *)sin)->sin6_addr;
++ alen = sizeof(struct in6_addr);
++ salen = sizeof(struct sockaddr_in6);
++ break;
++ default:
++ break;
++ }
++ if (ap)
++ err = getnameinfo(sin, salen, hname, sizeof(hname),
++ NULL, 0, NI_WITHSCOPEID | NI_NAMEREQD);
++ }
++ if (!err) {
++
++ STRN_CPY(host->name, hname, sizeof(host->name));
++
++ /* reject numeric addresses */
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = sin->sa_family;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
++ if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) {
++ freeaddrinfo(res0);
++ res0 = NULL;
++ tcpd_warn("host name/name mismatch: "
++ "reverse lookup results in non-FQDN %s",
++ host->name);
++ strcpy(host->name, paranoid); /* name is bad, clobber it */
++ }
++ err = !err;
++ }
++ if (!err) {
++ /* we are now sure that this is non-numeric */
++
++ /*
++ * Verify that the address is a member of the address list returned
++ * by gethostbyname(hostname).
++ *
++ * Verify also that gethostbyaddr() and gethostbyname() return the same
++ * hostname, or rshd and rlogind may still end up being spoofed.
++ *
++ * On some sites, gethostbyname("localhost") returns "localhost.domain".
++ * This is a DNS artefact. We treat it as a special case. When we
++ * can't believe the address list from gethostbyname("localhost")
++ * we're in big trouble anyway.
++ */
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = sin->sa_family;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++ if (getaddrinfo(host->name, NULL, &hints, &res0) != 0) {
++
++ /*
++ * Unable to verify that the host name matches the address. This
++ * may be a transient problem or a botched name server setup.
++ */
++
++ tcpd_warn("can't verify hostname: getaddrinfo(%s, %s) failed",
++ host->name,
++ (sin->sa_family == AF_INET) ? "AF_INET" : "AF_INET6");
++
++ } else if ((res0->ai_canonname == NULL
++ || STR_NE(host->name, res0->ai_canonname))
++ && STR_NE(host->name, "localhost")) {
++
++ /*
++ * The gethostbyaddr() and gethostbyname() calls did not return
++ * the same hostname. This could be a nameserver configuration
++ * problem. It could also be that someone is trying to spoof us.
++ */
++
++ tcpd_warn("host name/name mismatch: %s != %.*s",
++ host->name, STRING_LENGTH,
++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++
++ } else {
++
++ /*
++ * The address should be a member of the address list returned by
++ * gethostbyname(). We should first verify that the h_addrtype
++ * field is AF_INET, but this program has already caused too much
++ * grief on systems with broken library code.
++ */
++
++ for (res = res0; res; res = res->ai_next) {
++ if (res->ai_family != sin->sa_family)
++ continue;
++ switch (res->ai_family) {
++ case AF_INET:
++ rap = (char *)&((struct sockaddr_in *)res->ai_addr)->sin_addr;
++ break;
++ case AF_INET6:
++ /* need to check scope_id */
++ if (((struct sockaddr_in6 *)sin)->sin6_scope_id !=
++ ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id) {
++ continue;
++ }
++ rap = (char *)&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
++ break;
++ default:
++ continue;
++ }
++ if (memcmp(rap, ap, alen) == 0) {
++ freeaddrinfo(res0);
++ return; /* name is good, keep it */
++ }
++ }
++
++ /*
++ * The host name does not map to the initial address. Perhaps
++ * someone has messed up. Perhaps someone compromised a name
++ * server.
++ */
++
++ getnameinfo(sin, salen, hname, sizeof(hname),
++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++ tcpd_warn("host name/address mismatch: %s != %.*s",
++ hname, STRING_LENGTH,
++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++ }
++ strcpy(host->name, paranoid); /* name is bad, clobber it */
++ if (res0)
++ freeaddrinfo(res0);
++ }
++#else /* INET6 */
+ struct sockaddr_in *sin = host->sin;
+ struct hostent *hp;
+ int i;
+@@ -220,6 +412,7 @@
+ }
+ strcpy(host->name, paranoid); /* name is bad, clobber it */
+ }
++#endif /* INET6 */
+ }
+
+ /* sock_sink - absorb unreceived IP datagram */
+@@ -228,7 +421,11 @@
+ int fd;
+ {
+ char buf[BUFSIZ];
++#ifdef INET6
++ struct sockaddr_storage sin;
++#else
+ struct sockaddr_in sin;
++#endif
+ int size = sizeof(sin);
+
+ /*
+diff -ruN tcp_wrappers_7.6.orig/tcpd.c tcp_wrappers_7.6/tcpd.c
+--- tcp_wrappers_7.6.orig/tcpd.c 1996-02-11 17:01:33.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.c 2004-04-10 19:07:43.000000000 +0200
+@@ -120,7 +120,12 @@
+
+ /* Report request and invoke the real daemon program. */
+
++#ifdef INET6
++ syslog(allow_severity, "connect from %s (%s)",
++ eval_client(&request), eval_hostaddr(request.client));
++#else
+ syslog(allow_severity, "connect from %s", eval_client(&request));
++#endif
+ closelog();
+ (void) execv(path, argv);
+ syslog(LOG_ERR, "error: cannot execute %s: %m", path);
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 1997-02-12 02:13:25.000000000 +0100
++++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:07:43.000000000 +0200
+@@ -22,6 +22,9 @@
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -397,6 +400,31 @@
+ }
+ }
+
++#ifdef INET6
++static int is_inet6_addr(pat)
++ char *pat;
++{
++ struct addrinfo hints, *res;
++ int len, ret;
++ char ch;
++
++ if (*pat != '[')
++ return (0);
++ len = strlen(pat);
++ if ((ch = pat[len - 1]) != ']')
++ return (0);
++ pat[len - 1] = '\0';
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if ((ret = getaddrinfo(pat + 1, NULL, &hints, &res)) == 0)
++ freeaddrinfo(res);
++ pat[len - 1] = ch;
++ return (ret == 0);
++}
++#endif
++
+ /* check_host - criticize host pattern */
+
+ static int check_host(pat)
+@@ -423,14 +451,27 @@
+ #endif
+ #endif
+ } else if (mask = split_at(pat, '/')) { /* network/netmask */
++#ifdef INET6
++ int mask_len;
++
++ if ((dot_quad_addr(pat) == INADDR_NONE
++ || dot_quad_addr(mask) == INADDR_NONE)
++ && (!is_inet6_addr(pat)
++ || ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
++#else
+ if (dot_quad_addr(pat) == INADDR_NONE
+ || dot_quad_addr(mask) == INADDR_NONE)
++#endif
+ tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
+ } else if (STR_EQ(pat, "FAIL")) { /* obsolete */
+ tcpd_warn("FAIL is no longer recognized");
+ tcpd_warn("(use EXCEPT or DENY instead)");
+ } else if (reserved_name(pat)) { /* other reserved */
+ /* void */ ;
++#ifdef INET6
++ } else if (is_inet6_addr(pat)) { /* IPv6 address */
++ addr_count = 1;
++#endif
+ } else if (NOT_INADDR(pat)) { /* internet name */
+ if (pat[strlen(pat) - 1] == '.') {
+ tcpd_warn("%s: domain or host name ends in dot", pat);
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 1996-03-19 16:22:25.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h 2004-04-10 19:07:43.000000000 +0200
+@@ -11,7 +11,11 @@
+ struct host_info {
+ char name[STRING_LENGTH]; /* access via eval_hostname(host) */
+ char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */
++#ifdef INET6
++ struct sockaddr *sin; /* socket address or 0 */
++#else
+ struct sockaddr_in *sin; /* socket address or 0 */
++#endif
+ struct t_unitdata *unit; /* TLI transport address or 0 */
+ struct request_info *request; /* for shared information */
+ };
+diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.c tcp_wrappers_7.6/tcpdmatch.c
+--- tcp_wrappers_7.6.orig/tcpdmatch.c 1996-02-11 17:01:36.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.c 2004-04-10 19:07:43.000000000 +0200
+@@ -57,7 +57,11 @@
+ int argc;
+ char **argv;
+ {
++#ifdef INET6
++ struct addrinfo hints, *hp, *res;
++#else
+ struct hostent *hp;
++#endif
+ char *myname = argv[0];
+ char *client;
+ char *server;
+@@ -68,8 +72,13 @@
+ int ch;
+ char *inetcf = 0;
+ int count;
++#ifdef INET6
++ struct sockaddr_storage server_sin;
++ struct sockaddr_storage client_sin;
++#else
+ struct sockaddr_in server_sin;
+ struct sockaddr_in client_sin;
++#endif
+ struct stat st;
+
+ /*
+@@ -172,13 +181,20 @@
+ if (NOT_INADDR(server) == 0 || HOSTNAME_KNOWN(server)) {
+ if ((hp = find_inet_addr(server)) == 0)
+ exit(1);
++#ifndef INET6
+ memset((char *) &server_sin, 0, sizeof(server_sin));
+ server_sin.sin_family = AF_INET;
++#endif
+ request_set(&request, RQ_SERVER_SIN, &server_sin, 0);
+
++#ifdef INET6
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&server_sin, res->ai_addr, res->ai_addrlen);
++#else
+ for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ memcpy((char *) &server_sin.sin_addr, addr,
+ sizeof(server_sin.sin_addr));
++#endif
+
+ /*
+ * Force evaluation of server host name and address. Host name
+@@ -194,7 +210,11 @@
+ fprintf(stderr, "Please specify an address instead\n");
+ exit(1);
+ }
++#ifdef INET6
++ freeaddrinfo(hp);
++#else
+ free((char *) hp);
++#endif
+ } else {
+ request_set(&request, RQ_SERVER_NAME, server, 0);
+ }
+@@ -208,6 +228,18 @@
+ tcpdmatch(&request);
+ exit(0);
+ }
++#ifdef INET6
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(client, NULL, &hints, &res) == 0) {
++ freeaddrinfo(res);
++ request_set(&request, RQ_CLIENT_ADDR, client, 0);
++ tcpdmatch(&request);
++ exit(0);
++ }
++#endif
+
+ /*
+ * Perhaps they are testing special client hostname patterns that aren't
+@@ -229,6 +261,34 @@
+ */
+ if ((hp = find_inet_addr(client)) == 0)
+ exit(1);
++#ifdef INET6
++ request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
++
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&client_sin, res->ai_addr, res->ai_addrlen);
++
++ /*
++ * getnameinfo() doesn't do reverse lookup against link-local
++ * address. So, we pass through host name evaluation against
++ * such addresses.
++ */
++ if (res->ai_family != AF_INET6 ||
++ !IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr)) {
++ /*
++ * Force evaluation of client host name and address. Host name
++ * conflicts will be reported while eval_hostname() does its job.
++ */
++ request_set(&request, RQ_CLIENT_NAME, "", RQ_CLIENT_ADDR, "", 0);
++ if (STR_EQ(eval_hostname(request.client), unknown))
++ tcpd_warn("host address %s->name lookup failed",
++ eval_hostaddr(request.client));
++ }
++ tcpdmatch(&request);
++ if (res->ai_next)
++ printf("\n");
++ }
++ freeaddrinfo(hp);
++#else
+ memset((char *) &client_sin, 0, sizeof(client_sin));
+ client_sin.sin_family = AF_INET;
+ request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
+@@ -250,6 +310,7 @@
+ printf("\n");
+ }
+ free((char *) hp);
++#endif
+ exit(0);
+ }
+
+diff -ruN tcp_wrappers_7.6.orig/tli.c tcp_wrappers_7.6/tli.c
+--- tcp_wrappers_7.6.orig/tli.c 1997-03-21 19:27:26.000000000 +0100
++++ tcp_wrappers_7.6/tli.c 2004-04-10 19:07:43.000000000 +0200
+@@ -65,8 +65,13 @@
+ void tli_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ static struct sockaddr_storage client;
++ static struct sockaddr_storage server;
++#else
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
++#endif
+
+ /*
+ * If we discover that we are using an IP transport, pretend we never
+@@ -76,14 +81,29 @@
+
+ tli_endpoints(request);
+ if ((request->config = tli_transport(request->fd)) != 0
++#ifdef INET6
++ && (STR_EQ(request->config->nc_protofmly, "inet") ||
++ STR_EQ(request->config->nc_protofmly, "inet6"))) {
++#else
+ && STR_EQ(request->config->nc_protofmly, "inet")) {
++#endif
+ if (request->client->unit != 0) {
++#ifdef INET6
++ client = *(struct sockaddr_storage *) request->client->unit->addr.buf;
++ request->client->sin = (struct sockaddr *) &client;
++#else
+ client = *(struct sockaddr_in *) request->client->unit->addr.buf;
+ request->client->sin = &client;
++#endif
+ }
+ if (request->server->unit != 0) {
++#ifdef INET6
++ server = *(struct sockaddr_storage *) request->server->unit->addr.buf;
++ request->server->sin = (struct sockaddr *) &server;
++#else
+ server = *(struct sockaddr_in *) request->server->unit->addr.buf;
+ request->server->sin = &server;
++#endif
+ }
+ tli_cleanup(request);
+ sock_methods(request);
+@@ -187,7 +207,15 @@
+ }
+ while (config = getnetconfig(handlep)) {
+ if (stat(config->nc_device, &from_config) == 0) {
++#ifdef NO_CLONE_DEVICE
++ /*
++ * If the network devices are not cloned (as is the case for
++ * Solaris 8 Beta), we must compare the major device numbers.
++ */
++ if (major(from_config.st_rdev) == major(from_client.st_rdev))
++#else
+ if (minor(from_config.st_rdev) == major(from_client.st_rdev))
++#endif
+ break;
+ }
+ }
+diff -ruN tcp_wrappers_7.6.orig/update.c tcp_wrappers_7.6/update.c
+--- tcp_wrappers_7.6.orig/update.c 1994-12-28 17:42:56.000000000 +0100
++++ tcp_wrappers_7.6/update.c 2004-04-10 19:07:43.000000000 +0200
+@@ -46,10 +46,18 @@
+ request->fd = va_arg(ap, int);
+ continue;
+ case RQ_CLIENT_SIN:
++#ifdef INET6
++ request->client->sin = va_arg(ap, struct sockaddr *);
++#else
+ request->client->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ continue;
+ case RQ_SERVER_SIN:
++#ifdef INET6
++ request->server->sin = va_arg(ap, struct sockaddr *);
++#else
+ request->server->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ continue;
+
+ /*
+diff -ruN tcp_wrappers_7.6.orig/workarounds.c tcp_wrappers_7.6/workarounds.c
+--- tcp_wrappers_7.6.orig/workarounds.c 1996-03-19 16:22:26.000000000 +0100
++++ tcp_wrappers_7.6/workarounds.c 2004-04-10 19:07:43.000000000 +0200
+@@ -166,11 +166,22 @@
+ int *len;
+ {
+ int ret;
++#ifdef INET6
++ struct sockaddr *sin = sa;
++#else
+ struct sockaddr_in *sin = (struct sockaddr_in *) sa;
++#endif
+
+ if ((ret = getpeername(sock, sa, len)) >= 0
++#ifdef INET6
++ && ((sin->su_si.si_family == AF_INET6
++ && IN6_IS_ADDR_UNSPECIFIED(&sin->su_sin6.sin6_addr))
++ || (sin->su_si.si_family == AF_INET
++ && sin->su_sin.sin_addr.s_addr == 0))) {
++#else
+ && sa->sa_family == AF_INET
+ && sin->sin_addr.s_addr == 0) {
++#endif
+ errno = ENOTCONN;
+ return (-1);
+ } else {
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch
new file mode 100644
index 0000000000..0238e35208
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch
@@ -0,0 +1,151 @@
+Path: news.porcupine.org!news.porcupine.org!not-for-mail
+From: Wietse Venema <wietse@((no)(spam)(please))wzv.win.tue.nl>
+Newsgroups: comp.mail.sendmail,comp.security.unix
+Subject: TCP Wrapper Blacklist Extension
+Followup-To: poster
+Date: 8 Sep 1997 18:53:13 -0400
+Organization: Wietse's hangout while on sabattical in the USA
+Lines: 147
+Sender: wietse@spike.porcupine.org
+Message-ID: <5v1vkp$h4f$1@spike.porcupine.org>
+NNTP-Posting-Host: spike.porcupine.org
+Xref: news.porcupine.org comp.mail.sendmail:3541 comp.security.unix:7158
+
+The patch below adds a new host pattern to the TCP Wrapper access
+control language. Instead of a host name or address pattern, you
+can specify an external /file/name with host name or address
+patterns. The feature can be used recursively.
+
+The /file/name extension makes it easy to blacklist bad sites, for
+example, to block unwanted electronic mail when libwrap is linked
+into sendmail. Adding hosts to a simple text file is much easier
+than having to edit a more complex hosts.allow/deny file.
+
+I developed this a year or so ago as a substitute for NIS netgroups.
+At that time, I did not consider it of sufficient interest for
+inclusion in the TCP Wrapper distribution. How times have changed.
+
+The patch is relative to TCP Wrappers version 7.6. The main archive
+site is ftp://ftp.win.tue.nl/pub/security/tcp_wrappers_7.6.tar.gz
+
+Thanks to the Debian LINUX folks for expressing their interest in
+this patch.
+
+ Wietse
+
+
+[diff updated by Md]
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:28:01.000000000 +0200
+@@ -97,6 +97,13 @@
+ `[3ffe:505:2:1::]/64\' matches every address in the range
+ `3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'.
+ .IP \(bu
++A string that begins with a `/\' character is treated as a file
++name. A host name or address is matched if it matches any host name
++or address pattern listed in the named file. The file format is
++zero or more lines with zero or more host name or address patterns
++separated by whitespace. A file name pattern can be used anywhere
++a host name or address pattern can be used.
++.IP \(bu
+ Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This
+ method of matching cannot be used in conjunction with `net/mask\' matching,
+ hostname matching beginning with `.\' or IP address matching ending with `.\'.
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:27:05.000000000 +0200
+@@ -253,6 +253,26 @@
+ }
+ }
+
++/* hostfile_match - look up host patterns from file */
++
++static int hostfile_match(path, host)
++char *path;
++struct hosts_info *host;
++{
++ char tok[BUFSIZ];
++ int match = NO;
++ FILE *fp;
++
++ if ((fp = fopen(path, "r")) != 0) {
++ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
++ /* void */ ;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", path);
++ }
++ return (match);
++}
++
+ /* host_match - match host name and/or address against pattern */
+
+ static int host_match(tok, host)
+@@ -280,6 +300,8 @@
+ tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */
+ return (NO);
+ #endif
++ } else if (tok[0] == '/') { /* /file hack */
++ return (hostfile_match(tok, host));
+ } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */
+ char *name = eval_hostname(host);
+ return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:27:05.000000000 +0200
+@@ -353,6 +353,8 @@
+ {
+ if (pat[0] == '@') {
+ tcpd_warn("%s: daemon name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: daemon name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: daemon name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -385,6 +387,8 @@
+ {
+ if (pat[0] == '@') { /* @netgroup */
+ tcpd_warn("%s: user name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: user name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: user name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -430,8 +434,13 @@
+ static int check_host(pat)
+ char *pat;
+ {
++ char buf[BUFSIZ];
+ char *mask;
+ int addr_count = 1;
++ FILE *fp;
++ struct tcpd_context saved_context;
++ char *cp;
++ char *wsp = " \t\r\n";
+
+ if (pat[0] == '@') { /* @netgroup */
+ #ifdef NO_NETGRENT
+@@ -450,6 +459,21 @@
+ tcpd_warn("netgroup support disabled");
+ #endif
+ #endif
++ } else if (pat[0] == '/') { /* /path/name */
++ if ((fp = fopen(pat, "r")) != 0) {
++ saved_context = tcpd_context;
++ tcpd_context.file = pat;
++ tcpd_context.line = 0;
++ while (fgets(buf, sizeof(buf), fp)) {
++ tcpd_context.line++;
++ for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
++ check_host(cp);
++ }
++ tcpd_context = saved_context;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", pat);
++ }
+ } else if (mask = split_at(pat, '/')) { /* network/netmask */
+ #ifdef INET6
+ int mask_len;
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch
new file mode 100644
index 0000000000..88a2b5e43b
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch
@@ -0,0 +1,45 @@
+diff -uN tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.new/hosts_access.c
+--- tcp_wrappers_7.6/hosts_access.c Mon May 20 14:00:56 2002
++++ tcp_wrappers_7.6.new/hosts_access.c Mon May 20 14:25:05 2002
+@@ -448,6 +448,15 @@
+ int len, mask_len, i = 0;
+ char ch;
+
++ /*
++ * Behavior of getaddrinfo() against IPv4-mapped IPv6 address is
++ * different between KAME and Solaris8. While KAME returns
++ * AF_INET6, Solaris8 returns AF_INET. So, we avoid this here.
++ */
++ if (STRN_EQ(string, "::ffff:", 7)
++ && dot_quad_addr(string + 7) != INADDR_NONE)
++ return (masked_match4(net_tok, mask_tok, string + 7));
++
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET6;
+ hints.ai_socktype = SOCK_STREAM;
+@@ -457,13 +466,6 @@
+ memcpy(&addr, res->ai_addr, sizeof(addr));
+ freeaddrinfo(res);
+
+- if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) {
+- if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE
+- || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE)
+- return (NO);
+- return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]);
+- }
+-
+ /* match IPv6 address against netnumber/prefixlen */
+ len = strlen(net_tok);
+ if (*net_tok != '[' || net_tok[len - 1] != ']')
+diff -uN tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.new/socket.c
+--- tcp_wrappers_7.6/socket.c Mon May 20 13:48:35 2002
++++ tcp_wrappers_7.6.new/socket.c Mon May 20 14:22:27 2002
+@@ -228,7 +228,7 @@
+ hints.ai_family = sin->sa_family;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
+- if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) {
++ if ((err = getaddrinfo(host->name, NULL, &hints, &res0)) == 0) {
+ freeaddrinfo(res0);
+ res0 = NULL;
+ tcpd_warn("host name/name mismatch: "
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
new file mode 100644
index 0000000000..60ca594bee
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
@@ -0,0 +1,81 @@
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile 2003-08-21 01:43:39.000000000 +0200
++++ tcp_wrappers_7.6/Makefile 2003-08-21 01:43:35.000000000 +0200
+@@ -45,7 +45,7 @@
+ #
+ # SysV.4 Solaris 2.x OSF AIX
+ #REAL_DAEMON_DIR=/usr/sbin
+-#
++REAL_DAEMON_DIR=/usr/sbin
+ # BSD 4.4
+ #REAL_DAEMON_DIR=/usr/libexec
+ #
+@@ -512,6 +519,7 @@
+ # (examples: allow, deny, banners, twist and spawn).
+ #
+ #STYLE = -DPROCESS_OPTIONS # Enable language extensions.
++STYLE = -DPROCESS_OPTIONS
+
+ ################################################################
+ # Optional: Changing the default disposition of logfile records
+@@ -535,6 +543,7 @@
+ # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
+
+ FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use
++FACILITY= LOG_DAEMON
+
+ # The syslog priority at which successful connections are logged.
+
+@@ -631,6 +640,7 @@
+ # lookups altogether, see the next section.
+
+ PARANOID= -DPARANOID
++PARANOID=
+
+ ########################################
+ # Optional: turning off hostname lookups
+@@ -644,6 +654,7 @@
+ # mode (see previous section) and comment out the following definition.
+
+ HOSTNAME= -DALWAYS_HOSTNAME
++HOSTNAME=
+
+ #############################################
+ # Optional: Turning on host ADDRESS checking
+@@ -670,6 +681,7 @@
+ # Solaris 2.x, and Linux. See your system documentation for details.
+ #
+ # KILL_OPT= -DKILL_IP_OPTIONS
++KILL_OPT= -DKILL_IP_OPTIONS
+
+ ## End configuration options
+ ############################
+@@ -677,9 +689,10 @@
+ # Protection against weird shells or weird make programs.
+
+ SHELL = /bin/sh
+-.c.o:; $(CC) $(CFLAGS) -c $*.c
++.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c
+
+-CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
++COPTS = -O2 -g
++CFLAGS = $(COPTS) -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
+ $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+@@ -712,10 +725,11 @@
+
+ config-check:
+ @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
+- @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
+- if cmp cflags /tmp/cflags.$$$$ ; \
+- then rm /tmp/cflags.$$$$ ; \
+- else mv /tmp/cflags.$$$$ cflags ; \
++ @set +e; echo $(CFLAGS) >cflags.new ; \
++ if cmp cflags cflags.new ; \
++ then rm cflags.new ; \
++ else mv cflags.new cflags ; \
+ fi >/dev/null 2>/dev/null
++ @if [ ! -d shared ]; then mkdir shared; fi
+
+ $(LIB): $(LIB_OBJ)
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch
new file mode 100644
index 0000000000..c089b33257
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch
@@ -0,0 +1,253 @@
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile 2004-05-02 15:37:59.000000000 +0200
++++ tcp_wrappers_7.6/Makefile 2004-05-02 15:31:09.000000000 +0200
+@@ -150,15 +150,15 @@
+
+ linux:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
+ NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \
+- EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
+
+ gnu:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
+ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \
+- EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" all
+
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -713,7 +713,22 @@
+
+ LIB = libwrap.a
+
+-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
++shared/%.o: %.c
++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
++
++SOMAJOR = 0
++SOMINOR = 7.6
++
++SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
++SHLIBSOMAJ = shared/libwrap.so.$(SOMAJOR)
++SHLIBSO = shared/libwrap.so
++SHLIBFLAGS = -Lshared -lwrap
++
++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
++SHCFLAGS = -fPIC -shared -D_REENTRANT
++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
++
++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+
+@@ -731,27 +746,33 @@
+ $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
+ -$(RANLIB) $(LIB)
+
+-tcpd: tcpd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
++$(SHLIB): $(SHLIB_OBJ)
++ rm -f $(SHLIB)
++ $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++ ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
++ ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
++
++tcpd: tcpd.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+
+ miscd: miscd.o $(LIB)
+ $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
+
+-safe_finger: safe_finger.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
++safe_finger: safe_finger.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+
+-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+
+-try-from: try-from.o fakelog.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
++try-from: try-from.o fakelog.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+
+-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
+
+ shar: $(KIT)
+ @shar $(KIT)
+@@ -767,7 +788,9 @@
+
+ clean:
+ rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
++ libwrap*.so* \
+ cflags
++ rm -rf shared/
+
+ tidy: clean
+ chmod -R a+r .
+@@ -913,5 +936,6 @@
+ update.o: mystdarg.h
+ update.o: tcpd.h
+ vfprintf.o: cflags
++weak_symbols.o: tcpd.h
+ workarounds.o: cflags
+ workarounds.o: tcpd.h
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2004-05-02 15:37:59.000000000 +0200
++++ tcp_wrappers_7.6/tcpd.h 2004-05-02 15:37:49.000000000 +0200
+@@ -4,6 +4,15 @@
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
++#ifndef _TCPWRAPPERS_TCPD_H
++#define _TCPWRAPPERS_TCPD_H
++
++/* Need definitions of struct sockaddr_in and FILE. */
++#include <netinet/in.h>
++#include <stdio.h>
++
++__BEGIN_DECLS
++
+ /* Structure to describe one communications endpoint. */
+
+ #define STRING_LENGTH 128 /* hosts, users, processes */
+@@ -29,10 +38,10 @@
+ char pid[10]; /* access via eval_pid(request) */
+ struct host_info client[1]; /* client endpoint info */
+ struct host_info server[1]; /* server endpoint info */
+- void (*sink) (); /* datagram sink function or 0 */
+- void (*hostname) (); /* address to printable hostname */
+- void (*hostaddr) (); /* address to printable address */
+- void (*cleanup) (); /* cleanup function or 0 */
++ void (*sink) (int); /* datagram sink function or 0 */
++ void (*hostname) (struct host_info *); /* address to printable hostname */
++ void (*hostaddr) (struct host_info *); /* address to printable address */
++ void (*cleanup) (struct request_info *); /* cleanup function or 0 */
+ struct netconfig *config; /* netdir handle */
+ };
+
+@@ -70,20 +79,27 @@
+ #define fromhost sock_host /* no TLI support needed */
+ #endif
+
+-extern int hosts_access(); /* access control */
+-extern void shell_cmd(); /* execute shell command */
+-extern char *percent_x(); /* do %<char> expansion */
+-extern void rfc931(); /* client name from RFC 931 daemon */
+-extern void clean_exit(); /* clean up and exit */
+-extern void refuse(); /* clean up and exit */
+-extern char *xgets(); /* fgets() on steroids */
+-extern char *split_at(); /* strchr() and split */
+-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */
++extern int hosts_access(struct request_info *request); /* access control */
++extern void shell_cmd(char *); /* execute shell command */
++extern char *percent_x(char *, int, char *, struct request_info *);
++ /* do %<char> expansion */
++extern void rfc931(struct sockaddr *, struct sockaddr *, char *);
++ /* client name from RFC 931 daemon */
++extern void clean_exit(struct request_info *); /* clean up and exit */
++extern void refuse(struct request_info *); /* clean up and exit */
++extern char *xgets(char *, int, FILE *); /* fgets() on steroids */
++extern char *split_at(char *, int); /* strchr() and split */
++extern unsigned long dot_quad_addr(char *); /* restricted inet_addr() */
+
+ /* Global variables. */
+
++#ifdef HAVE_WEAKSYMS
++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
++#else
+ extern int allow_severity; /* for connection logging */
+ extern int deny_severity; /* for connection logging */
++#endif
+ extern char *hosts_allow_table; /* for verification mode redirection */
+ extern char *hosts_deny_table; /* for verification mode redirection */
+ extern int hosts_access_verbose; /* for verbose matching mode */
+@@ -98,6 +114,8 @@
+ #ifdef __STDC__
+ extern struct request_info *request_init(struct request_info *,...);
+ extern struct request_info *request_set(struct request_info *,...);
++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
++ char *client_user);
+ #else
+ extern struct request_info *request_init(); /* initialize request */
+ extern struct request_info *request_set(); /* update request structure */
+@@ -121,20 +139,23 @@
+ * host_info structures serve as caches for the lookup results.
+ */
+
+-extern char *eval_user(); /* client user */
+-extern char *eval_hostname(); /* printable hostname */
+-extern char *eval_hostaddr(); /* printable host address */
+-extern char *eval_hostinfo(); /* host name or address */
+-extern char *eval_client(); /* whatever is available */
+-extern char *eval_server(); /* whatever is available */
++extern char *eval_user(struct request_info *); /* client user */
++extern char *eval_hostname(struct host_info *); /* printable hostname */
++extern char *eval_hostaddr(struct host_info *); /* printable host address */
++extern char *eval_hostinfo(struct host_info *); /* host name or address */
++extern char *eval_client(struct request_info *);/* whatever is available */
++extern char *eval_server(struct request_info *);/* whatever is available */
+ #define eval_daemon(r) ((r)->daemon) /* daemon process name */
+ #define eval_pid(r) ((r)->pid) /* process id */
+
+ /* Socket-specific methods, including DNS hostname lookups. */
+
+-extern void sock_host(); /* look up endpoint addresses */
+-extern void sock_hostname(); /* translate address to hostname */
+-extern void sock_hostaddr(); /* address to printable address */
++/* look up endpoint addresses */
++extern void sock_host(struct request_info *);
++/* translate address to hostname */
++extern void sock_hostname(struct host_info *);
++/* address to printable address */
++extern void sock_hostaddr(struct host_info *);
+ #define sock_methods(r) \
+ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
+
+@@ -182,7 +203,7 @@
+ * behavior.
+ */
+
+-extern void process_options(); /* execute options */
++extern void process_options(char *, struct request_info *);/* execute options */
+ extern int dry_run; /* verification flag */
+
+ /* Bug workarounds. */
+@@ -221,3 +242,7 @@
+ #define strtok my_strtok
+ extern char *my_strtok();
+ #endif
++
++__END_DECLS
++
++#endif
+diff -ruN tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c
+--- tcp_wrappers_7.6.orig/weak_symbols.c 1970-01-01 01:00:00.000000000 +0100
++++ tcp_wrappers_7.6/weak_symbols.c 2004-05-02 15:31:09.000000000 +0200
+@@ -0,0 +1,11 @@
++ /*
++ * @(#) weak_symbols.h 1.5 99/12/29 23:50
++ *
++ * Author: Anthony Towns <ajt@debian.org>
++ */
++
++#ifdef HAVE_WEAKSYMS
++#include <syslog.h>
++int deny_severity = LOG_WARNING;
++int allow_severity = SEVERITY;
++#endif
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch
new file mode 100644
index 0000000000..0e1ecf5b4a
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch
@@ -0,0 +1,66 @@
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2003-08-21 03:15:31.000000000 +0200
+@@ -90,6 +90,10 @@
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
+ .IP \(bu
++An expression of the form `n.n.n.n/mm' is interpreted as a
++`net/masklength' pair, where `mm' is the number of consecutive `1'
++bits in the netmask applied to the `n.n.n.n' address.
++.IP \(bu
+ An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a
+ `[net]/prefixlen\' pair. An IPv6 host address is matched if
+ `prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c 2003-08-21 03:09:30.000000000 +0200
+@@ -417,7 +417,8 @@
+ if ((addr = dot_quad_addr(string)) == INADDR_NONE)
+ return (NO);
+ if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+- || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++ || ((mask = dot_quad_addr(mask_tok)) == INADDR_NONE
++ && (mask = cidr_mask_addr(mask_tok)) == 0)) {
+ #ifndef INET6
+ tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
+ #endif
+diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c
+--- tcp_wrappers_7.6.orig/misc.c 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/misc.c 2003-08-21 03:09:30.000000000 +0200
+@@ -107,3 +107,17 @@
+ }
+ return (runs == 4 ? inet_addr(str) : INADDR_NONE);
+ }
++
++/* cidr_mask_addr - convert cidr netmask length to internal form */
++
++unsigned long cidr_mask_addr(str)
++char *str;
++{
++ int maskbits;
++
++ maskbits = atoi(str);
++ if (maskbits < 1 || maskbits > 32)
++ return (0);
++ return htonl(0xFFFFFFFF << (32 - maskbits));
++}
++
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 03:09:30.000000000 +0200
+@@ -497,12 +497,12 @@
+ int mask_len;
+
+ if ((dot_quad_addr(pat) == INADDR_NONE
+- || dot_quad_addr(mask) == INADDR_NONE)
++ || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0)
+ && (!is_inet6_addr(pat)
+ || ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
+ #else
+ if (dot_quad_addr(pat) == INADDR_NONE
+- || dot_quad_addr(mask) == INADDR_NONE)
++ || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0)
+ #endif
+ tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
+ } else if (STR_EQ(pat, "FAIL")) { /* obsolete */
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch
new file mode 100644
index 0000000000..913ed987d6
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch
@@ -0,0 +1,12 @@
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-25 12:17:59.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-25 12:17:53.000000000 +0200
+@@ -89,6 +89,8 @@
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
++`255.255.255.255\' is not a valid mask value, so a single host can be
++matched just by its IP.
+ .IP \(bu
+ An expression of the form `n.n.n.n/mm' is interpreted as a
+ `net/masklength' pair, where `mm' is the number of consecutive `1'
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch
new file mode 100644
index 0000000000..e35fc7ecd9
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch
@@ -0,0 +1,71 @@
+diff -ruN tcp_wrappers_7.6.orig/eval.c tcp_wrappers_7.6/eval.c
+--- tcp_wrappers_7.6.orig/eval.c 1995-01-30 19:51:46.000000000 +0100
++++ tcp_wrappers_7.6/eval.c 2004-11-04 13:59:01.000000000 +0100
+@@ -98,6 +98,28 @@
+ }
+ }
+
++/* eval_port - return string with the port */
++char *eval_port(saddr)
++#ifdef INET6
++struct sockaddr *saddr;
++#else
++struct sockaddr_in *saddr;
++#endif
++{
++ static char port[16];
++ if (saddr != 0) {
++ sprintf(port, "%u",
++#ifdef INET6
++ ntohs(((struct sockaddr_in *)saddr)->sin_port));
++#else
++ ntohs(saddr->sin_port));
++#endif
++ } else {
++ strcpy(port, "0");
++ }
++ return (port);
++}
++
+ /* eval_client - return string with as much about the client as we know */
+
+ char *eval_client(request)
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-11-04 13:17:45.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5 2004-11-04 13:55:32.000000000 +0100
+@@ -175,6 +175,8 @@
+ unavailable.
+ .IP "%n (%N)"
+ The client (server) host name (or "unknown" or "paranoid").
++.IP "%r (%R)"
++The clients (servers) port number (or "0").
+ .IP %p
+ The daemon process id.
+ .IP %s
+diff -ruN tcp_wrappers_7.6.orig/percent_x.c tcp_wrappers_7.6/percent_x.c
+--- tcp_wrappers_7.6.orig/percent_x.c 1994-12-28 17:42:38.000000000 +0100
++++ tcp_wrappers_7.6/percent_x.c 2004-11-04 13:19:29.000000000 +0100
+@@ -63,6 +63,8 @@
+ ch == 'n' ? eval_hostname(request->client) :
+ ch == 'N' ? eval_hostname(request->server) :
+ ch == 'p' ? eval_pid(request) :
++ ch == 'r' ? eval_port(request->client->sin) :
++ ch == 'R' ? eval_port(request->server->sin) :
+ ch == 's' ? eval_server(request) :
+ ch == 'u' ? eval_user(request) :
+ ch == '%' ? "%" : (tcpd_warn("unrecognized %%%c", ch), "");
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2004-11-04 13:17:45.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h 2004-11-04 13:19:13.000000000 +0100
+@@ -145,6 +145,11 @@
+ extern char *eval_hostinfo(struct host_info *); /* host name or address */
+ extern char *eval_client(struct request_info *);/* whatever is available */
+ extern char *eval_server(struct request_info *);/* whatever is available */
++#ifdef INET6
++extern char *eval_port(struct sockaddr *);
++#else
++extern char *eval_port(struct sockaddr_in *);
++#endif
+ #define eval_daemon(r) ((r)->daemon) /* daemon process name */
+ #define eval_pid(r) ((r)->pid) /* process id */
+
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch
new file mode 100644
index 0000000000..31c2b92278
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch
@@ -0,0 +1,19 @@
+diff -ruN tcp_wrappers_7.6.orig/percent_m.c tcp_wrappers_7.6/percent_m.c
+--- tcp_wrappers_7.6.orig/percent_m.c 1994-12-28 17:42:37.000000000 +0100
++++ tcp_wrappers_7.6/percent_m.c 2003-08-21 02:45:31.000000000 +0200
+@@ -29,11 +29,15 @@
+
+ while (*bp = *cp)
+ if (*cp == '%' && cp[1] == 'm') {
++#ifdef HAVE_STRERROR
++ strcpy(bp, strerror(errno));
++#else
+ if (errno < sys_nerr && errno > 0) {
+ strcpy(bp, sys_errlist[errno]);
+ } else {
+ sprintf(bp, "Unknown error %d", errno);
+ }
++#endif
+ bp += strlen(bp);
+ cp += 2;
+ } else {
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
new file mode 100644
index 0000000000..2e897650e0
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
@@ -0,0 +1,43 @@
+Index: tcp_wrappers_7.6.orig/Makefile
+===================================================================
+--- tcp_wrappers_7.6.orig.orig/Makefile 2009-04-06 10:55:47.000000000 +0000
++++ tcp_wrappers_7.6.orig/Makefile 2009-04-06 10:57:04.000000000 +0000
+@@ -748,31 +748,31 @@
+
+ $(SHLIB): $(SHLIB_OBJ)
+ rm -f $(SHLIB)
+- $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++ $(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
+ ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
+ ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
+
+ tcpd: tcpd.o $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+
+ miscd: miscd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
+
+ safe_finger: safe_finger.o $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+
+ tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+
+ try-from: try-from.o fakelog.o $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+
+ tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
+
+ shar: $(KIT)
+ @shar $(KIT)
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch
new file mode 100644
index 0000000000..afaa9c8ac3
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch
@@ -0,0 +1,21 @@
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3
+--- tcp_wrappers_7.6.orig/hosts_access.3 2004-04-25 00:10:48.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.3 2004-04-25 00:09:36.000000000 +0200
+@@ -14,6 +14,9 @@
+ struct request_info *request_set(request, key, value, ..., 0)
+ struct request_info *request;
+
++void fromhost(request)
++struct request_info *request;
++
+ int hosts_access(request)
+ struct request_info *request;
+
+@@ -60,6 +63,7 @@
+ is available, host names and client user names are looked up on demand,
+ using the request structure as a cache. hosts_access() returns zero if
+ access should be denied.
++fromhost() must be called before hosts_access().
+ .PP
+ hosts_ctl() is a wrapper around the request_init() and hosts_access()
+ routines with a perhaps more convenient interface (though it does not
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
new file mode 100644
index 0000000000..ece7da35fe
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
@@ -0,0 +1,37 @@
+diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:40:08.000000000 +0200
++++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:40:02.000000000 +0200
+@@ -92,6 +92,8 @@
+ char *cp;
+ char *result = unknown;
+ FILE *fp;
++ unsigned saved_timeout;
++ struct sigaction nact, oact;
+
+ #ifdef INET6
+ /* address family must be the same */
+@@ -134,7 +136,12 @@
+ */
+
+ if (setjmp(timebuf) == 0) {
+- signal(SIGALRM, timeout);
++ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
++ saved_timeout = alarm(0);
++ nact.sa_handler = timeout;
++ nact.sa_flags = 0;
++ (void) sigemptyset(&nact.sa_mask);
++ (void) sigaction(SIGALRM, &nact, &oact);
+ alarm(rfc931_timeout);
+
+ /*
+@@ -223,6 +230,10 @@
+ }
+ alarm(0);
+ }
++ /* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
++ (void) sigaction(SIGALRM, &oact, NULL);
++ if (saved_timeout > 0)
++ alarm(saved_timeout);
+ fclose(fp);
+ }
+ STRN_CPY(dest, result, STRING_LENGTH);
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff
new file mode 100644
index 0000000000..a926d0edfd
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff
@@ -0,0 +1,39 @@
+diff -ruNp tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
+--- tcp_wrappers_7.6.orig/scaffold.c 2005-03-09 18:22:04.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.c 2005-03-09 18:20:47.000000000 +0100
+@@ -237,10 +237,17 @@ struct request_info *request;
+
+ /* ARGSUSED */
+
+-void rfc931(request)
+-struct request_info *request;
++void rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
++struct sockaddr_in *rmt_sin;
++struct sockaddr_in *our_sin;
++#endif
++char *dest;
+ {
+- strcpy(request->user, unknown);
++ strcpy(dest, unknown);
+ }
+
+ /* check_path - examine accessibility */
+diff -ruNp tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2005-03-09 18:22:04.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h 2005-03-09 18:21:23.000000000 +0100
+@@ -83,7 +83,11 @@ extern int hosts_access(struct request_i
+ extern void shell_cmd(char *); /* execute shell command */
+ extern char *percent_x(char *, int, char *, struct request_info *);
+ /* do %<char> expansion */
++#ifdef INET6
+ extern void rfc931(struct sockaddr *, struct sockaddr *, char *);
++#else
++extern void rfc931(struct sockaddr_in *, struct sockaddr_in *, char *);
++#endif
+ /* client name from RFC 931 daemon */
+ extern void clean_exit(struct request_info *); /* clean up and exit */
+ extern void refuse(struct request_info *); /* clean up and exit */
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8 b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8
new file mode 100644
index 0000000000..875616b9ea
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8
@@ -0,0 +1,34 @@
+.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+safe_finger \- finger client wrapper that protects against nasty stuff
+from finger servers
+.SH SYNOPSIS
+.B safe_finger [finger_options]
+.SH DESCRIPTION
+The
+.B safe_finger
+command protects against nasty stuff from finger servers. Use this
+program for automatic reverse finger probes from the
+.B tcp_wrapper
+.B (tcpd)
+, not the raw finger command. The
+.B safe_finger
+command makes sure that the finger client is not run with root
+privileges. It also runs the finger client with a defined PATH
+environment.
+.B safe_finger
+will also protect you from problems caused by the output of some
+finger servers. The problem: some programs may react to stuff in
+the first column. Other programs may get upset by thrash anywhere
+on a line. File systems may fill up as the finger server keeps
+sending data. Text editors may bomb out on extremely long lines.
+The finger server may take forever because it is somehow wedged.
+.B safe_finger
+takes care of all this badness.
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch
new file mode 100644
index 0000000000..5c8c9a1548
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch
@@ -0,0 +1,29 @@
+--- tcp-wrappers-7.6-ipv6.1.orig/safe_finger.c
++++ tcp-wrappers-7.6-ipv6.1/safe_finger.c
+@@ -26,21 +26,24 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <pwd.h>
++#include <syslog.h>
+
+ extern void exit();
+
+ /* Local stuff */
+
+-char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
++char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
+
+ #define TIME_LIMIT 60 /* Do not keep listinging forever */
+ #define INPUT_LENGTH 100000 /* Do not keep listinging forever */
+ #define LINE_LENGTH 128 /* Editors can choke on long lines */
+ #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */
+ #define UNPRIV_NAME "nobody" /* Preferred privilege level */
+-#define UNPRIV_UGID 32767 /* Default uid and gid */
++#define UNPRIV_UGID 65534 /* Default uid and gid */
+
+ int finger_pid;
++int allow_severity = SEVERITY;
++int deny_severity = LOG_WARNING;
+
+ void cleanup(sig)
+ int sig;
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch
new file mode 100644
index 0000000000..f286605bfd
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch
@@ -0,0 +1,34 @@
+* Mon Feb 10 2003 Harald Hoyer <harald@redhat.de> 7.6-29
+- added security patch tcp_wrappers-7.6-sig.patch
+
+--- tcp_wrappers_7.6/hosts_access.c.sig 2003-02-10 16:18:31.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.c 2003-02-10 16:50:38.000000000 +0100
+@@ -66,6 +66,7 @@
+
+ #define YES 1
+ #define NO 0
++#define ERR -1
+
+ /*
+ * These variables are globally visible so that they can be redirected in
+@@ -129,9 +129,9 @@
+ return (verdict == AC_PERMIT);
+ if (table_match(hosts_allow_table, request))
+ return (YES);
+- if (table_match(hosts_deny_table, request))
+- return (NO);
+- return (YES);
++ if (table_match(hosts_deny_table, request) == NO)
++ return (YES);
++ return (NO);
+ }
+
+ /* table_match - match table entries with (daemon, client) pair */
+@@ -175,6 +175,7 @@
+ (void) fclose(fp);
+ } else if (errno != ENOENT) {
+ tcpd_warn("cannot open %s: %m", table);
++ match = ERR;
+ }
+ if (match) {
+ if (hosts_access_verbose > 1)
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch
new file mode 100644
index 0000000000..71be340a07
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch
@@ -0,0 +1,30 @@
+diff -ruNp tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:42:25.000000000 +0200
++++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:41:04.000000000 +0200
+@@ -33,7 +33,7 @@ static char sccsid[] = "@(#) rfc931.c 1.
+
+ int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
+
+-static jmp_buf timebuf;
++static sigjmp_buf timebuf;
+
+ /* fsocket - open stdio stream on top of socket */
+
+@@ -62,7 +62,7 @@ int protocol;
+ static void timeout(sig)
+ int sig;
+ {
+- longjmp(timebuf, sig);
++ siglongjmp(timebuf, sig);
+ }
+
+ /* rfc931 - return remote user name, given socket structures */
+@@ -135,7 +135,7 @@ char *dest;
+ * Set up a timer so we won't get stuck while waiting for the server.
+ */
+
+- if (setjmp(timebuf) == 0) {
++ if (sigsetjmp(timebuf, 0) == 0) {
+ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
+ saved_timeout = alarm(0);
+ nact.sa_handler = timeout;
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/size_t.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/size_t.patch
new file mode 100644
index 0000000000..4db40f4c7b
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/size_t.patch
@@ -0,0 +1,42 @@
+diff -ruN tcp_wrappers_7.6.orig/fix_options.c tcp_wrappers_7.6/fix_options.c
+--- tcp_wrappers_7.6.orig/fix_options.c 2003-08-21 03:41:33.000000000 +0200
++++ tcp_wrappers_7.6/fix_options.c 2003-08-21 03:41:27.000000000 +0200
+@@ -38,7 +38,11 @@
+ #ifdef IP_OPTIONS
+ unsigned char optbuf[BUFFER_SIZE / 3], *cp;
+ char lbuf[BUFFER_SIZE], *lp;
++#ifdef __GLIBC__
++ size_t optsize = sizeof(optbuf), ipproto;
++#else
+ int optsize = sizeof(optbuf), ipproto;
++#endif
+ struct protoent *ip;
+ int fd = request->fd;
+ unsigned int opt;
+diff -ruN tcp_wrappers_7.6.orig/socket.c tcp_wrappers_7.6/socket.c
+--- tcp_wrappers_7.6.orig/socket.c 2003-08-21 03:41:33.000000000 +0200
++++ tcp_wrappers_7.6/socket.c 2003-08-21 03:40:51.000000000 +0200
+@@ -90,7 +90,11 @@
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
+ #endif
++#ifdef __GLIBC__
++ size_t len;
++#else
+ int len;
++#endif
+ char buf[BUFSIZ];
+ int fd = request->fd;
+
+@@ -421,7 +425,11 @@
+ #else
+ struct sockaddr_in sin;
+ #endif
++#ifdef __GLIBC__
++ size_t size = sizeof(sin);
++#else
+ int size = sizeof(sin);
++#endif
+
+ /*
+ * Eat up the not-yet received datagram. Some systems insist on a
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch
new file mode 100644
index 0000000000..3beae39306
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch
@@ -0,0 +1,39 @@
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 02:50:37.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 02:50:33.000000000 +0200
+@@ -53,6 +53,24 @@
+ #include "inetcf.h"
+ #include "scaffold.h"
+
++/* list of programs which are known to be linked with libwrap in debian */
++static const char *const libwrap_programs[] = {
++ "portmap", "mountd", "statd", "ugidd",
++ "redir", "rlinetd",
++ "sshd",
++ "atftpd",
++ "diald",
++ "esound",
++ "gdm", "gnome-session",
++ "icecast", "icecast_admin", "icecast_client", "icecast_source",
++ "mysqld",
++ "ntop",
++ "pptpd",
++ "rquotad",
++ "sendmail", "smail",
++ NULL
++};
++
+ /*
+ * Stolen from hosts_access.c...
+ */
+@@ -147,8 +165,8 @@
+ /*
+ * These are not run from inetd but may have built-in access control.
+ */
+- inet_set("portmap", WR_NOT);
+- inet_set("rpcbind", WR_NOT);
++ for (c = 0; libwrap_programs[c]; c++)
++ inet_set(libwrap_programs[c], WR_YES);
+
+ /*
+ * Check accessibility of access control files.
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8 b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8
new file mode 100644
index 0000000000..9c8f30543e
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8
@@ -0,0 +1,28 @@
+.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+try-from \- test program for the tcp_wrapper
+.SH SYNOPSIS
+.B try-from
+.SH DESCRIPTION
+The
+.B try-from
+command can be called via a remote shell command to find out
+if the hostname and address are properly recognized
+by the
+.B tcp_wrapper
+library, if username lookup works, and (SysV only) if the TLI
+on top of IP heuristics work. Diagnostics are reported through
+.BR syslog (3)
+and redirected to stderr.
+
+Example:
+
+rsh host /some/where/try-from
+
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
new file mode 100644
index 0000000000..308a8b63b4
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
@@ -0,0 +1,117 @@
+DESCRIPTION = "Tools for monitoring and filtering incoming requests for tcp \
+ services."
+PRIORITY = "optional"
+SECTION = "console/network"
+
+LICENSE = "tcp-wrappers"
+LIC_FILES_CHKSUM = "file://DISCLAIMER;md5=071bd69cb78b18888ea5e3da5c3127fa"
+PR ="r0"
+
+
+PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev tcp-wrappers tcp-wrappers-doc"
+FILES_libwrap = "${base_libdir}/lib*.so.*"
+FILES_libwrap-doc = "${mandir}/man3 ${mandir}/man5"
+FILES_libwrap-dev = "${libdir}/lib*.so ${libdir}/lib*.a ${includedir}"
+FILES_tcp-wrappers = "${bindir}"
+FILES_tcp-wrappers-doc = "${mandir}/man8"
+
+SRC_URI = "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
+ file://00_man_quoting.diff \
+ file://01_man_portability.patch \
+ file://05_wildcard_matching.patch \
+ file://06_fix_gethostbyname.patch \
+ file://10_usagi-ipv6.patch \
+ file://11_tcpd_blacklist.patch \
+ file://11_usagi_fix.patch \
+ file://12_makefile_config.patch \
+ file://13_shlib_weaksym.patch \
+ file://14_cidr_support.patch \
+ file://15_match_clarify.patch \
+ file://expand_remote_port.patch \
+ file://have_strerror.patch \
+ file://man_fromhost.patch \
+ file://restore_sigalarm.patch \
+ file://rfc931.diff \
+ file://safe_finger.patch \
+ file://sig_fix.patch \
+ file://siglongjmp.patch \
+ file://size_t.patch \
+ file://tcpdchk_libwrapped.patch \
+ file://ldflags.patch \
+ \
+ file://try-from.8 \
+ file://safe_finger.8"
+
+S = "${WORKDIR}/tcp_wrappers_${PV}"
+
+PARALLEL_MAKE = ""
+EXTRA_OEMAKE = "'CC=${CC}' \
+ 'AR=${AR}' \
+ 'RANLIB=${RANLIB}' \
+ 'REAL_DAEMON_DIR=${sbindir}' \
+ 'STYLE=-DPROCESS_OPTIONS' \
+ 'FACILITY=LOG_DAEMON' \
+ 'SEVERITY=LOG_INFO' \
+ 'BUGS=' \
+ 'VSYSLOG=' \
+ 'RFC931_TIMEOUT=10' \
+ 'ACCESS=-DHOSTS_ACCESS' \
+ 'KILL_OPT=-DKILL_IP_OPTIONS' \
+ 'UMASK=-DDAEMON_UMASK=022' \
+ 'NETGROUP=${EXTRA_OEMAKE_NETGROUP}' \
+ 'LIBS=-lnsl' \
+ 'ARFLAGS=rv' \
+ 'AUX_OBJ=weak_symbols.o' \
+ 'TLI=' \
+ 'COPTS=' \
+ 'EXTRA_CFLAGS=${CFLAGS} -DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len'"
+
+EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN"
+EXTRA_OEMAKE_NETGROUP_linux-uclibc = "-DUSE_GETDOMAIN"
+EXTRA_OEMAKE_NETGROUP_linux-uclibceabi = "-DUSE_GETDOMAIN"
+
+do_compile () {
+ oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \
+ all
+}
+
+BINS = "safe_finger tcpd tcpdchk try-from tcpdmatch"
+MANS3 = "hosts_access"
+MANS5 = "hosts_options"
+MANS8 = "tcpd tcpdchk tcpdmatch"
+do_install () {
+ oe_libinstall -a libwrap ${D}${libdir}
+ oe_libinstall -C shared -so libwrap ${D}${base_libdir}
+
+ rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
+ libname=`readlink ${D}${base_libdir}/libwrap.so | xargs basename`
+ ln -s ${rel_lib_prefix}${base_libdir}/${libname} ${D}${libdir}/libwrap.so
+ rm -f ${D}${base_libdir}/libwrap.so
+
+ install -d ${D}${sbindir}
+ for b in ${BINS}; do
+ install -m 0755 $b ${D}${sbindir}/ || exit 1
+ done
+
+ install -d ${D}${mandir}/man3
+ for m in ${MANS3}; do
+ install -m 0644 $m.3 ${D}${mandir}/man3/ || exit 1
+ done
+
+ install -d ${D}${mandir}/man5
+ for m in ${MANS5}; do
+ install -m 0644 $m.5 ${D}${mandir}/man5/ || exit 1
+ done
+
+ install -d ${D}${mandir}/man8
+ for m in ${MANS8}; do
+ install -m 0644 $m.8 ${D}${mandir}/man8/ || exit 1
+ done
+
+ install -m 0644 ${WORKDIR}/try-from.8 ${D}${mandir}/man8/
+ install -m 0644 ${WORKDIR}/safe_finger.8 ${D}${mandir}/man8/
+
+ install -d ${D}${includedir}
+ install -m 0644 tcpd.h ${D}${includedir}/
+}
+
diff --git a/meta/recipes-extended/tzcode/tzcode-native_2009r.bb b/meta/recipes-extended/tzcode/tzcode-native_2009r.bb
new file mode 100644
index 0000000000..c9a213b4f8
--- /dev/null
+++ b/meta/recipes-extended/tzcode/tzcode-native_2009r.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+
+PR = "r0"
+
+SRC_URI = "ftp://elsie.nci.nih.gov/pub/tzcode${PV}.tar.gz \
+ ftp://elsie.nci.nih.gov/pub/tzdata2009s.tar.gz"
+
+S = "${WORKDIR}"
+
+inherit native
+
+do_install () {
+ install -d ${D}${bindir}/
+ install -m 755 zic ${D}${bindir}/
+ install -m 755 zdump ${D}${bindir}/
+ install -m 755 tzselect ${D}${bindir}/
+}
diff --git a/meta/recipes-extended/tzdata/tzdata_2010j.bb b/meta/recipes-extended/tzdata/tzdata_2010j.bb
new file mode 100644
index 0000000000..97eb1173c1
--- /dev/null
+++ b/meta/recipes-extended/tzdata/tzdata_2010j.bb
@@ -0,0 +1,160 @@
+DESCRIPTION = "Timezone data"
+HOMEPAGE = "ftp://elsie.nci.nih.gov/pub/"
+SECTION = "base"
+PRIORITY = "optional"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://asia;beginline=2;endline=3;md5=06468c0e84ef4d4c97045a4a29b08234"
+DEPENDS = "tzcode-native"
+
+PR = "r0"
+
+RCONFLICTS= "timezones timezone-africa timezone-america timezone-antarctica \
+ timezone-arctic timezone-asia timezone-atlantic \
+ timezone-australia timezone-europe timezone-indian \
+ timezone-iso3166.tab timezone-pacific timezone-zone.tab"
+
+SRC_URI = "ftp://elsie.nci.nih.gov/pub/tzdata${PV}.tar.gz"
+
+S = "${WORKDIR}"
+
+TZONES= "africa antarctica asia australasia europe northamerica southamerica \
+ factory solar87 solar88 solar89 etcetera backward systemv \
+# pacificnew \
+ "
+
+do_compile () {
+ for zone in ${TZONES}; do \
+ ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \
+ -y ${S}/yearistype.sh ${S}/${zone} ; \
+ ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \
+ -y ${S}/yearistype.sh ${S}/${zone} ; \
+ ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \
+ -y ${S}/yearistype.sh ${S}/${zone} ; \
+ done
+}
+
+do_install () {
+ install -d ${D}/usr ${D}${datadir}/zoneinfo
+ cp -pPR ${S}/usr ${D}/
+}
+
+# Packages primarily organized by directory with a major city
+# in most time zones in the base package
+
+PACKAGES = "tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \
+ tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
+ tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific"
+
+FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*"
+RPROVIDES_tzdata-africa = "tzdata-africa"
+
+FILES_tzdata-americas += "${datadir}/zoneinfo/America/* \
+ ${datadir}/zoneinfo/US/* \
+ ${datadir}/zoneinfo/Brazil/* \
+ ${datadir}/zoneinfo/Canada/* \
+ ${datadir}/zoneinfo/Mexico/* \
+ ${datadir}/zoneinfo/Chile/*"
+RPROVIDES_tzdata-americas = "tzdata-americas"
+
+FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*"
+RPROVIDES_tzdata-antarctica = "tzdata-antarctica"
+
+FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*"
+RPROVIDES_tzdata-arctic = "tzdata-arctic"
+
+FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/* \
+ ${datadir}/zoneinfo/Indian/* \
+ ${datadir}/zoneinfo/Mideast/*"
+RPROVIDES_tzdata-asia = "tzdata-asia"
+
+FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*"
+RPROVIDES_tzdata-atlantic = "tzdata-atlantic"
+
+FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*"
+RPROVIDES_tzdata-australia = "tzdata-australia"
+
+FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*"
+RPROVIDES_tzdata-europe = "tzdata-europe"
+
+FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*"
+RPROVIDES_tzdata-pacific = "tzdata-pacific"
+
+FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*"
+RPROVIDES_tzdata-posix = "tzdata-posix"
+
+FILES_tzdata-right += "${datadir}/zoneinfo/right/*"
+RPROVIDES_tzdata-right = "tzdata-right"
+
+
+FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba \
+ ${datadir}/zoneinfo/Egypt \
+ ${datadir}/zoneinfo/Eire \
+ ${datadir}/zoneinfo/Factory \
+ ${datadir}/zoneinfo/GB-Eire \
+ ${datadir}/zoneinfo/Hongkong \
+ ${datadir}/zoneinfo/Iceland \
+ ${datadir}/zoneinfo/Iran \
+ ${datadir}/zoneinfo/Israel \
+ ${datadir}/zoneinfo/Jamaica \
+ ${datadir}/zoneinfo/Japan \
+ ${datadir}/zoneinfo/Kwajalein \
+ ${datadir}/zoneinfo/Libya \
+ ${datadir}/zoneinfo/Navajo \
+ ${datadir}/zoneinfo/Poland \
+ ${datadir}/zoneinfo/Portugal \
+ ${datadir}/zoneinfo/Singapore \
+ ${datadir}/zoneinfo/Turkey"
+RPROVIDES_tzdata-misc = "tzdata-misc"
+
+
+FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu \
+ ${datadir}/zoneinfo/America/Anchorage \
+ ${datadir}/zoneinfo/America/Los_Angeles \
+ ${datadir}/zoneinfo/America/Denver \
+ ${datadir}/zoneinfo/America/Chicago \
+ ${datadir}/zoneinfo/America/New_York \
+ ${datadir}/zoneinfo/America/Caracas \
+ ${datadir}/zoneinfo/America/Sao_Paulo \
+ ${datadir}/zoneinfo/Europe/London \
+ ${datadir}/zoneinfo/Europe/Paris \
+ ${datadir}/zoneinfo/Africa/Cairo \
+ ${datadir}/zoneinfo/Europe/Moscow \
+ ${datadir}/zoneinfo/Asia/Dubai \
+ ${datadir}/zoneinfo/Asia/Karachi \
+ ${datadir}/zoneinfo/Asia/Dhaka \
+ ${datadir}/zoneinfo/Asia/Bankok \
+ ${datadir}/zoneinfo/Asia/Hong_Kong \
+ ${datadir}/zoneinfo/Asia/Tokyo \
+ ${datadir}/zoneinfo/Australia/Darwin \
+ ${datadir}/zoneinfo/Australia/Adelaide \
+ ${datadir}/zoneinfo/Australia/Brisbane \
+ ${datadir}/zoneinfo/Australia/Sydney \
+ ${datadir}/zoneinfo/Pacific/Noumea \
+ ${datadir}/zoneinfo/CET \
+ ${datadir}/zoneinfo/CST6CDT \
+ ${datadir}/zoneinfo/EET \
+ ${datadir}/zoneinfo/EST \
+ ${datadir}/zoneinfo/EST5EDT \
+ ${datadir}/zoneinfo/GB \
+ ${datadir}/zoneinfo/GMT \
+ ${datadir}/zoneinfo/GMT+0 \
+ ${datadir}/zoneinfo/GMT-0 \
+ ${datadir}/zoneinfo/GMT0 \
+ ${datadir}/zoneinfo/Greenwich \
+ ${datadir}/zoneinfo/HST \
+ ${datadir}/zoneinfo/MET \
+ ${datadir}/zoneinfo/MST \
+ ${datadir}/zoneinfo/MST7MDT \
+ ${datadir}/zoneinfo/NZ \
+ ${datadir}/zoneinfo/NZ-CHAT \
+ ${datadir}/zoneinfo/PRC \
+ ${datadir}/zoneinfo/PST8PDT \
+ ${datadir}/zoneinfo/ROC \
+ ${datadir}/zoneinfo/ROK \
+ ${datadir}/zoneinfo/UCT \
+ ${datadir}/zoneinfo/UTC \
+ ${datadir}/zoneinfo/Universal \
+ ${datadir}/zoneinfo/W-SU \
+ ${datadir}/zoneinfo/WET \
+ ${datadir}/zoneinfo/Zulu \
+ ${datadir}/zoneinfo/Etc/*"
diff --git a/meta/recipes-extended/unzip/unzip_6.0.bb b/meta/recipes-extended/unzip/unzip_6.0.bb
new file mode 100644
index 0000000000..069dfb8781
--- /dev/null
+++ b/meta/recipes-extended/unzip/unzip_6.0.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "A (de)compression library for the ZIP format"
+HOMEPAGE = "http://www.info-zip.org"
+SECTION = "console/utils"
+LICENSE = "Info-ZIP"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=94caec5a51ef55ef711ee4e8b1c69e29"
+PE = "1"
+PR = "r0"
+
+SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/unzip60.tgz"
+S = "${WORKDIR}/unzip60"
+
+export LD = "${CC}"
+LD_virtclass-native = "${CC}"
+
+do_compile() {
+ oe_runmake -f unix/Makefile generic
+}
+
+do_install() {
+ oe_runmake -f unix/Makefile install prefix=${D}${prefix}
+ install -d ${D}${mandir}
+ mv ${D}${prefix}/man/* ${D}${mandir}
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/watchdog/watchdog_5.9.bb b/meta/recipes-extended/watchdog/watchdog_5.9.bb
new file mode 100644
index 0000000000..c768077f1d
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog_5.9.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Watchdog is a daemon that checks if your system is still \
+working. If programs in user space are not longer executed \
+it will reboot the system."
+HOMEPAGE = "http://watchdog.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194"
+
+LICENSE = "GPLv1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8a7258c60a71a2f04b67fb01f495889c"
+
+PR = "r0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz"
+
+inherit autotools
+
+RRECOMMENDS_${PN} = "kernel-module-softdog"
diff --git a/meta/recipes-extended/zile/files/for_build.patch b/meta/recipes-extended/zile/files/for_build.patch
new file mode 100644
index 0000000000..96380fa220
--- /dev/null
+++ b/meta/recipes-extended/zile/files/for_build.patch
@@ -0,0 +1,64 @@
+Index: zile-2.0beta6/acinclude.m4
+===================================================================
+--- zile-2.0beta6.orig/acinclude.m4 2004-12-20 19:13:07.000000000 -0500
++++ zile-2.0beta6/acinclude.m4 2005-01-21 20:38:28.982166344 -0500
+@@ -35,3 +35,29 @@
+ t}
+ fi
+ AC_SUBST(EXEEXT_FOR_BUILD)])dnl
++
++dnl Get a default for CFLAGS_FOR_BUILD to put into Makefile.
++AC_DEFUN([BFD_CFLAGS_FOR_BUILD],
++[ac_test_CFLAGS=${CFLAGS+set}
++# Put a plausible default for CFLAGS_FOR_BUILD in Makefile.
++if test -z "$CFLAGS_FOR_BUILD"; then
++ if test "x$cross_compiling" = "xyes"; then
++ CFLAGS_FOR_BUILD="-O2"
++ else
++ CFLAGS_FOR_BUILD='$(CFLAGS)'
++ fi
++fi
++AC_SUBST(CFLAGS_FOR_BUILD)])dnl
++
++dnl Get a default for LDFLAGS_FOR_BUILD to put into Makefile.
++AC_DEFUN([BFD_LDFLAGS_FOR_BUILD],
++[ac_test_LDFLAGS=${LDFLAGS+set}
++# Put a plausible default for LDFLAGS_FOR_BUILD in Makefile.
++if test -z "$LDFLAGS_FOR_BUILD"; then
++ if test "x$cross_compiling" = "xyes"; then
++ LDFLAGS_FOR_BUILD=""
++ else
++ LDFLAGS_FOR_BUILD='$(LDFLAGS)'
++ fi
++fi
++AC_SUBST(LDFLAGS_FOR_BUILD)])dnl
+Index: zile-2.0beta6/configure.ac
+===================================================================
+--- zile-2.0beta6.orig/configure.ac 2005-01-12 07:56:19.000000000 -0500
++++ zile-2.0beta6/configure.ac 2005-01-21 20:26:58.178184512 -0500
+@@ -19,6 +19,8 @@
+
+ AC_PROG_CC
+ BFD_CC_FOR_BUILD
++BFD_CFLAGS_FOR_BUILD
++BFD_LDFLAGS_FOR_BUILD
+ AC_C_INLINE
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
+Index: zile-2.0beta6/doc/Makefile.am
+===================================================================
+--- zile-2.0beta6.orig/doc/Makefile.am 2005-01-03 06:11:32.000000000 -0500
++++ zile-2.0beta6/doc/Makefile.am 2005-01-21 20:27:17.271281920 -0500
+@@ -27,10 +27,10 @@
+ AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/src
+
+ mkdoc$(EXEEXT_FOR_BUILD): mkdoc.o config.h
+- $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ mkdoc.o
++ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ mkdoc.o
+
+ mkdoc.o: mkdoc.c
+- $(CC_FOR_BUILD) -c -I$(top_srcdir)/doc -I$(top_srcdir) -I$(top_srcdir)/src $(CFLAGS) $(srcdir)/mkdoc.c
++ $(CC_FOR_BUILD) -c -I$(top_srcdir)/doc -I$(top_srcdir) -I$(top_srcdir)/src $(CFLAGS_FOR_BUILD) $(srcdir)/mkdoc.c
+
+ AUTODOC: $(AUTODOCSRCS) mkdoc
+ ./mkdoc $(AUTODOCSRCS) >AUTODOC
diff --git a/meta/recipes-extended/zile/zile_1.7+2.0beta6.bb b/meta/recipes-extended/zile/zile_1.7+2.0beta6.bb
new file mode 100644
index 0000000000..74d832eef3
--- /dev/null
+++ b/meta/recipes-extended/zile/zile_1.7+2.0beta6.bb
@@ -0,0 +1,19 @@
+DESCRIPTION = "Zile is a very small emacs-like editor."
+HOMEPAGE = "http://zile.sourceforge.net/"
+LICENSE = "GPL"
+DEPENDS = "ncurses"
+PRIORITY = "optional"
+SECTION = "console/editors"
+PR = "r1"
+
+UV = "${@bb.data.getVar('PV', d, 1).split('+')[1]}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/zile/zile-${UV}.tar.gz \
+ file://for_build.patch;patch=1"
+S = "${WORKDIR}/zile-${UV}"
+
+inherit autotools
+
+export CC_FOR_BUILD = "${BUILD_CC}"
+export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS} -DHAVE_VASPRINTF"
+export LDFLAGS_FOR_BUILD = "${BUILD_LDFLAGS}"
diff --git a/meta/recipes-extended/zip/zip.inc b/meta/recipes-extended/zip/zip.inc
new file mode 100644
index 0000000000..9550447264
--- /dev/null
+++ b/meta/recipes-extended/zip/zip.inc
@@ -0,0 +1,24 @@
+DESCRIPTION = "Archiver for .zip files"
+HOMEPAGE = "http://www.info-zip.org"
+SECTION = "console/utils"
+
+LICENSE = "Info-ZIP"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=04d43c5d70b496c032308106e26ae17d"
+
+SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@bb.data.getVar('PV',d,1).replace('.', '')}.tgz"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'BIND=${CC}' 'AS=${CC} -c' 'CPP=${CPP}' \
+ 'CFLAGS=-I. -DUNIX ${CFLAGS}' 'INSTALL=install' \
+ 'BINFLAGS=0755' 'INSTALL_D=install -d'"
+
+do_compile() {
+ oe_runmake -f unix/Makefile generic
+}
+
+do_install() {
+ oe_runmake -f unix/Makefile prefix=${D}${prefix} \
+ BINDIR=${D}${bindir} MANDIR=${D}${mandir}/man1 \
+ install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/zip/zip_3.0.bb b/meta/recipes-extended/zip/zip_3.0.bb
new file mode 100644
index 0000000000..c5df637a38
--- /dev/null
+++ b/meta/recipes-extended/zip/zip_3.0.bb
@@ -0,0 +1,6 @@
+require zip.inc
+
+PR="r0"
+
+# zip-2.32 still uses directory name of zip-2.30
+S = "${WORKDIR}/zip30"