diff options
Diffstat (limited to 'meta/recipes-extended')
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 @@ | |||
| 1 | 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" | ||
| 2 | HOMEPAGE = "http://packages.debian.org/unstable/admin/blktool" | ||
| 3 | LICENSE = "GPLv2+" | ||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ | ||
| 5 | file://blktool.c;beginline=7;endline=8;md5=a5e798ea98fd50972088968a15e5f373" | ||
| 6 | DEPENDS = "glib-2.0" | ||
| 7 | |||
| 8 | SRC_URI = "${DEBIAN_MIRROR}/main/b/blktool/blktool_4.orig.tar.gz \ | ||
| 9 | ${DEBIAN_MIRROR}/main/b/blktool/blktool_4-6.diff.gz;apply=yes" | ||
| 10 | |||
| 11 | PR = "r0" | ||
| 12 | S = "${WORKDIR}/${PN}-4.orig" | ||
| 13 | |||
| 14 | 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 @@ | |||
| 1 | |||
| 2 | lib_LTLIBRARIES = libbz2.la | ||
| 3 | |||
| 4 | libbz2_la_SOURCES = blocksort.c \ | ||
| 5 | huffman.c \ | ||
| 6 | crctable.c \ | ||
| 7 | randtable.c \ | ||
| 8 | compress.c \ | ||
| 9 | decompress.c \ | ||
| 10 | bzlib.c | ||
| 11 | |||
| 12 | bin_PROGRAMS = bzip2 bzip2recover | ||
| 13 | |||
| 14 | bzip2_SOURCES = bzip2.c | ||
| 15 | bzip2_LDADD = libbz2.la | ||
| 16 | bzip2_DEPENDENCIES = libbz2.la | ||
| 17 | |||
| 18 | include_HEADERS = bzlib.h | ||
| 19 | |||
| 20 | bzip2recover_SOURCES = bzip2recover.c | ||
| 21 | bzip2recover_LDADD = libbz2.la | ||
| 22 | bzip2recover_DEPENDENCIES = libbz2.la | ||
| 23 | |||
| 24 | bin_SCRIPTS = bzgrep bzmore bzdiff | ||
| 25 | |||
| 26 | man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1 | ||
| 27 | EXTRA_DIST = $(man_MANS) | ||
| 28 | |||
| 29 | install-exec-hook: | ||
| 30 | ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT) | ||
| 31 | ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT) | ||
| 32 | ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT) | ||
| 33 | ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT) | ||
| 34 | ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT) | ||
| 35 | ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT) | ||
| 36 | |||
| 37 | install-data-hook: | ||
| 38 | echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1 | ||
| 39 | echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1 | ||
| 40 | echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1 | ||
| 41 | 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 @@ | |||
| 1 | AC_PREREQ([2.57]) | ||
| 2 | |||
| 3 | AC_INIT(bzip2, 2.0.5, , libXrender) | ||
| 4 | AM_INIT_AUTOMAKE() | ||
| 5 | AM_MAINTAINER_MODE | ||
| 6 | |||
| 7 | #AM_CONFIG_HEADER(config.h) | ||
| 8 | |||
| 9 | # Check for progs | ||
| 10 | AC_PROG_CC | ||
| 11 | AC_PROG_LIBTOOL | ||
| 12 | |||
| 13 | AC_OUTPUT([Makefile]) | ||
| 14 | |||
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 @@ | |||
| 1 | DESCRIPTION = "Very high-quality data compression program." | ||
| 2 | HOMEPAGE = "http://www.bzip.org/" | ||
| 3 | SECTION = "console/utils" | ||
| 4 | LICENSE = "bzip2" | ||
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;beginline=8;endline=37;md5=40d9d1eb05736d1bfc86cfdd9106e6b2" | ||
| 6 | PR = "r2" | ||
| 7 | |||
| 8 | SRC_URI = "http://www.bzip.org/${PV}/${BPN}-${PV}.tar.gz \ | ||
| 9 | file://configure.ac \ | ||
| 10 | file://Makefile.am" | ||
| 11 | |||
| 12 | CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64" | ||
| 13 | |||
| 14 | inherit autotools | ||
| 15 | |||
| 16 | do_configure_prepend () { | ||
| 17 | cp ${WORKDIR}/configure.ac ${S}/ | ||
| 18 | cp ${WORKDIR}/Makefile.am ${S}/ | ||
| 19 | cp ${STAGING_DATADIR_NATIVE}/automake*/install-sh ${S}/ | ||
| 20 | } | ||
| 21 | |||
| 22 | do_install_append () { | ||
| 23 | if [ "${BUILD_ARCH}" != "${HOST_ARCH}" ]; then | ||
| 24 | mv ${D}${bindir}/bunzip2 ${D}${bindir}/bunzip2.${PN} | ||
| 25 | mv ${D}${bindir}/bzcat ${D}${bindir}/bzcat.${PN} | ||
| 26 | fi | ||
| 27 | } | ||
| 28 | |||
| 29 | pkg_postinst_${PN} () { | ||
| 30 | update-alternatives --install ${bindir}/bunzip2 bunzip2 bunzip2.${PN} 100 | ||
| 31 | update-alternatives --install ${bindir}/bzcat bzcat bzcat.${PN} 100 | ||
| 32 | } | ||
| 33 | |||
| 34 | |||
| 35 | pkg_prerm_${PN} () { | ||
| 36 | update-alternatives --remove bunzip2 bunzip2.${PN} | ||
| 37 | update-alternatives --remove bzcat bzcat.${PN} | ||
| 38 | } | ||
| 39 | |||
| 40 | PROVIDES_append_virtclass-native = " bzip2-full-native" | ||
| 41 | 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 @@ | |||
| 1 | DESCRIPTION = "Devicekit power" | ||
| 2 | LICENSE = "GPLv2" | ||
| 3 | DEPENDS = "devicekit glib-2.0 dbus-glib polkit" | ||
| 4 | |||
| 5 | SRC_URI = "http://hal.freedesktop.org/releases/DeviceKit-power-${PV}.tar.gz" | ||
| 6 | S = "${WORKDIR}/DeviceKit-power-${PV}" | ||
| 7 | |||
| 8 | inherit autotools pkgconfig | ||
| 9 | |||
| 10 | do_configure_prepend() { | ||
| 11 | sed -i -e s:-nonet:\:g ${S}/doc/man/Makefile.am | ||
| 12 | } | ||
| 13 | |||
| 14 | EXTRA_OECONF = "--with-backend=linux" | ||
| 15 | |||
| 16 | FILES_${PN} += "${datadir}/dbus-1/ \ | ||
| 17 | ${datadir}/PolicyKit \ | ||
| 18 | ${base_libdir}/udev/* \ | ||
| 19 | " | ||
| 20 | |||
| 21 | 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 @@ | |||
| 1 | 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." | ||
| 2 | LICENSE = "GPLv2" | ||
| 3 | DEPENDS = "udev dbus-glib glib-2.0" | ||
| 4 | |||
| 5 | PR = "r1" | ||
| 6 | |||
| 7 | SRC_URI = "http://hal.freedesktop.org/releases/DeviceKit-${PV}.tar.gz" | ||
| 8 | S = "${WORKDIR}/DeviceKit-${PV}" | ||
| 9 | |||
| 10 | do_configure_prepend() { | ||
| 11 | sed -i -e s:-nonet:\:g ${S}/doc/man/Makefile.am | ||
| 12 | } | ||
| 13 | |||
| 14 | inherit autotools | ||
| 15 | |||
| 16 | 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 @@ | |||
| 1 | LICENSE = "GPL" | ||
| 2 | DEPENDS = "dbus-glib" | ||
| 3 | |||
| 4 | SRC_URI = "git://anongit.freedesktop.org/DeviceKit/DeviceKit;protocol=git \ | ||
| 5 | file://volatile" | ||
| 6 | |||
| 7 | PV = "002+git${SRCREV}" | ||
| 8 | PR = "r2" | ||
| 9 | SRCREV = "014d168ba4bf40c9bae487bacff8bf2aa054b5f6" | ||
| 10 | |||
| 11 | S = "${WORKDIR}/git" | ||
| 12 | |||
| 13 | EXTRA_OECONF = "--disable-man-pages" | ||
| 14 | |||
| 15 | inherit autotools pkgconfig | ||
| 16 | |||
| 17 | do_install_append() { | ||
| 18 | install -d ${D}/etc/default/volatiles | ||
| 19 | install -m 0644 ${WORKDIR}/volatile ${D}/etc/default/volatiles/devicekit | ||
| 20 | } | ||
| 21 | |||
| 22 | pkg_postinst_devicekit () { | ||
| 23 | # can't do this offline | ||
| 24 | if [ "x$D" != "x" ]; then | ||
| 25 | exit 1 | ||
| 26 | fi | ||
| 27 | |||
| 28 | DBUSPID=`pidof dbus-daemon` | ||
| 29 | |||
| 30 | if [ "x$DBUSPID" != "x" ]; then | ||
| 31 | /etc/init.d/dbus-1 reload | ||
| 32 | fi | ||
| 33 | } | ||
| 34 | |||
| 35 | 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 @@ | |||
| 1 | SECTION = "base" | ||
| 2 | LICENSE = "GPL" | ||
| 3 | DESCRIPTION = "Diffutils contains the GNU diff, diff3, \ | ||
| 4 | sdiff, and cmp utilities. These programs are usually \ | ||
| 5 | used for creating patch files." | ||
| 6 | PR = "r3" | ||
| 7 | |||
| 8 | SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.gz" | ||
| 9 | |||
| 10 | inherit autotools update-alternatives gettext | ||
| 11 | |||
| 12 | # diffutils assumes non-glibc compilation with uclibc and | ||
| 13 | # this causes it to generate its own implementations of | ||
| 14 | # standard functionality. regex.c actually breaks compilation | ||
| 15 | # because it uses __mempcpy, there are other things (TBD: | ||
| 16 | # see diffutils.mk in buildroot) | ||
| 17 | EXTRA_OECONF_linux-uclibc = "--without-included-regex" | ||
| 18 | |||
| 19 | do_install_append () { | ||
| 20 | mv ${D}${bindir}/diff ${D}${bindir}/diff.${PN} | ||
| 21 | mv ${D}${bindir}/cmp ${D}${bindir}/cmp.${PN} | ||
| 22 | } | ||
| 23 | |||
| 24 | ALTERNATIVE_NAME = "diff" | ||
| 25 | ALTERNATIVE_PATH = "diff.${PN}" | ||
| 26 | ALTERNATIVE_PRIORITY = "100" | ||
| 27 | |||
| 28 | pkg_postinst_${PN} () { | ||
| 29 | |||
| 30 | update-alternatives --install /usr/bin/cmp cmp cmp.diffutils 100 | ||
| 31 | |||
| 32 | } | ||
| 33 | |||
| 34 | pkg_postrm_${PN} () { | ||
| 35 | |||
| 36 | update-alternatives --remove cmp cmp.diffutils | ||
| 37 | |||
| 38 | } | ||
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 @@ | |||
| 1 | the old AC_USE_SYSTEM_EXTENSIONS won't work with AC_GNU_SOURCE | ||
| 2 | |||
| 3 | against 4.2.31 | ||
| 4 | 07/08/2010 - qhe | ||
| 5 | |||
| 6 | diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4 | ||
| 7 | index 143a9e5..0f27ceb 100644 | ||
| 8 | --- a/gnulib/m4/extensions.m4 | ||
| 9 | +++ b/gnulib/m4/extensions.m4 | ||
| 10 | @@ -12,44 +12,6 @@ | ||
| 11 | # enough in this area it's likely we'll need to redefine | ||
| 12 | # AC_USE_SYSTEM_EXTENSIONS for quite some time. | ||
| 13 | |||
| 14 | -# AC_USE_SYSTEM_EXTENSIONS | ||
| 15 | -# ------------------------ | ||
| 16 | -# Enable extensions on systems that normally disable them, | ||
| 17 | -# typically due to standards-conformance issues. | ||
| 18 | -AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], | ||
| 19 | -[ | ||
| 20 | - AC_BEFORE([$0], [AC_COMPILE_IFELSE]) | ||
| 21 | - AC_BEFORE([$0], [AC_RUN_IFELSE]) | ||
| 22 | - | ||
| 23 | - AC_REQUIRE([AC_GNU_SOURCE]) | ||
| 24 | - AC_REQUIRE([AC_AIX]) | ||
| 25 | - AC_REQUIRE([AC_MINIX]) | ||
| 26 | - | ||
| 27 | - AH_VERBATIM([__EXTENSIONS__], | ||
| 28 | -[/* Enable extensions on Solaris. */ | ||
| 29 | -#ifndef __EXTENSIONS__ | ||
| 30 | -# undef __EXTENSIONS__ | ||
| 31 | -#endif | ||
| 32 | -#ifndef _POSIX_PTHREAD_SEMANTICS | ||
| 33 | -# undef _POSIX_PTHREAD_SEMANTICS | ||
| 34 | -#endif | ||
| 35 | -#ifndef _TANDEM_SOURCE | ||
| 36 | -# undef _TANDEM_SOURCE | ||
| 37 | -#endif]) | ||
| 38 | - AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], | ||
| 39 | - [ac_cv_safe_to_define___extensions__], | ||
| 40 | - [AC_COMPILE_IFELSE( | ||
| 41 | - [AC_LANG_PROGRAM([ | ||
| 42 | -# define __EXTENSIONS__ 1 | ||
| 43 | - AC_INCLUDES_DEFAULT])], | ||
| 44 | - [ac_cv_safe_to_define___extensions__=yes], | ||
| 45 | - [ac_cv_safe_to_define___extensions__=no])]) | ||
| 46 | - test $ac_cv_safe_to_define___extensions__ = yes && | ||
| 47 | - AC_DEFINE([__EXTENSIONS__]) | ||
| 48 | - AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) | ||
| 49 | - AC_DEFINE([_TANDEM_SOURCE]) | ||
| 50 | -]) | ||
| 51 | - | ||
| 52 | # gl_USE_SYSTEM_EXTENSIONS | ||
| 53 | # ------------------------ | ||
| 54 | # 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 @@ | |||
| 1 | commit af974034b68bf59337c7a384e488a518a77dfecd | ||
| 2 | Author: James Youngman <jay@gnu.org> | ||
| 3 | Date: Sat Jul 11 19:55:27 2009 +0100 | ||
| 4 | |||
| 5 | Fix Savannah bug #27017: find -D opt / -fstype ext3 -print , -quit coredump. | ||
| 6 | |||
| 7 | Fix Savannah bug #27017: find -D opt / -fstype ext3 -print , -quit | ||
| 8 | coredumps. | ||
| 9 | * find/tree.c (set_new_parent): Initialise struct | ||
| 10 | predicate->arg_text to NULL (instead of leaving it uninitialised). | ||
| 11 | (get_new_pred_noarg): Likewise. | ||
| 12 | (get_new_pred): Initialise predicate->arg_text to | ||
| 13 | "ThisShouldBeSetToSomethingElse" to make it easier to notice | ||
| 14 | bugs. | ||
| 15 | (get_new_pred_chk_op): Use get_new_pred_noarg. | ||
| 16 | (print_predicate): Use an if statement instead of | ||
| 17 | two ternary operators. | ||
| 18 | * find/util.c (insert_primary_withpred): Accept new argument, arg, | ||
| 19 | being the argument (if any) of this predicate. Pass it to | ||
| 20 | get_new_pred_chk_op. | ||
| 21 | (insert_primary): Likewise (pass arg to insert_primary_withpred). | ||
| 22 | (insert_primary_noarg): New function; calls insert_primary with | ||
| 23 | arg=NULL. | ||
| 24 | * find/parser.c (collect_arg_stat_info): Add an output parameter; | ||
| 25 | the filename from which we collected the stat information. | ||
| 26 | (parse_closeparen, parse_delete, parse_and, parse_or, | ||
| 27 | parse_comma): Use get_new_pred_noarg. | ||
| 28 | (parse_cnewer, parse_newer, parse_anewer): Use new | ||
| 29 | collect_arg_stat_info and insert_primary interface. | ||
| 30 | (parse_print, parse_prune, parse_nouser, parse_empty): Use | ||
| 31 | insert_primary_noarg. | ||
| 32 | (parse_accesscheck, parse_false): Use insert_primary_noarg. | ||
| 33 | (parse_used, parse_iname, parse_fprint, insert_fprint, | ||
| 34 | parse_fstype, parse_ilname): Use new collect_arg and | ||
| 35 | insert_primary interfaces. | ||
| 36 | (parse_ipath, parse_lname, do_parse_xmin, parse_name, parse_path, | ||
| 37 | parse_perm, parse_size, parse_user, parse_time): Use new | ||
| 38 | collect_arg and insert_primary_withpred interface. | ||
| 39 | (parse_negate, parse_openparen): Use new get_new_pred_chk_op interface. | ||
| 40 | (parse_newerXY, parse_nogroup): Use new insert_primary interface. | ||
| 41 | (insert_regex, parse_samefile): Use new insert_primary_withpred | ||
| 42 | interface. | ||
| 43 | (insert_type, insert_fprintf, new_insert_exec_ok, insert_num): Use | ||
| 44 | new insert_primary_withpred interface. | ||
| 45 | * find/defs.h (struct predicate.arg_text): make const. | ||
| 46 | Add declarations for new function get_new_pred_noarg and | ||
| 47 | insert_primary_noarg. Add 'arg' parameter to get_new_pred_chk_op | ||
| 48 | and insert_primary_withpred. | ||
| 49 | |||
| 50 | diff --git a/ChangeLog b/ChangeLog | ||
| 51 | index 6e346b8..e8ba0f8 100644 | ||
| 52 | --- a/ChangeLog | ||
| 53 | +++ b/ChangeLog | ||
| 54 | @@ -1,0 +1,45 @@ | ||
| 55 | +2009-07-11 James Youngman <jay@gnu.org> | ||
| 56 | + | ||
| 57 | + Fix Savannah bug #27017: find -D opt / -fstype ext3 -print , -quit | ||
| 58 | + coredumps. | ||
| 59 | + * find/tree.c (set_new_parent): Initialise struct | ||
| 60 | + predicate->arg_text to NULL (instead of leaving it uninitialised). | ||
| 61 | + (get_new_pred_noarg): Likewise. | ||
| 62 | + (get_new_pred): Initialise predicate->arg_text to | ||
| 63 | + "ThisShouldBeSetToSomethingElse" to make it easier to notice | ||
| 64 | + bugs. | ||
| 65 | + (get_new_pred_chk_op): Use get_new_pred_noarg. | ||
| 66 | + (print_predicate): Use an if statement instead of | ||
| 67 | + two ternary operators. | ||
| 68 | + * find/util.c (insert_primary_withpred): Accept new argument, arg, | ||
| 69 | + being the argument (if any) of this predicate. Pass it to | ||
| 70 | + get_new_pred_chk_op. | ||
| 71 | + (insert_primary): Likewise (pass arg to insert_primary_withpred). | ||
| 72 | + (insert_primary_noarg): New function; calls insert_primary with | ||
| 73 | + arg=NULL. | ||
| 74 | + * find/parser.c (collect_arg_stat_info): Add an output parameter; | ||
| 75 | + the filename from which we collected the stat information. | ||
| 76 | + (parse_closeparen, parse_delete, parse_and, parse_or, | ||
| 77 | + parse_comma): Use get_new_pred_noarg. | ||
| 78 | + (parse_cnewer, parse_newer, parse_anewer): Use new | ||
| 79 | + collect_arg_stat_info and insert_primary interface. | ||
| 80 | + (parse_print, parse_prune, parse_nouser, parse_empty): Use | ||
| 81 | + insert_primary_noarg. | ||
| 82 | + (parse_accesscheck, parse_false): Use insert_primary_noarg. | ||
| 83 | + (parse_used, parse_iname, parse_fprint, insert_fprint, | ||
| 84 | + parse_fstype, parse_ilname): Use new collect_arg and | ||
| 85 | + insert_primary interfaces. | ||
| 86 | + (parse_ipath, parse_lname, do_parse_xmin, parse_name, parse_path, | ||
| 87 | + parse_perm, parse_size, parse_user, parse_time): Use new | ||
| 88 | + collect_arg and insert_primary_withpred interface. | ||
| 89 | + (parse_negate, parse_openparen): Use new get_new_pred_chk_op interface. | ||
| 90 | + (parse_newerXY, parse_nogroup): Use new insert_primary interface. | ||
| 91 | + (insert_regex, parse_samefile): Use new insert_primary_withpred | ||
| 92 | + interface. | ||
| 93 | + (insert_type, insert_fprintf, new_insert_exec_ok, insert_num): Use | ||
| 94 | + new insert_primary_withpred interface. | ||
| 95 | + * find/defs.h (struct predicate.arg_text): make const. | ||
| 96 | + Add declarations for new function get_new_pred_noarg and | ||
| 97 | + insert_primary_noarg. Add 'arg' parameter to get_new_pred_chk_op | ||
| 98 | + and insert_primary_withpred. | ||
| 99 | + | ||
| 100 | diff --git a/find/defs.h b/find/defs.h | ||
| 101 | index 1708d83..4539fd9 100644 | ||
| 102 | --- a/find/defs.h | ||
| 103 | +++ b/find/defs.h | ||
| 104 | @@ -297,7 +297,7 @@ struct predicate | ||
| 105 | boolean artificial; | ||
| 106 | |||
| 107 | /* The raw text of the argument of this predicate. */ | ||
| 108 | - char *arg_text; | ||
| 109 | + const char *arg_text; | ||
| 110 | |||
| 111 | /* Information needed by the predicate processor. | ||
| 112 | Next to each member are listed the predicates that use it. */ | ||
| 113 | @@ -480,13 +480,16 @@ void show_success_rates(const struct predicate *node); | ||
| 114 | /* tree.c */ | ||
| 115 | struct predicate * build_expression_tree PARAMS((int argc, char *argv[], int end_of_leading_options)); | ||
| 116 | struct predicate * get_eval_tree PARAMS((void)); | ||
| 117 | +struct predicate *get_new_pred_noarg (const struct parser_table *entry); | ||
| 118 | struct predicate *get_new_pred PARAMS((const struct parser_table *entry)); | ||
| 119 | -struct predicate *get_new_pred_chk_op PARAMS((const struct parser_table *entry)); | ||
| 120 | +struct predicate *get_new_pred_chk_op PARAMS((const struct parser_table *entry, | ||
| 121 | + const char *arg)); | ||
| 122 | float calculate_derived_rates PARAMS((struct predicate *p)); | ||
| 123 | |||
| 124 | /* util.c */ | ||
| 125 | -struct predicate *insert_primary PARAMS((const struct parser_table *entry)); | ||
| 126 | -struct predicate *insert_primary_withpred PARAMS((const struct parser_table *entry, PRED_FUNC fptr)); | ||
| 127 | +struct predicate *insert_primary PARAMS((const struct parser_table *entry, const char *arg)); | ||
| 128 | +struct predicate *insert_primary_noarg PARAMS((const struct parser_table *entry)); | ||
| 129 | +struct predicate *insert_primary_withpred PARAMS((const struct parser_table *entry, PRED_FUNC fptr, const char *arg)); | ||
| 130 | void usage PARAMS((FILE *fp, int status, char *msg)); | ||
| 131 | extern boolean check_nofollow(void); | ||
| 132 | void complete_pending_execs(struct predicate *p); | ||
| 133 | diff --git a/find/parser.c b/find/parser.c | ||
| 134 | index 534b670..2e6b989 100644 | ||
| 135 | --- a/find/parser.c | ||
| 136 | +++ b/find/parser.c | ||
| 137 | @@ -640,11 +640,13 @@ collect_arg(char **argv, int *arg_ptr, const char **collected_arg) | ||
| 138 | } | ||
| 139 | |||
| 140 | static boolean | ||
| 141 | -collect_arg_stat_info(char **argv, int *arg_ptr, struct stat *p) | ||
| 142 | +collect_arg_stat_info(char **argv, int *arg_ptr, struct stat *p, | ||
| 143 | + const char **argument) | ||
| 144 | { | ||
| 145 | const char *filename; | ||
| 146 | if (collect_arg(argv, arg_ptr, &filename)) | ||
| 147 | { | ||
| 148 | + *argument = filename; | ||
| 149 | if (0 == (options.xstat)(filename, p)) | ||
| 150 | { | ||
| 151 | return true; | ||
| 152 | @@ -656,6 +658,7 @@ collect_arg_stat_info(char **argv, int *arg_ptr, struct stat *p) | ||
| 153 | } | ||
| 154 | else | ||
| 155 | { | ||
| 156 | + *argument = NULL; | ||
| 157 | return false; | ||
| 158 | } | ||
| 159 | } | ||
| 160 | @@ -679,7 +682,7 @@ parse_and (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 161 | (void) argv; | ||
| 162 | (void) arg_ptr; | ||
| 163 | |||
| 164 | - our_pred = get_new_pred (entry); | ||
| 165 | + our_pred = get_new_pred_noarg (entry); | ||
| 166 | our_pred->pred_func = pred_and; | ||
| 167 | our_pred->p_type = BI_OP; | ||
| 168 | our_pred->p_prec = AND_PREC; | ||
| 169 | @@ -691,11 +694,12 @@ static boolean | ||
| 170 | parse_anewer (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 171 | { | ||
| 172 | struct stat stat_newer; | ||
| 173 | + const char *arg; | ||
| 174 | |||
| 175 | set_stat_placeholders(&stat_newer); | ||
| 176 | - if (collect_arg_stat_info(argv, arg_ptr, &stat_newer)) | ||
| 177 | + if (collect_arg_stat_info(argv, arg_ptr, &stat_newer, &arg)) | ||
| 178 | { | ||
| 179 | - struct predicate *our_pred = insert_primary (entry); | ||
| 180 | + struct predicate *our_pred = insert_primary (entry, arg); | ||
| 181 | our_pred->args.reftime.xval = XVAL_ATIME; | ||
| 182 | our_pred->args.reftime.ts = get_stat_mtime(&stat_newer); | ||
| 183 | our_pred->args.reftime.kind = COMP_GT; | ||
| 184 | @@ -713,7 +717,7 @@ parse_closeparen (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 185 | (void) argv; | ||
| 186 | (void) arg_ptr; | ||
| 187 | |||
| 188 | - our_pred = get_new_pred (entry); | ||
| 189 | + our_pred = get_new_pred_noarg (entry); | ||
| 190 | our_pred->pred_func = pred_closeparen; | ||
| 191 | our_pred->p_type = CLOSE_PAREN; | ||
| 192 | our_pred->p_prec = NO_PREC; | ||
| 193 | @@ -725,11 +729,12 @@ static boolean | ||
| 194 | parse_cnewer (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 195 | { | ||
| 196 | struct stat stat_newer; | ||
| 197 | + const char *arg; | ||
| 198 | |||
| 199 | set_stat_placeholders(&stat_newer); | ||
| 200 | - if (collect_arg_stat_info(argv, arg_ptr, &stat_newer)) | ||
| 201 | + if (collect_arg_stat_info(argv, arg_ptr, &stat_newer, &arg)) | ||
| 202 | { | ||
| 203 | - struct predicate *our_pred = insert_primary (entry); | ||
| 204 | + struct predicate *our_pred = insert_primary (entry, arg); | ||
| 205 | our_pred->args.reftime.xval = XVAL_CTIME; /* like -newercm */ | ||
| 206 | our_pred->args.reftime.ts = get_stat_mtime(&stat_newer); | ||
| 207 | our_pred->args.reftime.kind = COMP_GT; | ||
| 208 | @@ -747,7 +752,7 @@ parse_comma (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 209 | (void) argv; | ||
| 210 | (void) arg_ptr; | ||
| 211 | |||
| 212 | - our_pred = get_new_pred (entry); | ||
| 213 | + our_pred = get_new_pred_noarg (entry); | ||
| 214 | our_pred->pred_func = pred_comma; | ||
| 215 | our_pred->p_type = BI_OP; | ||
| 216 | our_pred->p_prec = COMMA_PREC; | ||
| 217 | @@ -786,7 +791,7 @@ parse_delete (const struct parser_table* entry, char *argv[], int *arg_ptr) | ||
| 218 | (void) argv; | ||
| 219 | (void) arg_ptr; | ||
| 220 | |||
| 221 | - our_pred = insert_primary (entry); | ||
| 222 | + our_pred = insert_primary_noarg (entry); | ||
| 223 | our_pred->side_effects = our_pred->no_default_print = true; | ||
| 224 | /* -delete implies -depth */ | ||
| 225 | options.do_dir_first = false; | ||
| 226 | @@ -831,7 +836,7 @@ parse_empty (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 227 | (void) argv; | ||
| 228 | (void) arg_ptr; | ||
| 229 | |||
| 230 | - our_pred = insert_primary (entry); | ||
| 231 | + our_pred = insert_primary_noarg (entry); | ||
| 232 | our_pred->est_success_rate = 0.01f; /* assume 1% of files are empty. */ | ||
| 233 | return true; | ||
| 234 | } | ||
| 235 | @@ -856,7 +861,7 @@ parse_false (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 236 | (void) argv; | ||
| 237 | (void) arg_ptr; | ||
| 238 | |||
| 239 | - our_pred = insert_primary (entry); | ||
| 240 | + our_pred = insert_primary_noarg (entry); | ||
| 241 | our_pred->need_stat = our_pred->need_type = false; | ||
| 242 | our_pred->side_effects = our_pred->no_default_print = false; | ||
| 243 | our_pred->est_success_rate = 0.0f; | ||
| 244 | @@ -866,7 +871,7 @@ parse_false (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 245 | static boolean | ||
| 246 | insert_fls (const struct parser_table* entry, const char *filename) | ||
| 247 | { | ||
| 248 | - struct predicate *our_pred = insert_primary (entry); | ||
| 249 | + struct predicate *our_pred = insert_primary_noarg (entry); | ||
| 250 | if (filename) | ||
| 251 | open_output_file (filename, &our_pred->args.printf_vec); | ||
| 252 | else | ||
| 253 | @@ -899,7 +904,7 @@ parse_fprint (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 254 | const char *filename; | ||
| 255 | if (collect_arg(argv, arg_ptr, &filename)) | ||
| 256 | { | ||
| 257 | - our_pred = insert_primary (entry); | ||
| 258 | + our_pred = insert_primary (entry, filename); | ||
| 259 | open_output_file (filename, &our_pred->args.printf_vec); | ||
| 260 | our_pred->side_effects = our_pred->no_default_print = true; | ||
| 261 | our_pred->need_stat = our_pred->need_type = false; | ||
| 262 | @@ -915,7 +920,7 @@ parse_fprint (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 263 | static boolean | ||
| 264 | insert_fprint(const struct parser_table* entry, const char *filename) | ||
| 265 | { | ||
| 266 | - struct predicate *our_pred = insert_primary (entry); | ||
| 267 | + struct predicate *our_pred = insert_primary (entry, filename); | ||
| 268 | if (filename) | ||
| 269 | open_output_file (filename, &our_pred->args.printf_vec); | ||
| 270 | else | ||
| 271 | @@ -960,7 +965,7 @@ parse_fstype (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 272 | const char *typename; | ||
| 273 | if (collect_arg(argv, arg_ptr, &typename)) | ||
| 274 | { | ||
| 275 | - struct predicate *our_pred = insert_primary (entry); | ||
| 276 | + struct predicate *our_pred = insert_primary (entry, typename); | ||
| 277 | our_pred->args.str = typename; | ||
| 278 | |||
| 279 | /* This is an expensive operation, so although there are | ||
| 280 | @@ -1090,7 +1095,7 @@ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 281 | return false; | ||
| 282 | } | ||
| 283 | } | ||
| 284 | - our_pred = insert_primary (entry); | ||
| 285 | + our_pred = insert_primary (entry, groupname); | ||
| 286 | our_pred->args.gid = gid; | ||
| 287 | our_pred->est_success_rate = (our_pred->args.numinfo.l_val < 100) ? 0.99 : 0.2; | ||
| 288 | return true; | ||
| 289 | @@ -1160,7 +1165,7 @@ parse_ilname (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 290 | const char *name; | ||
| 291 | if (collect_arg(argv, arg_ptr, &name)) | ||
| 292 | { | ||
| 293 | - struct predicate *our_pred = insert_primary (entry); | ||
| 294 | + struct predicate *our_pred = insert_primary (entry, name); | ||
| 295 | our_pred->args.str = name; | ||
| 296 | /* Use the generic glob pattern estimator to figure out how many | ||
| 297 | * links will match, but bear in mind that most files won't be links. | ||
| 298 | @@ -1227,7 +1232,7 @@ parse_iname (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 299 | { | ||
| 300 | if (check_name_arg("-iname", name)) | ||
| 301 | { | ||
| 302 | - struct predicate *our_pred = insert_primary (entry); | ||
| 303 | + struct predicate *our_pred = insert_primary (entry, name); | ||
| 304 | our_pred->need_stat = our_pred->need_type = false; | ||
| 305 | our_pred->args.str = name; | ||
| 306 | our_pred->est_success_rate = estimate_pattern_match_rate(name, 0); | ||
| 307 | @@ -1268,7 +1273,7 @@ parse_ipath (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 308 | fnmatch_sanitycheck (); | ||
| 309 | if (collect_arg (argv, arg_ptr, &name)) | ||
| 310 | { | ||
| 311 | - struct predicate *our_pred = insert_primary_withpred (entry, pred_ipath); | ||
| 312 | + struct predicate *our_pred = insert_primary_withpred (entry, pred_ipath, name); | ||
| 313 | our_pred->need_stat = our_pred->need_type = false; | ||
| 314 | our_pred->args.str = name; | ||
| 315 | our_pred->est_success_rate = estimate_pattern_match_rate (name, 0); | ||
| 316 | @@ -1316,7 +1321,7 @@ parse_lname (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 317 | fnmatch_sanitycheck(); | ||
| 318 | if (collect_arg(argv, arg_ptr, &name)) | ||
| 319 | { | ||
| 320 | - struct predicate *our_pred = insert_primary (entry); | ||
| 321 | + struct predicate *our_pred = insert_primary (entry, name); | ||
| 322 | our_pred->args.str = name; | ||
| 323 | our_pred->est_success_rate = 0.1 * estimate_pattern_match_rate(name, 0); | ||
| 324 | return true; | ||
| 325 | @@ -1391,7 +1396,7 @@ do_parse_xmin (const struct parser_table* entry, | ||
| 326 | "arithmetic overflow while converting %s " | ||
| 327 | "minutes to a number of seconds")) | ||
| 328 | { | ||
| 329 | - struct predicate *our_pred = insert_primary (entry); | ||
| 330 | + struct predicate *our_pred = insert_primary (entry, minutes); | ||
| 331 | our_pred->args.reftime = tval; | ||
| 332 | our_pred->est_success_rate = estimate_timestamp_success_rate(tval.ts.tv_sec); | ||
| 333 | return true; | ||
| 334 | @@ -1427,7 +1432,7 @@ parse_name (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 335 | fnmatch_sanitycheck(); | ||
| 336 | if (check_name_arg("-name", name)) | ||
| 337 | { | ||
| 338 | - struct predicate *our_pred = insert_primary (entry); | ||
| 339 | + struct predicate *our_pred = insert_primary (entry, name); | ||
| 340 | our_pred->need_stat = our_pred->need_type = false; | ||
| 341 | our_pred->args.str = name; | ||
| 342 | our_pred->est_success_rate = estimate_pattern_match_rate(name, 0); | ||
| 343 | @@ -1445,7 +1450,7 @@ parse_negate (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 344 | (void) &argv; | ||
| 345 | (void) &arg_ptr; | ||
| 346 | |||
| 347 | - our_pred = get_new_pred_chk_op (entry); | ||
| 348 | + our_pred = get_new_pred_chk_op (entry, NULL); | ||
| 349 | our_pred->pred_func = pred_negate; | ||
| 350 | our_pred->p_type = UNI_OP; | ||
| 351 | our_pred->p_prec = NEGATE_PREC; | ||
| 352 | @@ -1458,11 +1463,12 @@ parse_newer (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 353 | { | ||
| 354 | struct predicate *our_pred; | ||
| 355 | struct stat stat_newer; | ||
| 356 | + const char *arg; | ||
| 357 | |||
| 358 | set_stat_placeholders(&stat_newer); | ||
| 359 | - if (collect_arg_stat_info(argv, arg_ptr, &stat_newer)) | ||
| 360 | + if (collect_arg_stat_info(argv, arg_ptr, &stat_newer, &arg)) | ||
| 361 | { | ||
| 362 | - our_pred = insert_primary (entry); | ||
| 363 | + our_pred = insert_primary (entry, arg); | ||
| 364 | our_pred->args.reftime.ts = get_stat_mtime(&stat_newer); | ||
| 365 | our_pred->args.reftime.xval = XVAL_MTIME; | ||
| 366 | our_pred->args.reftime.kind = COMP_GT; | ||
| 367 | @@ -1530,7 +1536,7 @@ parse_newerXY (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 368 | (*arg_ptr)++; | ||
| 369 | } | ||
| 370 | |||
| 371 | - our_pred = insert_primary (entry); | ||
| 372 | + our_pred = insert_primary (entry, argv[*arg_ptr]); | ||
| 373 | |||
| 374 | |||
| 375 | switch (x) | ||
| 376 | @@ -1623,7 +1629,7 @@ parse_nogroup (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 377 | (void) &argv; | ||
| 378 | (void) &arg_ptr; | ||
| 379 | |||
| 380 | - our_pred = insert_primary (entry); | ||
| 381 | + our_pred = insert_primary (entry, NULL); | ||
| 382 | our_pred->est_success_rate = 1e-4; | ||
| 383 | #ifdef CACHE_IDS | ||
| 384 | if (gid_unused == NULL) | ||
| 385 | @@ -1660,7 +1666,7 @@ parse_nouser (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 386 | (void) arg_ptr; | ||
| 387 | |||
| 388 | |||
| 389 | - our_pred = insert_primary (entry); | ||
| 390 | + our_pred = insert_primary_noarg (entry); | ||
| 391 | our_pred->est_success_rate = 1e-3; | ||
| 392 | #ifdef CACHE_IDS | ||
| 393 | if (uid_unused == NULL) | ||
| 394 | @@ -1716,7 +1722,7 @@ parse_openparen (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 395 | (void) argv; | ||
| 396 | (void) arg_ptr; | ||
| 397 | |||
| 398 | - our_pred = get_new_pred_chk_op (entry); | ||
| 399 | + our_pred = get_new_pred_chk_op (entry, NULL); | ||
| 400 | our_pred->pred_func = pred_openparen; | ||
| 401 | our_pred->p_type = OPEN_PAREN; | ||
| 402 | our_pred->p_prec = NO_PREC; | ||
| 403 | @@ -1732,7 +1738,7 @@ parse_or (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 404 | (void) argv; | ||
| 405 | (void) arg_ptr; | ||
| 406 | |||
| 407 | - our_pred = get_new_pred (entry); | ||
| 408 | + our_pred = get_new_pred_noarg (entry); | ||
| 409 | our_pred->pred_func = pred_or; | ||
| 410 | our_pred->p_type = BI_OP; | ||
| 411 | our_pred->p_prec = OR_PREC; | ||
| 412 | @@ -1756,7 +1762,7 @@ parse_path (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 413 | const char *name; | ||
| 414 | if (collect_arg(argv, arg_ptr, &name)) | ||
| 415 | { | ||
| 416 | - struct predicate *our_pred = insert_primary_withpred (entry, pred_path); | ||
| 417 | + struct predicate *our_pred = insert_primary_withpred (entry, pred_path, name); | ||
| 418 | our_pred->need_stat = our_pred->need_type = false; | ||
| 419 | our_pred->args.str = name; | ||
| 420 | our_pred->est_success_rate = estimate_pattern_match_rate (name, 0); | ||
| 421 | @@ -1894,7 +1900,7 @@ parse_perm (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 422 | rate = 0.9986; /* probably matches anything but a broken symlink */ | ||
| 423 | } | ||
| 424 | |||
| 425 | - our_pred = insert_primary (entry); | ||
| 426 | + our_pred = insert_primary (entry, perm_expr); | ||
| 427 | our_pred->est_success_rate = rate; | ||
| 428 | if (havekind) | ||
| 429 | { | ||
| 430 | @@ -1928,7 +1934,7 @@ parse_print (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 431 | (void) argv; | ||
| 432 | (void) arg_ptr; | ||
| 433 | |||
| 434 | - our_pred = insert_primary (entry); | ||
| 435 | + our_pred = insert_primary_noarg (entry); | ||
| 436 | /* -print has the side effect of printing. This prevents us | ||
| 437 | from doing undesired multiple printing when the user has | ||
| 438 | already specified -print. */ | ||
| 439 | @@ -1981,7 +1987,7 @@ parse_prune (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 440 | (void) argv; | ||
| 441 | (void) arg_ptr; | ||
| 442 | |||
| 443 | - our_pred = insert_primary (entry); | ||
| 444 | + our_pred = insert_primary_noarg (entry); | ||
| 445 | if (options.do_dir_first == false) | ||
| 446 | our_pred->need_stat = our_pred->need_type = false; | ||
| 447 | /* -prune has a side effect that it does not descend into | ||
| 448 | @@ -1994,7 +2000,7 @@ parse_prune (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 449 | static boolean | ||
| 450 | parse_quit (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 451 | { | ||
| 452 | - struct predicate *our_pred = insert_primary (entry); | ||
| 453 | + struct predicate *our_pred = insert_primary_noarg (entry); | ||
| 454 | (void) argv; | ||
| 455 | (void) arg_ptr; | ||
| 456 | our_pred->need_stat = our_pred->need_type = false; | ||
| 457 | @@ -2036,7 +2042,7 @@ insert_regex (char **argv, | ||
| 458 | { | ||
| 459 | struct re_pattern_buffer *re; | ||
| 460 | const char *error_message; | ||
| 461 | - struct predicate *our_pred = insert_primary_withpred (entry, pred_regex); | ||
| 462 | + struct predicate *our_pred = insert_primary_withpred (entry, pred_regex, rx); | ||
| 463 | our_pred->need_stat = our_pred->need_type = false; | ||
| 464 | re = xmalloc (sizeof (struct re_pattern_buffer)); | ||
| 465 | our_pred->args.regex = re; | ||
| 466 | @@ -2061,6 +2067,7 @@ static boolean | ||
| 467 | parse_size (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 468 | { | ||
| 469 | struct predicate *our_pred; | ||
| 470 | + char *arg; | ||
| 471 | uintmax_t num; | ||
| 472 | char suffix; | ||
| 473 | enum comparison_type c_type; | ||
| 474 | @@ -2073,42 +2080,43 @@ parse_size (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 475 | */ | ||
| 476 | if ((argv == NULL) || (argv[*arg_ptr] == NULL)) | ||
| 477 | return false; | ||
| 478 | + arg = argv[*arg_ptr]; | ||
| 479 | |||
| 480 | - len = strlen (argv[*arg_ptr]); | ||
| 481 | + len = strlen (arg); | ||
| 482 | if (len == 0) | ||
| 483 | error (1, 0, _("invalid null argument to -size")); | ||
| 484 | |||
| 485 | - suffix = argv[*arg_ptr][len - 1]; | ||
| 486 | + suffix = arg[len - 1]; | ||
| 487 | switch (suffix) | ||
| 488 | { | ||
| 489 | case 'b': | ||
| 490 | blksize = 512; | ||
| 491 | - argv[*arg_ptr][len - 1] = '\0'; | ||
| 492 | + arg[len - 1] = '\0'; | ||
| 493 | break; | ||
| 494 | |||
| 495 | case 'c': | ||
| 496 | blksize = 1; | ||
| 497 | - argv[*arg_ptr][len - 1] = '\0'; | ||
| 498 | + arg[len - 1] = '\0'; | ||
| 499 | break; | ||
| 500 | |||
| 501 | case 'k': | ||
| 502 | blksize = 1024; | ||
| 503 | - argv[*arg_ptr][len - 1] = '\0'; | ||
| 504 | + arg[len - 1] = '\0'; | ||
| 505 | break; | ||
| 506 | |||
| 507 | case 'M': /* Megabytes */ | ||
| 508 | blksize = 1024*1024; | ||
| 509 | - argv[*arg_ptr][len - 1] = '\0'; | ||
| 510 | + arg[len - 1] = '\0'; | ||
| 511 | break; | ||
| 512 | |||
| 513 | case 'G': /* Gigabytes */ | ||
| 514 | blksize = 1024*1024*1024; | ||
| 515 | - argv[*arg_ptr][len - 1] = '\0'; | ||
| 516 | + arg[len - 1] = '\0'; | ||
| 517 | break; | ||
| 518 | |||
| 519 | case 'w': | ||
| 520 | blksize = 2; | ||
| 521 | - argv[*arg_ptr][len - 1] = '\0'; | ||
| 522 | + arg[len - 1] = '\0'; | ||
| 523 | break; | ||
| 524 | |||
| 525 | case '0': | ||
| 526 | @@ -2127,14 +2135,14 @@ parse_size (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 527 | error (1, 0, _("invalid -size type `%c'"), argv[*arg_ptr][len - 1]); | ||
| 528 | } | ||
| 529 | /* TODO: accept fractional megabytes etc. ? */ | ||
| 530 | - if (!get_num (argv[*arg_ptr], &num, &c_type)) | ||
| 531 | + if (!get_num (arg, &num, &c_type)) | ||
| 532 | { | ||
| 533 | error(1, 0, | ||
| 534 | _("Invalid argument `%s%c' to -size"), | ||
| 535 | - argv[*arg_ptr], (int)suffix); | ||
| 536 | + arg, (int)suffix); | ||
| 537 | return false; | ||
| 538 | } | ||
| 539 | - our_pred = insert_primary (entry); | ||
| 540 | +our_pred = insert_primary (entry, arg); | ||
| 541 | our_pred->args.size.kind = c_type; | ||
| 542 | our_pred->args.size.blocksize = blksize; | ||
| 543 | our_pred->args.size.size = num; | ||
| 544 | @@ -2162,9 +2170,10 @@ parse_samefile (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 545 | struct predicate *our_pred; | ||
| 546 | struct stat st, fst; | ||
| 547 | int fd, openflags; | ||
| 548 | + const char *filename; | ||
| 549 | |||
| 550 | set_stat_placeholders(&st); | ||
| 551 | - if (!collect_arg_stat_info(argv, arg_ptr, &st)) | ||
| 552 | + if (!collect_arg_stat_info(argv, arg_ptr, &st, &filename)) | ||
| 553 | return false; | ||
| 554 | |||
| 555 | set_stat_placeholders(&fst); | ||
| 556 | @@ -2289,7 +2298,7 @@ parse_samefile (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 557 | } | ||
| 558 | } | ||
| 559 | |||
| 560 | - our_pred = insert_primary (entry); | ||
| 561 | + our_pred = insert_primary (entry, filename); | ||
| 562 | our_pred->args.samefileid.ino = st.st_ino; | ||
| 563 | our_pred->args.samefileid.dev = st.st_dev; | ||
| 564 | our_pred->args.samefileid.fd = fd; | ||
| 565 | @@ -2350,7 +2359,7 @@ parse_true (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 566 | (void) argv; | ||
| 567 | (void) arg_ptr; | ||
| 568 | |||
| 569 | - our_pred = insert_primary (entry); | ||
| 570 | + our_pred = insert_primary_noarg (entry); | ||
| 571 | our_pred->need_stat = our_pred->need_type = false; | ||
| 572 | our_pred->est_success_rate = 1.0f; | ||
| 573 | return true; | ||
| 574 | @@ -2369,7 +2378,7 @@ parse_accesscheck (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 575 | struct predicate *our_pred; | ||
| 576 | (void) argv; | ||
| 577 | (void) arg_ptr; | ||
| 578 | - our_pred = insert_primary (entry); | ||
| 579 | + our_pred = insert_primary_noarg (entry); | ||
| 580 | our_pred->need_stat = our_pred->need_type = false; | ||
| 581 | our_pred->side_effects = our_pred->no_default_print = false; | ||
| 582 | if (pred_is(our_pred, pred_executable)) | ||
| 583 | @@ -2414,7 +2423,7 @@ parse_used (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 584 | struct timespec zero = {0,0}; | ||
| 585 | if (get_relative_timestamp(offset_str, &tval, zero, DAYSECS, errmsg)) | ||
| 586 | { | ||
| 587 | - our_pred = insert_primary (entry); | ||
| 588 | + our_pred = insert_primary (entry, offset_str); | ||
| 589 | our_pred->args.reftime = tval; | ||
| 590 | our_pred->est_success_rate = estimate_file_age_success_rate(tval.ts.tv_sec / DAYSECS); | ||
| 591 | return true; | ||
| 592 | @@ -2472,7 +2481,7 @@ parse_user (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 593 | return false; | ||
| 594 | } | ||
| 595 | } | ||
| 596 | - our_pred = insert_primary (entry); | ||
| 597 | + our_pred = insert_primary (entry, username); | ||
| 598 | our_pred->args.uid = uid; | ||
| 599 | our_pred->est_success_rate = (our_pred->args.uid < 100) ? 0.99 : 0.2; | ||
| 600 | return true; | ||
| 601 | @@ -2650,7 +2659,7 @@ insert_type (char **argv, int *arg_ptr, | ||
| 602 | error(1, 0, _("Unknown argument to -type: %c"), (*typeletter)); | ||
| 603 | return false; | ||
| 604 | } | ||
| 605 | - our_pred = insert_primary_withpred (entry, which_pred); | ||
| 606 | + our_pred = insert_primary_withpred (entry, which_pred, typeletter); | ||
| 607 | our_pred->est_success_rate = rate; | ||
| 608 | |||
| 609 | /* Figure out if we will need to stat the file, because if we don't | ||
| 610 | @@ -2706,7 +2715,7 @@ insert_fprintf (struct format_val *vec, | ||
| 611 | struct segment **segmentp; /* Address of current segment. */ | ||
| 612 | struct predicate *our_pred; | ||
| 613 | |||
| 614 | - our_pred = insert_primary_withpred (entry, func); | ||
| 615 | + our_pred = insert_primary_withpred (entry, func, format_const); | ||
| 616 | our_pred->side_effects = our_pred->no_default_print = true; | ||
| 617 | our_pred->args.printf_vec = *vec; | ||
| 618 | our_pred->need_type = false; | ||
| 619 | @@ -3045,7 +3054,7 @@ new_insert_exec_ok (const char *action, | ||
| 620 | if ((argv == NULL) || (argv[*arg_ptr] == NULL)) | ||
| 621 | return false; | ||
| 622 | |||
| 623 | - our_pred = insert_primary_withpred (entry, func); | ||
| 624 | + our_pred = insert_primary_withpred (entry, func, "(some -exec* arguments)"); | ||
| 625 | our_pred->side_effects = our_pred->no_default_print = true; | ||
| 626 | our_pred->need_type = our_pred->need_stat = false; | ||
| 627 | |||
| 628 | @@ -3374,7 +3383,7 @@ parse_time (const struct parser_table* entry, char *argv[], int *arg_ptr) | ||
| 629 | if (!get_relative_timestamp(timearg, &tval, origin, DAYSECS, errmsg)) | ||
| 630 | return false; | ||
| 631 | |||
| 632 | - our_pred = insert_primary (entry); | ||
| 633 | + our_pred = insert_primary (entry, orig_timearg); | ||
| 634 | our_pred->args.reftime = tval; | ||
| 635 | our_pred->est_success_rate = estimate_timestamp_success_rate(tval.ts.tv_sec); | ||
| 636 | |||
| 637 | @@ -3487,7 +3496,7 @@ insert_num (char **argv, int *arg_ptr, const struct parser_table *entry) | ||
| 638 | |||
| 639 | if (get_num (numstr, &num, &c_type)) | ||
| 640 | { | ||
| 641 | - struct predicate *our_pred = insert_primary (entry); | ||
| 642 | + struct predicate *our_pred = insert_primary (entry, numstr); | ||
| 643 | our_pred->args.numinfo.kind = c_type; | ||
| 644 | our_pred->args.numinfo.l_val = num; | ||
| 645 | |||
| 646 | diff --git a/find/tree.c b/find/tree.c | ||
| 647 | index 7420c60..60a0601 100644 | ||
| 648 | --- a/find/tree.c | ||
| 649 | +++ b/find/tree.c | ||
| 650 | @@ -269,10 +269,14 @@ predicate_is_cost_free(const struct predicate *p) | ||
| 651 | /* Prints a predicate */ | ||
| 652 | void print_predicate(FILE *fp, const struct predicate *p) | ||
| 653 | { | ||
| 654 | - fprintf (fp, "%s%s%s", | ||
| 655 | - p->p_name, | ||
| 656 | - p->arg_text ? " " : "", | ||
| 657 | - p->arg_text ? p->arg_text : ""); | ||
| 658 | + if (p->arg_text) | ||
| 659 | + { | ||
| 660 | + fprintf (fp, "%s %s", p->p_name, p->arg_text); | ||
| 661 | + } | ||
| 662 | + else | ||
| 663 | + { | ||
| 664 | + fprintf (fp, "%s", p->p_name); | ||
| 665 | + } | ||
| 666 | } | ||
| 667 | |||
| 668 | |||
| 669 | @@ -832,7 +836,8 @@ set_new_parent (struct predicate *curr, enum predicate_precedence high_prec, str | ||
| 670 | new_parent->need_stat = false; | ||
| 671 | new_parent->need_type = false; | ||
| 672 | new_parent->p_cost = NeedsNothing; | ||
| 673 | - | ||
| 674 | + new_parent->arg_text = NULL; | ||
| 675 | + | ||
| 676 | switch (high_prec) | ||
| 677 | { | ||
| 678 | case COMMA_PREC: | ||
| 679 | @@ -1393,6 +1398,18 @@ init_pred_perf(struct predicate *pred) | ||
| 680 | p->visits = p->successes = 0; | ||
| 681 | } | ||
| 682 | |||
| 683 | + | ||
| 684 | +struct predicate * | ||
| 685 | +get_new_pred_noarg (const struct parser_table *entry) | ||
| 686 | +{ | ||
| 687 | + struct predicate *p = get_new_pred(entry); | ||
| 688 | + if (p) | ||
| 689 | + { | ||
| 690 | + p->arg_text = NULL; | ||
| 691 | + } | ||
| 692 | + return p; | ||
| 693 | +} | ||
| 694 | + | ||
| 695 | |||
| 696 | /* Return a pointer to a new predicate structure, which has been | ||
| 697 | linked in as the last one in the predicates list. | ||
| 698 | @@ -1433,6 +1450,8 @@ get_new_pred (const struct parser_table *entry) | ||
| 699 | last_pred->no_default_print = false; | ||
| 700 | last_pred->need_stat = true; | ||
| 701 | last_pred->need_type = true; | ||
| 702 | + last_pred->p_cost = NeedsUnknown; | ||
| 703 | + last_pred->arg_text = "ThisShouldBeSetToSomethingElse"; | ||
| 704 | last_pred->args.str = NULL; | ||
| 705 | last_pred->pred_next = NULL; | ||
| 706 | last_pred->pred_left = NULL; | ||
| 707 | @@ -1449,7 +1468,8 @@ get_new_pred (const struct parser_table *entry) | ||
| 708 | predicate is an operator. If it isn't, the AND operator is inserted. */ | ||
| 709 | |||
| 710 | struct predicate * | ||
| 711 | -get_new_pred_chk_op (const struct parser_table *entry) | ||
| 712 | +get_new_pred_chk_op (const struct parser_table *entry, | ||
| 713 | + const char *arg) | ||
| 714 | { | ||
| 715 | struct predicate *new_pred; | ||
| 716 | static const struct parser_table *entry_and = NULL; | ||
| 717 | @@ -1471,13 +1491,14 @@ get_new_pred_chk_op (const struct parser_table *entry) | ||
| 718 | case PRIMARY_TYPE: | ||
| 719 | case CLOSE_PAREN: | ||
| 720 | /* We need to interpose the and operator. */ | ||
| 721 | - new_pred = get_new_pred (entry_and); | ||
| 722 | + new_pred = get_new_pred_noarg (entry_and); | ||
| 723 | new_pred->pred_func = pred_and; | ||
| 724 | new_pred->p_name = "-a"; | ||
| 725 | new_pred->p_type = BI_OP; | ||
| 726 | new_pred->p_prec = AND_PREC; | ||
| 727 | new_pred->need_stat = false; | ||
| 728 | new_pred->need_type = false; | ||
| 729 | + new_pred->arg_text = NULL; | ||
| 730 | new_pred->args.str = NULL; | ||
| 731 | new_pred->side_effects = false; | ||
| 732 | new_pred->no_default_print = false; | ||
| 733 | @@ -1488,6 +1509,7 @@ get_new_pred_chk_op (const struct parser_table *entry) | ||
| 734 | } | ||
| 735 | |||
| 736 | new_pred = get_new_pred (entry); | ||
| 737 | + new_pred->arg_text = arg; | ||
| 738 | new_pred->parser_entry = entry; | ||
| 739 | return new_pred; | ||
| 740 | } | ||
| 741 | diff --git a/find/util.c b/find/util.c | ||
| 742 | index a06eada..cc9a3eb 100644 | ||
| 743 | --- a/find/util.c | ||
| 744 | +++ b/find/util.c | ||
| 745 | @@ -89,11 +89,13 @@ static struct debug_option_assoc debugassoc[] = | ||
| 746 | operator. */ | ||
| 747 | |||
| 748 | struct predicate * | ||
| 749 | -insert_primary_withpred (const struct parser_table *entry, PRED_FUNC pred_func) | ||
| 750 | +insert_primary_withpred (const struct parser_table *entry, | ||
| 751 | + PRED_FUNC pred_func, | ||
| 752 | + const char *arg) | ||
| 753 | { | ||
| 754 | struct predicate *new_pred; | ||
| 755 | |||
| 756 | - new_pred = get_new_pred_chk_op (entry); | ||
| 757 | + new_pred = get_new_pred_chk_op (entry, arg); | ||
| 758 | new_pred->pred_func = pred_func; | ||
| 759 | new_pred->p_name = entry->parser_name; | ||
| 760 | new_pred->args.str = NULL; | ||
| 761 | @@ -118,10 +120,16 @@ insert_primary_withpred (const struct parser_table *entry, PRED_FUNC pred_func) | ||
| 762 | either not there at all (we are the very first node) or is an | ||
| 763 | operator. */ | ||
| 764 | struct predicate * | ||
| 765 | -insert_primary (const struct parser_table *entry) | ||
| 766 | +insert_primary (const struct parser_table *entry, const char *arg) | ||
| 767 | { | ||
| 768 | assert (entry->pred_func != NULL); | ||
| 769 | - return insert_primary_withpred(entry, entry->pred_func); | ||
| 770 | + return insert_primary_withpred(entry, entry->pred_func, arg); | ||
| 771 | +} | ||
| 772 | + | ||
| 773 | +struct predicate * | ||
| 774 | +insert_primary_noarg (const struct parser_table *entry) | ||
| 775 | +{ | ||
| 776 | + return insert_primary(entry, NULL); | ||
| 777 | } | ||
| 778 | |||
| 779 | |||
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 @@ | |||
| 1 | commit 76ed377d6d3e4a83a00cabd401f751b37ecd1e7b | ||
| 2 | Author: James Youngman <jay@gnu.org> | ||
| 3 | Date: Sat Feb 20 13:11:45 2010 +0000 | ||
| 4 | |||
| 5 | Fix Savannah bug# 28824: "-ctime x" yields "missing argument to `-ctime'". | ||
| 6 | |||
| 7 | * find/parser.c (parse_fls): If the argument is invalid, reverse | ||
| 8 | the change that collect_arg() made to *arg_ptr (that is, don't | ||
| 9 | consume the argument). | ||
| 10 | (parse_fprint0): Likewise. | ||
| 11 | (parse_gid): Likewise. | ||
| 12 | (parse_group): Likewise. | ||
| 13 | (parse_inum): Likewise. | ||
| 14 | (parse_links): Likewise. | ||
| 15 | (do_parse_xmin): Likewise. | ||
| 16 | (parse_name): Likewise. | ||
| 17 | (parse_printf): Likewise. | ||
| 18 | (parse_uid): Likewise. | ||
| 19 | (parse_used): Likewise. | ||
| 20 | (parse_time): Likewise. | ||
| 21 | |||
| 22 | Signed-off-by: James Youngman <jay@gnu.org> | ||
| 23 | |||
| 24 | diff --git a/ChangeLog b/ChangeLog | ||
| 25 | index d0ce1fe..13539a4 100644 | ||
| 26 | --- a/ChangeLog | ||
| 27 | +++ b/ChangeLog | ||
| 28 | @@ -1,0 +1,19 @@ | ||
| 29 | +2010-02-20 James Youngman <jay@gnu.org> | ||
| 30 | + | ||
| 31 | + Fix Savannah bug# 28824: "-ctime x" yields "missing argument to | ||
| 32 | + `-ctime'". | ||
| 33 | + * find/parser.c (parse_fls): If the argument is invalid, reverse | ||
| 34 | + the change that collect_arg() made to *arg_ptr (that is, don't | ||
| 35 | + consume the argument). | ||
| 36 | + (parse_fprint0): Likewise. | ||
| 37 | + (parse_gid): Likewise. | ||
| 38 | + (parse_group): Likewise. | ||
| 39 | + (parse_inum): Likewise. | ||
| 40 | + (parse_links): Likewise. | ||
| 41 | + (do_parse_xmin): Likewise. | ||
| 42 | + (parse_name): Likewise. | ||
| 43 | + (parse_printf): Likewise. | ||
| 44 | + (parse_uid): Likewise. | ||
| 45 | + (parse_used): Likewise. | ||
| 46 | + (parse_time): Likewise. | ||
| 47 | + | ||
| 48 | diff --git a/NEWS b/NEWS | ||
| 49 | index 5394311..4e910df 100644 | ||
| 50 | --- a/NEWS | ||
| 51 | +++ b/NEWS | ||
| 52 | @@ -4,5 +4,8 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout) | ||
| 53 | |||
| 54 | ** Bug Fixes | ||
| 55 | |||
| 56 | +#28824: Corrected error message for "-ctime x". | ||
| 57 | + Likewise for -gid, -inum, -links, -mmin, -cmin, -amin, | ||
| 58 | + -uid, -used, -atime, -mtime, -ctime. | ||
| 59 | #26537: find -prune now makes sure it has valid stat() information. | ||
| 60 | |||
| 61 | diff --git a/find/parser.c b/find/parser.c | ||
| 62 | index 2e6b989..08758ee 100644 | ||
| 63 | --- a/find/parser.c | ||
| 64 | +++ b/find/parser.c | ||
| 65 | @@ -886,8 +886,14 @@ static boolean | ||
| 66 | parse_fls (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 67 | { | ||
| 68 | const char *filename; | ||
| 69 | - return collect_arg(argv, arg_ptr, &filename) | ||
| 70 | - && insert_fls(entry, filename); | ||
| 71 | + if (collect_arg(argv, arg_ptr, &filename)) | ||
| 72 | + { | ||
| 73 | + if (insert_fls(entry, filename)) | ||
| 74 | + return true; | ||
| 75 | + else | ||
| 76 | + --*arg_ptr; /* don't consume the invalid arg. */ | ||
| 77 | + } | ||
| 78 | + return false; | ||
| 79 | } | ||
| 80 | |||
| 81 | static boolean | ||
| 82 | @@ -937,9 +943,13 @@ parse_fprint0 (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 83 | { | ||
| 84 | const char *filename; | ||
| 85 | if (collect_arg(argv, arg_ptr, &filename)) | ||
| 86 | - return insert_fprint(entry, filename); | ||
| 87 | - else | ||
| 88 | - return false; | ||
| 89 | + { | ||
| 90 | + if (insert_fprint(entry, filename)) | ||
| 91 | + return true; | ||
| 92 | + else | ||
| 93 | + --*arg_ptr; /* don't consume the bad arg. */ | ||
| 94 | + } | ||
| 95 | + return false; | ||
| 96 | } | ||
| 97 | |||
| 98 | static float estimate_fstype_success_rate(const char *fsname) | ||
| 99 | @@ -993,6 +1003,7 @@ parse_gid (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 100 | } | ||
| 101 | else | ||
| 102 | { | ||
| 103 | + --*arg_ptr; /* don't consume the invalid argument. */ | ||
| 104 | return false; | ||
| 105 | } | ||
| 106 | } | ||
| 107 | @@ -1049,6 +1060,7 @@ static boolean | ||
| 108 | parse_group (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 109 | { | ||
| 110 | const char *groupname; | ||
| 111 | + const int saved_argc = *arg_ptr; | ||
| 112 | |||
| 113 | if (collect_arg(argv, arg_ptr, &groupname)) | ||
| 114 | { | ||
| 115 | @@ -1077,6 +1089,7 @@ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 116 | "because it has the unexpected suffix %s"), | ||
| 117 | quotearg_n_style(0, options.err_quoting_style, groupname), | ||
| 118 | quotearg_n_style(1, options.err_quoting_style, groupname+gid_len)); | ||
| 119 | + *arg_ptr = saved_argc; /* don't consume the invalid argument. */ | ||
| 120 | return false; | ||
| 121 | } | ||
| 122 | } | ||
| 123 | @@ -1092,6 +1105,7 @@ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 124 | { | ||
| 125 | error(1, 0, _("argument to -group is empty, but should be a group name")); | ||
| 126 | } | ||
| 127 | + *arg_ptr = saved_argc; /* don't consume the invalid argument. */ | ||
| 128 | return false; | ||
| 129 | } | ||
| 130 | } | ||
| 131 | @@ -1256,6 +1270,7 @@ parse_inum (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 132 | } | ||
| 133 | else | ||
| 134 | { | ||
| 135 | + --*arg_ptr; /* don't consume the invalid argument. */ | ||
| 136 | return false; | ||
| 137 | } | ||
| 138 | } | ||
| 139 | @@ -1310,6 +1325,7 @@ parse_links (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 140 | } | ||
| 141 | else | ||
| 142 | { | ||
| 143 | + --*arg_ptr; /* don't consume the invalid argument. */ | ||
| 144 | return false; | ||
| 145 | } | ||
| 146 | } | ||
| 147 | @@ -1358,6 +1374,7 @@ insert_depthspec(const struct parser_table* entry, char **argv, int *arg_ptr, | ||
| 148 | error(1, 0, _("Expected a positive decimal integer argument to %s, but got %s"), | ||
| 149 | predicate, | ||
| 150 | quotearg_n_style(0, options.err_quoting_style, depthstr)); | ||
| 151 | + /* NOTREACHED */ | ||
| 152 | return false; | ||
| 153 | } | ||
| 154 | /* missing argument */ | ||
| 155 | @@ -1385,6 +1402,7 @@ do_parse_xmin (const struct parser_table* entry, | ||
| 156 | enum xval xv) | ||
| 157 | { | ||
| 158 | const char *minutes; | ||
| 159 | + const int saved_argc = *arg_ptr; | ||
| 160 | |||
| 161 | if (collect_arg(argv, arg_ptr, &minutes)) | ||
| 162 | { | ||
| 163 | @@ -1401,6 +1419,11 @@ do_parse_xmin (const struct parser_table* entry, | ||
| 164 | our_pred->est_success_rate = estimate_timestamp_success_rate(tval.ts.tv_sec); | ||
| 165 | return true; | ||
| 166 | } | ||
| 167 | + else | ||
| 168 | + { | ||
| 169 | + /* Don't consume the invalid argument. */ | ||
| 170 | + *arg_ptr = saved_argc; | ||
| 171 | + } | ||
| 172 | } | ||
| 173 | return false; | ||
| 174 | } | ||
| 175 | @@ -1427,6 +1450,8 @@ static boolean | ||
| 176 | parse_name (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 177 | { | ||
| 178 | const char *name; | ||
| 179 | + const int saved_argc = *arg_ptr; | ||
| 180 | + | ||
| 181 | if (collect_arg(argv, arg_ptr, &name)) | ||
| 182 | { | ||
| 183 | fnmatch_sanitycheck(); | ||
| 184 | @@ -1438,6 +1463,10 @@ parse_name (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 185 | our_pred->est_success_rate = estimate_pattern_match_rate(name, 0); | ||
| 186 | return true; | ||
| 187 | } | ||
| 188 | + else | ||
| 189 | + { | ||
| 190 | + *arg_ptr = saved_argc; /* don't consume the invalid argument. */ | ||
| 191 | + } | ||
| 192 | } | ||
| 193 | return false; | ||
| 194 | } | ||
| 195 | @@ -1954,11 +1983,21 @@ static boolean | ||
| 196 | parse_printf (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 197 | { | ||
| 198 | const char *format; | ||
| 199 | + const int saved_argc = *arg_ptr; | ||
| 200 | + | ||
| 201 | if (collect_arg(argv, arg_ptr, &format)) | ||
| 202 | { | ||
| 203 | struct format_val fmt; | ||
| 204 | open_stdout(&fmt); | ||
| 205 | - return insert_fprintf (&fmt, entry, pred_fprintf, format); | ||
| 206 | + if (insert_fprintf (&fmt, entry, pred_fprintf, format)) | ||
| 207 | + { | ||
| 208 | + return true; | ||
| 209 | + } | ||
| 210 | + else | ||
| 211 | + { | ||
| 212 | + *arg_ptr = saved_argc; /* don't consume the invalid argument. */ | ||
| 213 | + return false; | ||
| 214 | + } | ||
| 215 | } | ||
| 216 | return false; | ||
| 217 | } | ||
| 218 | @@ -1967,15 +2006,21 @@ static boolean | ||
| 219 | parse_fprintf (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 220 | { | ||
| 221 | const char *format, *filename; | ||
| 222 | + int saved_argc = *arg_ptr; | ||
| 223 | + | ||
| 224 | if (collect_arg(argv, arg_ptr, &filename)) | ||
| 225 | { | ||
| 226 | if (collect_arg(argv, arg_ptr, &format)) | ||
| 227 | { | ||
| 228 | struct format_val fmt; | ||
| 229 | open_output_file (filename, &fmt); | ||
| 230 | - return insert_fprintf (&fmt, entry, pred_fprintf, format); | ||
| 231 | + saved_argc = *arg_ptr; | ||
| 232 | + | ||
| 233 | + if (insert_fprintf (&fmt, entry, pred_fprintf, format)) | ||
| 234 | + return true; | ||
| 235 | } | ||
| 236 | } | ||
| 237 | + *arg_ptr = saved_argc; /* don't consume the invalid argument. */ | ||
| 238 | return false; | ||
| 239 | } | ||
| 240 | |||
| 241 | @@ -2405,6 +2450,7 @@ parse_uid (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 242 | } | ||
| 243 | else | ||
| 244 | { | ||
| 245 | + --*arg_ptr; /* don't consume the invalid argument. */ | ||
| 246 | return false; | ||
| 247 | } | ||
| 248 | } | ||
| 249 | @@ -2431,6 +2477,7 @@ parse_used (const struct parser_table* entry, char **argv, int *arg_ptr) | ||
| 250 | else | ||
| 251 | { | ||
| 252 | error(1, 0, _("Invalid argument %s to -used"), offset_str); | ||
| 253 | + /*NOTREACHED*/ | ||
| 254 | return false; | ||
| 255 | } | ||
| 256 | } | ||
| 257 | @@ -2610,6 +2657,7 @@ insert_type (char **argv, int *arg_ptr, | ||
| 258 | if (strlen(typeletter) != 1u) | ||
| 259 | { | ||
| 260 | error(1, 0, _("Arguments to -type should contain only one letter")); | ||
| 261 | + /*NOTREACHED*/ | ||
| 262 | return false; | ||
| 263 | } | ||
| 264 | |||
| 265 | @@ -2657,6 +2705,7 @@ insert_type (char **argv, int *arg_ptr, | ||
| 266 | #endif | ||
| 267 | default: /* None of the above ... nuke 'em. */ | ||
| 268 | error(1, 0, _("Unknown argument to -type: %c"), (*typeletter)); | ||
| 269 | + /*NOTREACHED*/ | ||
| 270 | return false; | ||
| 271 | } | ||
| 272 | our_pred = insert_primary_withpred (entry, which_pred, typeletter); | ||
| 273 | @@ -3349,6 +3398,7 @@ parse_time (const struct parser_table* entry, char *argv[], int *arg_ptr) | ||
| 274 | const char *errmsg = "arithmetic overflow while converting %s " | ||
| 275 | "days to a number of seconds"; | ||
| 276 | struct timespec origin; | ||
| 277 | + const int saved_argc = *arg_ptr; | ||
| 278 | |||
| 279 | if (!collect_arg(argv, arg_ptr, &timearg)) | ||
| 280 | return false; | ||
| 281 | @@ -3381,7 +3431,10 @@ parse_time (const struct parser_table* entry, char *argv[], int *arg_ptr) | ||
| 282 | timearg = orig_timearg; | ||
| 283 | |||
| 284 | if (!get_relative_timestamp(timearg, &tval, origin, DAYSECS, errmsg)) | ||
| 285 | - return false; | ||
| 286 | + { | ||
| 287 | + *arg_ptr = saved_argc; /* don't consume the invalid argument */ | ||
| 288 | + return false; | ||
| 289 | + } | ||
| 290 | |||
| 291 | our_pred = insert_primary (entry, orig_timearg); | ||
| 292 | 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 @@ | |||
| 1 | commit 5f5eb921765794e8fc58c4bdffa2daa2ae34800f | ||
| 2 | Author: James Youngman <jay@gnu.org> | ||
| 3 | Date: Sat Feb 20 19:53:13 2010 +0000 | ||
| 4 | |||
| 5 | Fix Savannah bug#28872, Mistake in "Problems with -exec and filenames" | ||
| 6 | |||
| 7 | * doc/find.texi (Problems with -exec and filenames): Add missing | ||
| 8 | $0 argument in example for sh -c 'something "$@" sh ... | ||
| 9 | * NEWS: Mention this change. | ||
| 10 | |||
| 11 | Signed-off-by: James Youngman <jay@gnu.org> | ||
| 12 | |||
| 13 | diff --git a/ChangeLog b/ChangeLog | ||
| 14 | index 13539a4..e94ba96 100644 | ||
| 15 | --- a/ChangeLog | ||
| 16 | +++ b/ChangeLog | ||
| 17 | @@ -1,5 +1,10 @@ | ||
| 18 | 2010-02-20 James Youngman <jay@gnu.org> | ||
| 19 | |||
| 20 | + Fix Savannah bug#28872, Mistake in "Problems with -exec and filenames" | ||
| 21 | + * doc/find.texi (Problems with -exec and filenames): Add missing | ||
| 22 | + $0 argument in example for sh -c 'something "$@" sh ... | ||
| 23 | + * NEWS: Mention this change. | ||
| 24 | + | ||
| 25 | Fix Savannah bug# 28824: "-ctime x" yields "missing argument to | ||
| 26 | `-ctime'". | ||
| 27 | * find/parser.c (parse_fls): If the argument is invalid, reverse | ||
| 28 | diff --git a/NEWS b/NEWS | ||
| 29 | index 4e910df..4c97be9 100644 | ||
| 30 | --- a/NEWS | ||
| 31 | +++ b/NEWS | ||
| 32 | @@ -4,6 +4,9 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout) | ||
| 33 | |||
| 34 | ** Bug Fixes | ||
| 35 | |||
| 36 | +#28872: Mistake in "#safer" example in "Problems with -exec and | ||
| 37 | + filenames" section of the Texinfo manual. | ||
| 38 | + | ||
| 39 | #28824: Corrected error message for "-ctime x". | ||
| 40 | Likewise for -gid, -inum, -links, -mmin, -cmin, -amin, | ||
| 41 | -uid, -used, -atime, -mtime, -ctime. | ||
| 42 | diff --git a/doc/find.texi b/doc/find.texi | ||
| 43 | index 2e5958d..391ffa0 100644 | ||
| 44 | --- a/doc/find.texi | ||
| 45 | +++ b/doc/find.texi | ||
| 46 | @@ -4830,8 +4830,8 @@ problem: | ||
| 47 | |||
| 48 | @example | ||
| 49 | # safer | ||
| 50 | -find -exec sh -c 'something "$@@"' @{@} \; | ||
| 51 | -find -execdir sh -c 'something "$@@"' @{@}\; | ||
| 52 | +find -exec sh -c 'something "$@@"' sh @{@} \; | ||
| 53 | +find -execdir sh -c 'something "$@@"' sh @{@}\; | ||
| 54 | @end example | ||
| 55 | |||
| 56 | 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 @@ | |||
| 1 | DESCRIPTION = "find, locate, and xargs binaries." | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/findutils/" | ||
| 3 | BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils" | ||
| 4 | SECTION = "console/utils" | ||
| 5 | |||
| 6 | # GPLv2+ (<< 4.2.32), GPLv3+ (>= 4.2.32) | ||
| 7 | LICENSE = "GPLv3+" | ||
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949" | ||
| 9 | |||
| 10 | SRC_URI = "${GNU_MIRROR}/findutils/findutils-${PV}.tar.gz" | ||
| 11 | |||
| 12 | inherit autotools gettext | ||
| 13 | |||
| 14 | # diffutils assumes non-glibc compilation with uclibc and | ||
| 15 | # this causes it to generate its own implementations of | ||
| 16 | # standard functionality. regex.c actually breaks compilation | ||
| 17 | # because it uses __mempcpy, there are other things (TBD: | ||
| 18 | # see diffutils.mk in buildroot) | ||
| 19 | 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 @@ | |||
| 1 | DESCRIPTION = "find, locate, and xargs binaries." | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/findutils/" | ||
| 3 | BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils" | ||
| 4 | SECTION = "console/utils" | ||
| 5 | |||
| 6 | LICENSE = "GPLv2+" | ||
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" | ||
| 8 | PR = "r1" | ||
| 9 | |||
| 10 | SRC_URI = "${GNU_MIRROR}/findutils/findutils-${PV}.tar.gz \ | ||
| 11 | file://gnulib-extension.patch" | ||
| 12 | |||
| 13 | inherit autotools gettext | ||
| 14 | |||
| 15 | # diffutils assumes non-glibc compilation with uclibc and | ||
| 16 | # this causes it to generate its own implementations of | ||
| 17 | # standard functionality. regex.c actually breaks compilation | ||
| 18 | # because it uses __mempcpy, there are other things (TBD: | ||
| 19 | # see diffutils.mk in buildroot) | ||
| 20 | EXTRA_OECONF_linux-uclibc = "--without-included-regex" | ||
| 21 | |||
| 22 | do_install_append () { | ||
| 23 | if [ -e ${D}${bindir}/find ]; then | ||
| 24 | mv ${D}${bindir}/find ${D}${bindir}/find.${PN} | ||
| 25 | mv ${D}${bindir}/xargs ${D}${bindir}/xargs.${PN} | ||
| 26 | fi | ||
| 27 | } | ||
| 28 | |||
| 29 | pkg_postinst_${PN} () { | ||
| 30 | for i in find xargs; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done | ||
| 31 | } | ||
| 32 | |||
| 33 | pkg_prerm_${PN} () { | ||
| 34 | for i in find xargs; do update-alternatives --remove $i $i.${PN}; done | ||
| 35 | } | ||
| 36 | |||
| 37 | 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 @@ | |||
| 1 | require findutils.inc | ||
| 2 | |||
| 3 | PR = "r0" | ||
| 4 | |||
| 5 | SRC_URI += "file://01-27017.patch \ | ||
| 6 | file://02-28824.patch \ | ||
| 7 | file://03-28872.patch" | ||
| 8 | |||
| 9 | # http://savannah.gnu.org/bugs/?27299 | ||
| 10 | EXTRA_OECONF += "gl_cv_func_wcwidth_works=yes" | ||
| 11 | |||
| 12 | do_install_append () { | ||
| 13 | if [ -e ${D}${bindir}/find ]; then | ||
| 14 | mv ${D}${bindir}/find ${D}${bindir}/find.${PN} | ||
| 15 | mv ${D}${bindir}/xargs ${D}${bindir}/xargs.${PN} | ||
| 16 | fi | ||
| 17 | } | ||
| 18 | |||
| 19 | pkg_postinst_${PN} () { | ||
| 20 | for i in find xargs; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done | ||
| 21 | } | ||
| 22 | |||
| 23 | pkg_prerm_${PN} () { | ||
| 24 | for i in find xargs; do update-alternatives --remove $i $i.${PN}; done | ||
| 25 | } | ||
| 26 | |||
| 27 | 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 @@ | |||
| 1 | DESCRIPTION = "GNU gperf is a perfect hash function generator" | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/gperf" | ||
| 3 | SUMMARY = "Generate a perfect hash function from a set of keywords" | ||
| 4 | LICENSE = "GPLv3+" | ||
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ | ||
| 6 | file://src/main.cc;firstline=8;endline=19;md5=24688d2dff69bcf5cbea4bc3e4174c5a" | ||
| 7 | |||
| 8 | SRC_URI = "${GNU_MIRROR}/gperf/gperf-${PV}.tar.gz" | ||
| 9 | |||
| 10 | inherit autotools | ||
| 11 | |||
| 12 | # autoreconf couldn't find acinclude.m4 when stepping into subdirectory. Instead of | ||
| 13 | # duplicating acinclude.m4 in every subdirectory, use absolute include path to aclocal | ||
| 14 | EXTRA_AUTORECONF += " -I ${S}" | ||
| 15 | |||
| 16 | do_configure_prepend() { | ||
| 17 | if [ ! -e acinclude.m4 ]; then | ||
| 18 | cat aclocal.m4 > acinclude.m4 | ||
| 19 | fi | ||
| 20 | } | ||
| 21 | |||
| 22 | 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 @@ | |||
| 1 | require gperf.inc | ||
| 2 | |||
| 3 | LICENSE = "GPLv2+" | ||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=a5f84abb0070adf8a0925d7d534b6e0a \ | ||
| 5 | file://src/main.cc;firstline=8;endline=19;md5=3eab12ba436c4da725b19b131def6de9" | ||
| 6 | |||
| 7 | 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 @@ | |||
| 1 | require gperf.inc | ||
| 2 | |||
| 3 | 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 @@ | |||
| 1 | # Fix to use mempcpy instead of __mempcpy. This is needed for uclibc which | ||
| 2 | # doesn't define __mempcpy, only mempcpy. Since both uclibc and glibc have | ||
| 3 | # mempcpy, we'll just use that instead. | ||
| 4 | # Patch source: OpenEmbedded | ||
| 5 | |||
| 6 | Index: grep-2.5.1/intl/localealias.c | ||
| 7 | =================================================================== | ||
| 8 | --- grep-2.5.1.orig/intl/localealias.c 2002-03-14 00:39:06.000000000 +1100 | ||
| 9 | +++ grep-2.5.1/intl/localealias.c 2007-05-17 13:53:58.000000000 +1000 | ||
| 10 | @@ -65,7 +65,7 @@ | ||
| 11 | # define strcasecmp __strcasecmp | ||
| 12 | |||
| 13 | # ifndef mempcpy | ||
| 14 | -# define mempcpy __mempcpy | ||
| 15 | +# error "mempcpy not detected" | ||
| 16 | # endif | ||
| 17 | # define HAVE_MEMPCPY 1 | ||
| 18 | # define HAVE___FSETLOCKING 1 | ||
| 19 | Index: grep-2.5.1/lib/getopt.c | ||
| 20 | =================================================================== | ||
| 21 | --- grep-2.5.1.orig/lib/getopt.c 2001-03-04 16:33:12.000000000 +1100 | ||
| 22 | +++ grep-2.5.1/lib/getopt.c 2007-05-17 13:51:44.000000000 +1000 | ||
| 23 | @@ -326,7 +326,7 @@ | ||
| 24 | nonoption_flags_len = nonoption_flags_max_len = 0; | ||
| 25 | else | ||
| 26 | { | ||
| 27 | - memset (__mempcpy (new_str, __getopt_nonoption_flags, | ||
| 28 | + memset (mempcpy (new_str, __getopt_nonoption_flags, | ||
| 29 | nonoption_flags_max_len), | ||
| 30 | '\0', top + 1 - nonoption_flags_max_len); | ||
| 31 | nonoption_flags_max_len = top + 1; | ||
| 32 | @@ -437,7 +437,7 @@ | ||
| 33 | if (__getopt_nonoption_flags == NULL) | ||
| 34 | nonoption_flags_max_len = -1; | ||
| 35 | else | ||
| 36 | - memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), | ||
| 37 | + memset (mempcpy (__getopt_nonoption_flags, orig_str, len), | ||
| 38 | '\0', nonoption_flags_max_len - len); | ||
| 39 | } | ||
| 40 | } | ||
| 41 | Index: grep-2.5.1/lib/regex.c | ||
| 42 | =================================================================== | ||
| 43 | --- grep-2.5.1.orig/lib/regex.c 2001-04-03 04:04:45.000000000 +1000 | ||
| 44 | +++ grep-2.5.1/lib/regex.c 2007-05-17 13:51:48.000000000 +1000 | ||
| 45 | @@ -7842,7 +7842,7 @@ | ||
| 46 | if (msg_size > errbuf_size) | ||
| 47 | { | ||
| 48 | #if defined HAVE_MEMPCPY || defined _LIBC | ||
| 49 | - *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; | ||
| 50 | + *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; | ||
| 51 | #else | ||
| 52 | memcpy (errbuf, msg, errbuf_size - 1); | ||
| 53 | 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 @@ | |||
| 1 | DESCRIPTION = "grep GNU utility" | ||
| 2 | SECTION = "console/utils" | ||
| 3 | LICENSE = "GPLv2" | ||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" | ||
| 5 | |||
| 6 | PR = "r1" | ||
| 7 | |||
| 8 | SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.bz2 \ | ||
| 9 | file://uclibc-fix.patch" | ||
| 10 | |||
| 11 | SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c" | ||
| 12 | SRC_URI[sha256sum] = "38c8a2bb9223d1fb1b10bdd607cf44830afc92fd451ac4cd07619bf92bdd3132" | ||
| 13 | |||
| 14 | inherit autotools gettext | ||
| 15 | |||
| 16 | EXTRA_OECONF = "--disable-perl-regexp --disable-ncurses" | ||
| 17 | |||
| 18 | do_configure_prepend () { | ||
| 19 | rm -f ${S}/m4/init.m4 | ||
| 20 | } | ||
| 21 | |||
| 22 | do_install () { | ||
| 23 | autotools_do_install | ||
| 24 | install -d ${D}${base_bindir} | ||
| 25 | mv ${D}${bindir}/grep ${D}${base_bindir}/grep.${PN} | ||
| 26 | mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep.${PN} | ||
| 27 | mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep.${PN} | ||
| 28 | } | ||
| 29 | |||
| 30 | pkg_postinst_${PN} () { | ||
| 31 | update-alternatives --install ${base_bindir}/grep grep grep.${PN} 100 | ||
| 32 | update-alternatives --install ${base_bindir}/egrep egrep egrep.${PN} 100 | ||
| 33 | update-alternatives --install ${base_bindir}/fgrep fgrep fgrep.${PN} 100 | ||
| 34 | } | ||
| 35 | |||
| 36 | pkg_prerm_${PN} () { | ||
| 37 | update-alternatives --remove grep grep.${PN} | ||
| 38 | update-alternatives --remove egrep egrep.${PN} | ||
| 39 | update-alternatives --remove fgrep fgrep.${PN} | ||
| 40 | } | ||
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 @@ | |||
| 1 | gzip uses gnulib, whose header conflict with glibc. This patch rename some function to avoid conflict. | ||
| 2 | |||
| 3 | Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> | ||
| 4 | Index: gzip-1.3.12/gzip.c | ||
| 5 | =================================================================== | ||
| 6 | --- gzip-1.3.12.orig/gzip.c 2010-08-13 10:29:38.000000000 +0800 | ||
| 7 | +++ gzip-1.3.12/gzip.c 2010-08-13 10:29:44.000000000 +0800 | ||
| 8 | @@ -1637,7 +1637,7 @@ | ||
| 9 | } | ||
| 10 | } | ||
| 11 | |||
| 12 | - if (futimens (ofd, ofname, timespec) != 0) | ||
| 13 | + if (futimens_gnulib (ofd, ofname, timespec) != 0) | ||
| 14 | { | ||
| 15 | int e = errno; | ||
| 16 | WARN ((stderr, "%s: ", program_name)); | ||
| 17 | Index: gzip-1.3.12/lib/utimens.c | ||
| 18 | =================================================================== | ||
| 19 | --- gzip-1.3.12.orig/lib/utimens.c 2010-08-13 10:33:47.000000000 +0800 | ||
| 20 | +++ gzip-1.3.12/lib/utimens.c 2010-08-13 10:34:02.000000000 +0800 | ||
| 21 | @@ -75,7 +75,7 @@ | ||
| 22 | Return 0 on success, -1 (setting errno) on failure. */ | ||
| 23 | |||
| 24 | int | ||
| 25 | -futimens (int fd ATTRIBUTE_UNUSED, | ||
| 26 | +futimens_gnulib (int fd ATTRIBUTE_UNUSED, | ||
| 27 | char const *file, struct timespec const timespec[2]) | ||
| 28 | { | ||
| 29 | /* Some Linux-based NFS clients are buggy, and mishandle time stamps | ||
| 30 | @@ -185,5 +185,5 @@ | ||
| 31 | int | ||
| 32 | utimens (char const *file, struct timespec const timespec[2]) | ||
| 33 | { | ||
| 34 | - return futimens (-1, file, timespec); | ||
| 35 | + return futimens_gnulib (-1, file, timespec); | ||
| 36 | } | ||
| 37 | Index: gzip-1.3.12/lib/utimens.h | ||
| 38 | =================================================================== | ||
| 39 | --- gzip-1.3.12.orig/lib/utimens.h 2010-08-13 10:14:57.000000000 +0800 | ||
| 40 | +++ gzip-1.3.12/lib/utimens.h 2010-08-13 10:21:45.000000000 +0800 | ||
| 41 | @@ -1,3 +1,3 @@ | ||
| 42 | #include <time.h> | ||
| 43 | -int futimens (int, char const *, struct timespec const [2]); | ||
| 44 | +int futimens_gnulib (int, char const *, struct timespec const [2]); | ||
| 45 | 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 @@ | |||
| 1 | remove AC_USE_SYSTEM_EXTENSIONS to fix the autoconf error "AC_REQUIRE: circular | ||
| 2 | dependency of AC_GNU_SOURCE" | ||
| 3 | |||
| 4 | Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> | ||
| 5 | Index: gzip-1.3.12/m4/extensions.m4 | ||
| 6 | =================================================================== | ||
| 7 | --- gzip-1.3.12.orig/m4/extensions.m4 2010-08-16 14:18:16.000000000 +0800 | ||
| 8 | +++ gzip-1.3.12/m4/extensions.m4 2010-08-16 14:21:54.000000000 +0800 | ||
| 9 | @@ -12,44 +12,6 @@ | ||
| 10 | # enough in this area it's likely we'll need to redefine | ||
| 11 | # AC_USE_SYSTEM_EXTENSIONS for quite some time. | ||
| 12 | |||
| 13 | -# AC_USE_SYSTEM_EXTENSIONS | ||
| 14 | -# ------------------------ | ||
| 15 | -# Enable extensions on systems that normally disable them, | ||
| 16 | -# typically due to standards-conformance issues. | ||
| 17 | -AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], | ||
| 18 | -[ | ||
| 19 | - AC_BEFORE([$0], [AC_COMPILE_IFELSE]) | ||
| 20 | - AC_BEFORE([$0], [AC_RUN_IFELSE]) | ||
| 21 | - | ||
| 22 | - AC_REQUIRE([AC_GNU_SOURCE]) | ||
| 23 | - AC_REQUIRE([AC_AIX]) | ||
| 24 | - AC_REQUIRE([AC_MINIX]) | ||
| 25 | - | ||
| 26 | - AH_VERBATIM([__EXTENSIONS__], | ||
| 27 | -[/* Enable extensions on Solaris. */ | ||
| 28 | -#ifndef __EXTENSIONS__ | ||
| 29 | -# undef __EXTENSIONS__ | ||
| 30 | -#endif | ||
| 31 | -#ifndef _POSIX_PTHREAD_SEMANTICS | ||
| 32 | -# undef _POSIX_PTHREAD_SEMANTICS | ||
| 33 | -#endif | ||
| 34 | -#ifndef _TANDEM_SOURCE | ||
| 35 | -# undef _TANDEM_SOURCE | ||
| 36 | -#endif]) | ||
| 37 | - AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], | ||
| 38 | - [ac_cv_safe_to_define___extensions__], | ||
| 39 | - [AC_COMPILE_IFELSE( | ||
| 40 | - [AC_LANG_PROGRAM([ | ||
| 41 | -# define __EXTENSIONS__ 1 | ||
| 42 | - AC_INCLUDES_DEFAULT])], | ||
| 43 | - [ac_cv_safe_to_define___extensions__=yes], | ||
| 44 | - [ac_cv_safe_to_define___extensions__=no])]) | ||
| 45 | - test $ac_cv_safe_to_define___extensions__ = yes && | ||
| 46 | - AC_DEFINE([__EXTENSIONS__]) | ||
| 47 | - AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) | ||
| 48 | - AC_DEFINE([_TANDEM_SOURCE]) | ||
| 49 | -]) | ||
| 50 | - | ||
| 51 | # gl_USE_SYSTEM_EXTENSIONS | ||
| 52 | # ------------------------ | ||
| 53 | # 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 @@ | |||
| 1 | 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" | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/gzip/" | ||
| 3 | SECTION = "console/utils" | ||
| 4 | # change to GPLv3+ in 2007/07. Previous GPLv2 version is 1.3.12 | ||
| 5 | LICENSE = "GPLv3+" | ||
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ | ||
| 7 | file://gzip.h;firstline=8;endline=20;md5=e2ec6b91fbe43a18f6081f3bbae46a01" | ||
| 8 | |||
| 9 | SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz" | ||
| 10 | |||
| 11 | inherit autotools | ||
| 12 | |||
| 13 | do_install () { | ||
| 14 | autotools_do_install | ||
| 15 | if [ "${PN}" = "${BPN}" ] ; then | ||
| 16 | # Rename and move files into /bin (FHS), which is typical place for gzip | ||
| 17 | install -d ${D}${base_bindir} | ||
| 18 | mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip.${PN} | ||
| 19 | mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip.${PN} | ||
| 20 | mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat.${PN} | ||
| 21 | fi | ||
| 22 | } | ||
| 23 | |||
| 24 | pkg_postinst_${PN} () { | ||
| 25 | if [ "${PN}" = "${BPN}" ] ; then | ||
| 26 | update-alternatives --install ${base_bindir}/gunzip gunzip gunzip.${PN} 100 | ||
| 27 | update-alternatives --install ${base_bindir}/gzip gzip gzip.${PN} 100 | ||
| 28 | update-alternatives --install ${base_bindir}/zcat zcat zcat.${PN} 100 | ||
| 29 | fi | ||
| 30 | } | ||
| 31 | |||
| 32 | pkg_prerm_${PN} () { | ||
| 33 | if [ "${PN}" = "${BPN}" ] ; then | ||
| 34 | update-alternatives --remove gunzip gunzip.${PN} | ||
| 35 | update-alternatives --remove gzip gzip.${PN} | ||
| 36 | update-alternatives --remove zcat zcat.${PN} | ||
| 37 | fi | ||
| 38 | } | ||
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 @@ | |||
| 1 | DESCRIPTION = "Standard GNU compressor" | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/gzip" | ||
| 3 | SECTION = "base" | ||
| 4 | |||
| 5 | LICENSE = "GPLv2+" | ||
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ | ||
| 7 | file://gzip.h;endline=22;md5=c0934ad1900d927f86556153d4c76d23 \ | ||
| 8 | file://lzw.h;endline=19;md5=c273e09a02edd9801cc74d39683049e9 " | ||
| 9 | |||
| 10 | SRC_URI = "${GNU_MIRROR}/gzip/gzip-${PV}.tar.gz \ | ||
| 11 | file://m4-extensions-fix.patch;patch=1 \ | ||
| 12 | file://dup-def-fix.patch;patch=1" | ||
| 13 | |||
| 14 | PR = "r0" | ||
| 15 | |||
| 16 | inherit autotools | ||
| 17 | |||
| 18 | do_install () { | ||
| 19 | autotools_do_install | ||
| 20 | # move files into /bin (FHS) | ||
| 21 | install -d ${D}${base_bindir} | ||
| 22 | mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip.${PN} | ||
| 23 | mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip.${PN} | ||
| 24 | mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat.${PN} | ||
| 25 | } | ||
| 26 | |||
| 27 | pkg_postinst_${PN} () { | ||
| 28 | update-alternatives --install ${base_bindir}/gunzip gunzip gunzip.${PN} 100 | ||
| 29 | update-alternatives --install ${base_bindir}/gzip gzip gzip.${PN} 100 | ||
| 30 | update-alternatives --install ${base_bindir}/zcat zcat zcat.${PN} 100 | ||
| 31 | } | ||
| 32 | |||
| 33 | pkg_prerm_${PN} () { | ||
| 34 | update-alternatives --remove gunzip gunzip.${PN} | ||
| 35 | update-alternatives --remove gzip gzip.${PN} | ||
| 36 | update-alternatives --remove zcat zcat.${PN} | ||
| 37 | } | ||
| 38 | |||
| 39 | 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 @@ | |||
| 1 | require gzip.inc | ||
| 2 | |||
| 3 | PR = "r0" | ||
| 4 | |||
| 5 | 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 @@ | |||
| 1 | |||
| 2 | # | ||
| 3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
| 4 | # | ||
| 5 | |||
| 6 | --- hdparm-5.8/hdparm.c~bswap | ||
| 7 | +++ hdparm-5.8/hdparm.c | ||
| 8 | @@ -20,7 +20,9 @@ | ||
| 9 | #include <linux/types.h> | ||
| 10 | #include <linux/hdreg.h> | ||
| 11 | #include <linux/major.h> | ||
| 12 | -#include <asm/byteorder.h> | ||
| 13 | +#include <byteswap.h> | ||
| 14 | + | ||
| 15 | +#define le16_to_cpus(x) bswap_16(htons(x)) | ||
| 16 | |||
| 17 | #include "hdparm.h" | ||
| 18 | |||
| 19 | @@ -1160,7 +1162,7 @@ | ||
| 20 | } | ||
| 21 | } else { | ||
| 22 | for(i = 0; i < 0x100; ++i) { | ||
| 23 | - __le16_to_cpus(&id[i]); | ||
| 24 | + le16_to_cpus(&id[i]); | ||
| 25 | } | ||
| 26 | identify((void *)id, NULL); | ||
| 27 | } | ||
| 28 | @@ -1380,7 +1382,7 @@ | ||
| 29 | } | ||
| 30 | for (i = 0; count >= 4; ++i) { | ||
| 31 | sbuf[i] = (fromhex(b[0]) << 12) | (fromhex(b[1]) << 8) | (fromhex(b[2]) << 4) | fromhex(b[3]); | ||
| 32 | - __le16_to_cpus((__u16 *)(&sbuf[i])); | ||
| 33 | + le16_to_cpus((__u16 *)(&sbuf[i])); | ||
| 34 | b += 5; | ||
| 35 | count -= 5; | ||
| 36 | } | ||
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 @@ | |||
| 1 | --- hdparm-5.8/hdparm.c.ark 2005-05-22 19:48:34.000000000 +0000 | ||
| 2 | +++ hdparm-5.8/hdparm.c 2005-05-22 19:52:18.000000000 +0000 | ||
| 3 | @@ -17,7 +17,9 @@ | ||
| 4 | #include <sys/times.h> | ||
| 5 | #include <sys/types.h> | ||
| 6 | #include <sys/mount.h> | ||
| 7 | +#ifndef __UCLIBC__ | ||
| 8 | #include <linux/types.h> | ||
| 9 | +#endif | ||
| 10 | #include <linux/hdreg.h> | ||
| 11 | #include <linux/major.h> | ||
| 12 | #include <byteswap.h> | ||
| 13 | --- hdparm-5.8/hdparm.h.ark 2005-05-22 19:51:49.000000000 +0000 | ||
| 14 | +++ hdparm-5.8/hdparm.h 2005-05-22 19:54:54.000000000 +0000 | ||
| 15 | @@ -1,6 +1,6 @@ | ||
| 16 | /* Some prototypes for extern functions. */ | ||
| 17 | |||
| 18 | -#include <linux/types.h> /* for __u16 */ | ||
| 19 | +#include <stdint.h> | ||
| 20 | |||
| 21 | #if !defined(__GNUC__) && !defined(__attribute__) | ||
| 22 | #define __attribute__(x) /* if not using GCC, turn off the __attribute__ | ||
| 23 | @@ -11,7 +11,7 @@ | ||
| 24 | others, though, were declared in hdparm.c with global scope; since other | ||
| 25 | functions in that file have static (file) scope, I assume the difference is | ||
| 26 | intentional. */ | ||
| 27 | -extern void identify (__u16 *id_supplied, const char *devname); | ||
| 28 | +extern void identify (uint16_t *id_supplied, const char *devname); | ||
| 29 | |||
| 30 | extern void usage_error(int out) __attribute__((noreturn)); | ||
| 31 | extern int main(int argc, char **argv) __attribute__((noreturn)); | ||
| 32 | |||
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 @@ | |||
| 1 | DESCRIPTION = "hdparm is a Linux shell utility for viewing \ | ||
| 2 | and manipulating various IDE drive and driver parameters." | ||
| 3 | SECTION = "console/utils" | ||
| 4 | PRIORITY = "optional" | ||
| 5 | LICENSE = "BSD" | ||
| 6 | |||
| 7 | SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/hdparm-${PV}.tar.gz \ | ||
| 8 | file://bswap.patch;patch=1 \ | ||
| 9 | file://uclibc.patch;patch=1" | ||
| 10 | |||
| 11 | do_install () { | ||
| 12 | install -d ${D}/${sbindir} ${D}/${mandir}/man8 | ||
| 13 | oe_runmake 'DESTDIR=${D}' install | ||
| 14 | } | ||
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 @@ | |||
| 1 | DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group." | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/libidn/" | ||
| 3 | SECTION = "libs" | ||
| 4 | LICENSE = "LGPLv2.1+ & GPLv2+" | ||
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \ | ||
| 6 | file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \ | ||
| 7 | file://lib/idna.h;firstline=6;endline=18;md5=6d9d5532eb28b99e860262281c540d02 \ | ||
| 8 | file://src/idn.c;firstline=6;endline=18;md5=41b6aec531cc6a9d54a6c4deee251bf5" | ||
| 9 | PR = "r0" | ||
| 10 | |||
| 11 | inherit pkgconfig autotools gettext | ||
| 12 | |||
| 13 | SRC_URI = "http://alpha.gnu.org/gnu/libidn/${P}.tar.gz" | ||
| 14 | |||
| 15 | EXTRA_OECONF = " --disable-tld" | ||
| 16 | |||
| 17 | do_configure_prepend() { | ||
| 18 | # this version of libidn copies AC_USE_SYSTEM_EXTENSIONS from | ||
| 19 | # autoconf CVS because atm the autoconf it uses is a bit old | ||
| 20 | # now with cross autotool, that macro is already there and this | ||
| 21 | # local definition causes circular dependency. Actually AC_GNU_SOURCE | ||
| 22 | # is identical to AC_USE_SYSTEM_EXTENSIONS. So remove all local | ||
| 23 | # references to the latter here. | ||
| 24 | sed -i -e "/AC_REQUIRE(\[gl_USE_SYSTEM_EXTENSIONS/d" ${S}/lib/gl/m4/gnulib-comp.m4 | ||
| 25 | rm -f ${S}/lib/gl/m4/extensions.m4 | ||
| 26 | } | ||
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 @@ | |||
| 1 | DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group." | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/libidn/" | ||
| 3 | SECTION = "libs" | ||
| 4 | LICENSE = "LGPLv2.1+ & GPLv3+" | ||
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ | ||
| 6 | file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \ | ||
| 7 | file://lib/idna.h;firstline=6;endline=18;md5=643beb30bf98d8c4aed59a51b86fe9ea \ | ||
| 8 | file://src/idn.c;firstline=6;endline=18;md5=07a57d46977b38a2557aac446dda35dd" | ||
| 9 | PR = "r0" | ||
| 10 | |||
| 11 | inherit pkgconfig autotools gettext | ||
| 12 | |||
| 13 | SRC_URI = "http://ftp.gnu.org/gnu/libidn/${P}.tar.gz" | ||
| 14 | |||
| 15 | # command tool is under GPLv3+, while libidn itself is under LGPLv2.1+ | ||
| 16 | # so package command into a separate package | ||
| 17 | PACKAGES =+ "idn" | ||
| 18 | FILES_idn = "${bindir}/*" | ||
| 19 | |||
| 20 | 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 @@ | |||
| 1 | DESCRIPTION = "Lsof is a Unix-specific diagnostic tool. \ | ||
| 2 | Its name stands for LiSt Open Files, and it does just that." | ||
| 3 | SECTION = "devel" | ||
| 4 | LICENSE = "BSD" | ||
| 5 | |||
| 6 | PR = "r0" | ||
| 7 | |||
| 8 | SRC_URI = "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2" | ||
| 9 | LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar" | ||
| 10 | S = "${WORKDIR}/lsof_${PV}_src" | ||
| 11 | |||
| 12 | python do_unpack () { | ||
| 13 | bb.build.exec_func('base_do_unpack', d) | ||
| 14 | src_uri = bb.data.getVar('SRC_URI', d) | ||
| 15 | bb.data.setVar('SRC_URI', '${LOCALSRC}', d) | ||
| 16 | bb.build.exec_func('base_do_unpack', d) | ||
| 17 | bb.data.setVar('SRC_URI', src_uri, d) | ||
| 18 | } | ||
| 19 | |||
| 20 | export LSOF_OS = "${TARGET_OS}" | ||
| 21 | LSOF_OS_linux-uclibc = "linux" | ||
| 22 | LSOF_OS_linux-gnueabi = "linux" | ||
| 23 | export LSOF_INCLUDE = "${STAGING_INCDIR}" | ||
| 24 | |||
| 25 | do_configure () { | ||
| 26 | yes | ./Configure ${LSOF_OS} | ||
| 27 | } | ||
| 28 | |||
| 29 | export I = "${STAGING_INCDIR}" | ||
| 30 | export L = "${STAGING_INCDIR}" | ||
| 31 | export EXTRA_OEMAKE = "" | ||
| 32 | |||
| 33 | do_compile () { | ||
| 34 | oe_runmake 'CC=${CC}' 'CFGL=${LDFLAGS} -L./lib -llsof' 'DEBUG=' 'INCL=${CFLAGS}' | ||
| 35 | } | ||
| 36 | |||
| 37 | do_install () { | ||
| 38 | install -d ${D}${sbindir} ${D}${mandir}/man8 | ||
| 39 | install -m 4755 lsof ${D}${sbindir}/lsof | ||
| 40 | install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8 | ||
| 41 | } | ||
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 @@ | |||
| 1 | padout should be compiled using the native compiler but isn't. | ||
| 2 | Disable this piece of documentation for now. | ||
| 3 | |||
| 4 | RP | ||
| 5 | |||
| 6 | Index: Linux-PAM-1.0.2/doc/specs/Makefile.am | ||
| 7 | =================================================================== | ||
| 8 | --- Linux-PAM-1.0.2.orig/doc/specs/Makefile.am 2008-11-04 21:06:23.000000000 +0000 | ||
| 9 | +++ Linux-PAM-1.0.2/doc/specs/Makefile.am 2008-11-04 21:07:06.000000000 +0000 | ||
| 10 | @@ -2,21 +2,8 @@ | ||
| 11 | # Copyright (c) 2005, 2006 Thorsten Kukuk <kukuk@suse.de> | ||
| 12 | # | ||
| 13 | |||
| 14 | -CLEANFILES = draft-morgan-pam-current.txt *~ | ||
| 15 | +CLEANFILES = *~ | ||
| 16 | |||
| 17 | -EXTRA_DIST = draft-morgan-pam.raw std-agent-id.raw rfc86.0.txt | ||
| 18 | +EXTRA_DIST = std-agent-id.raw rfc86.0.txt | ||
| 19 | |||
| 20 | -draft-morgan-pam-current.txt: padout draft-morgan-pam.raw | ||
| 21 | - ./padout < $(srcdir)/draft-morgan-pam.raw > draft-morgan-pam-current.txt | ||
| 22 | - | ||
| 23 | -AM_YFLAGS = -d | ||
| 24 | - | ||
| 25 | -BUILT_SOURCES = parse_y.h | ||
| 26 | - | ||
| 27 | -noinst_PROGRAMS = padout | ||
| 28 | - | ||
| 29 | -padout_SOURCES = parse_l.l parse_y.y | ||
| 30 | - | ||
| 31 | -padout_LDADD = @LEXLIB@ | ||
| 32 | - | ||
| 33 | -doc_DATA = draft-morgan-pam-current.txt rfc86.0.txt | ||
| 34 | +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 @@ | |||
| 1 | # | ||
| 2 | # /etc/pam.d/common-account - authorization settings common to all services | ||
| 3 | # | ||
| 4 | # This file is included from other service-specific PAM config files, | ||
| 5 | # and should contain a list of the authorization modules that define | ||
| 6 | # the central access policy for use on the system. The default is to | ||
| 7 | # only deny service to users whose accounts are expired in /etc/shadow. | ||
| 8 | # | ||
| 9 | # As of pam 1.0.1-6, this file is managed by pam-auth-update by default. | ||
| 10 | # To take advantage of this, it is recommended that you configure any | ||
| 11 | # local modules either before or after the default block, and use | ||
| 12 | # pam-auth-update to manage selection of other modules. See | ||
| 13 | # pam-auth-update(8) for details. | ||
| 14 | # | ||
| 15 | |||
| 16 | # here are the per-package modules (the "Primary" block) | ||
| 17 | account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so | ||
| 18 | # here's the fallback if no module succeeds | ||
| 19 | account requisite pam_deny.so | ||
| 20 | # prime the stack with a positive return value if there isn't one already; | ||
| 21 | # this avoids us returning an error just because nothing sets a success code | ||
| 22 | # since the modules above will each just jump around | ||
| 23 | account required pam_permit.so | ||
| 24 | # and here are more per-package modules (the "Additional" block) | ||
| 25 | # 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 @@ | |||
| 1 | # | ||
| 2 | # /etc/pam.d/common-auth - authentication settings common to all services | ||
| 3 | # | ||
| 4 | # This file is included from other service-specific PAM config files, | ||
| 5 | # and should contain a list of the authentication modules that define | ||
| 6 | # the central authentication scheme for use on the system | ||
| 7 | # (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the | ||
| 8 | # traditional Unix authentication mechanisms. | ||
| 9 | |||
| 10 | # here are the per-package modules (the "Primary" block) | ||
| 11 | auth [success=1 default=ignore] pam_unix.so nullok_secure | ||
| 12 | # here's the fallback if no module succeeds | ||
| 13 | auth requisite pam_deny.so | ||
| 14 | # prime the stack with a positive return value if there isn't one already; | ||
| 15 | # this avoids us returning an error just because nothing sets a success code | ||
| 16 | # since the modules above will each just jump around | ||
| 17 | auth required pam_permit.so | ||
| 18 | # 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 @@ | |||
| 1 | # | ||
| 2 | # /etc/pam.d/common-password - password-related modules common to all services | ||
| 3 | # | ||
| 4 | # This file is included from other service-specific PAM config files, | ||
| 5 | # and should contain a list of modules that define the services to be | ||
| 6 | # used to change user passwords. The default is pam_unix. | ||
| 7 | |||
| 8 | # Explanation of pam_unix options: | ||
| 9 | # | ||
| 10 | # The "sha512" option enables salted SHA512 passwords. Without this option, | ||
| 11 | # the default is Unix crypt. Prior releases used the option "md5". | ||
| 12 | # | ||
| 13 | # The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in | ||
| 14 | # login.defs. | ||
| 15 | # | ||
| 16 | # See the pam_unix manpage for other options. | ||
| 17 | |||
| 18 | # here are the per-package modules (the "Primary" block) | ||
| 19 | password [success=1 default=ignore] pam_unix.so obscure sha512 | ||
| 20 | # here's the fallback if no module succeeds | ||
| 21 | password requisite pam_deny.so | ||
| 22 | # prime the stack with a positive return value if there isn't one already; | ||
| 23 | # this avoids us returning an error just because nothing sets a success code | ||
| 24 | # since the modules above will each just jump around | ||
| 25 | password required pam_permit.so | ||
| 26 | # 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 @@ | |||
| 1 | # | ||
| 2 | # /etc/pam.d/common-session - session-related modules common to all services | ||
| 3 | # | ||
| 4 | # This file is included from other service-specific PAM config files, | ||
| 5 | # and should contain a list of modules that define tasks to be performed | ||
| 6 | # at the start and end of sessions of *any* kind (both interactive and | ||
| 7 | # non-interactive). | ||
| 8 | # | ||
| 9 | |||
| 10 | # here are the per-package modules (the "Primary" block) | ||
| 11 | session [default=1] pam_permit.so | ||
| 12 | # here's the fallback if no module succeeds | ||
| 13 | session requisite pam_deny.so | ||
| 14 | # prime the stack with a positive return value if there isn't one already; | ||
| 15 | # this avoids us returning an error just because nothing sets a success code | ||
| 16 | # since the modules above will each just jump around | ||
| 17 | session required pam_permit.so | ||
| 18 | # and here are more per-package modules (the "Additional" block) | ||
| 19 | 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 @@ | |||
| 1 | # | ||
| 2 | # /etc/pam.d/common-session-noninteractive - session-related modules | ||
| 3 | # common to all non-interactive services | ||
| 4 | # | ||
| 5 | # This file is included from other service-specific PAM config files, | ||
| 6 | # and should contain a list of modules that define tasks to be performed | ||
| 7 | # at the start and end of all non-interactive sessions. | ||
| 8 | # | ||
| 9 | |||
| 10 | # here are the per-package modules (the "Primary" block) | ||
| 11 | session [default=1] pam_permit.so | ||
| 12 | # here's the fallback if no module succeeds | ||
| 13 | session requisite pam_deny.so | ||
| 14 | # prime the stack with a positive return value if there isn't one already; | ||
| 15 | # this avoids us returning an error just because nothing sets a success code | ||
| 16 | # since the modules above will each just jump around | ||
| 17 | session required pam_permit.so | ||
| 18 | # and here are more per-package modules (the "Additional" block) | ||
| 19 | 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 @@ | |||
| 1 | # | ||
| 2 | # /etc/pam.d/other - specify the PAM fallback behaviour | ||
| 3 | # | ||
| 4 | # Note that this file is used for any unspecified service; for example | ||
| 5 | #if /etc/pam.d/cron specifies no session modules but cron calls | ||
| 6 | #pam_open_session, the session module out of /etc/pam.d/other is | ||
| 7 | #used. | ||
| 8 | |||
| 9 | #If you really want nothing to happen then use pam_permit.so or | ||
| 10 | #pam_deny.so as appropriate. | ||
| 11 | |||
| 12 | # We use pam_warn.so to generate syslog notes that the 'other' | ||
| 13 | #fallback rules are being used (as a hint to suggest you should setup | ||
| 14 | #specific PAM rules for the service and aid to debugging). We then | ||
| 15 | #fall back to the system default in /etc/pam.d/common-* | ||
| 16 | |||
| 17 | auth required pam_warn.so | ||
| 18 | auth include common-auth | ||
| 19 | |||
| 20 | account required pam_warn.so | ||
| 21 | account include common-account | ||
| 22 | |||
| 23 | password required pam_warn.so | ||
| 24 | password include common-password | ||
| 25 | |||
| 26 | session required pam_warn.so | ||
| 27 | 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 @@ | |||
| 1 | DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), Basically, it is a flexible mechanism for authenticating users" | ||
| 2 | HOMEPAGE = "http://www.kernel.org/pub/linux/libs/pam/" | ||
| 3 | BUGTRACKER = "http://sourceforge.net/projects/pam/support" | ||
| 4 | # PAM allows dual licensed under GPL and BSD. | ||
| 5 | # /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time | ||
| 6 | # libpam-runtime-1.0.1 is GPLv2+), by openembedded | ||
| 7 | LICENSE = "GPLv2+ | BSD" | ||
| 8 | PR = "r1" | ||
| 9 | |||
| 10 | DEPENDS = "bison flex" | ||
| 11 | RDEPENDS_${PN}-runtime = "libpam pam-plugin-deny pam-plugin-permit pam-plugin-warn pam-plugin-unix" | ||
| 12 | RRECOMMENDS_${PN} = "libpam-runtime" | ||
| 13 | |||
| 14 | SRC_URI = "http://www.kernel.org/pub/linux/libs/pam/library/Linux-PAM-${PV}.tar.bz2 \ | ||
| 15 | file://disable_crossbinary.patch \ | ||
| 16 | file://99_pam \ | ||
| 17 | file://pam.d/*" | ||
| 18 | |||
| 19 | EXTRA_OECONF = "--with-db-uniquename=_pam \ | ||
| 20 | --includedir=${includedir}/security \ | ||
| 21 | --libdir=${base_libdir} \ | ||
| 22 | --disable-regenerate-docu" | ||
| 23 | CFLAGS_append = " -fPIC " | ||
| 24 | |||
| 25 | S = "${WORKDIR}/Linux-PAM-${PV}" | ||
| 26 | |||
| 27 | inherit autotools gettext | ||
| 28 | |||
| 29 | PACKAGES += "${PN}-runtime" | ||
| 30 | FILES_${PN} = "${base_libdir}/lib*${SOLIBS}" | ||
| 31 | FILES_${PN}-dbg += "${base_libdir}/security/.debug \ | ||
| 32 | ${base_libdir}/security/pam_filter/.debug" | ||
| 33 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}" | ||
| 34 | FILES_${PN}-runtime = "${sysconfdir}" | ||
| 35 | |||
| 36 | PACKAGES_DYNAMIC += " pam-plugin-*" | ||
| 37 | |||
| 38 | python populate_packages_prepend () { | ||
| 39 | import os.path | ||
| 40 | |||
| 41 | def pam_plugin_append_file(pn, dir, file): | ||
| 42 | nf = os.path.join(dir, file) | ||
| 43 | of = bb.data.getVar('FILES_' + pn, d, True) | ||
| 44 | if of: | ||
| 45 | nf = of + " " + nf | ||
| 46 | bb.data.setVar('FILES_' + pn, nf, d) | ||
| 47 | |||
| 48 | dvar = bb.data.expand('${WORKDIR}/package', d, True) | ||
| 49 | pam_libdir = bb.data.expand('${base_libdir}/security', d) | ||
| 50 | pam_sbindir = bb.data.expand('${sbindir}', d) | ||
| 51 | pam_filterdir = bb.data.expand('${base_libdir}/security/pam_filter', d) | ||
| 52 | |||
| 53 | do_split_packages(d, pam_libdir, '^pam(.*)\.so$', 'pam-plugin%s', 'PAM plugin for %s', extra_depends='') | ||
| 54 | pam_plugin_append_file('pam-plugin-unix', pam_sbindir, 'unix_chkpwd') | ||
| 55 | pam_plugin_append_file('pam-plugin-unix', pam_sbindir, 'unix_update') | ||
| 56 | pam_plugin_append_file('pam-plugin-tally', pam_sbindir, 'pam_tally') | ||
| 57 | pam_plugin_append_file('pam-plugin-tally2', pam_sbindir, 'pam_tally2') | ||
| 58 | pam_plugin_append_file('pam-plugin-timestamp', pam_sbindir, 'pam_timestamp_check') | ||
| 59 | pam_plugin_append_file('pam-plugin-mkhomedir', pam_sbindir, 'mkhomedir_helper') | ||
| 60 | do_split_packages(d, pam_filterdir, '^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') | ||
| 61 | } | ||
| 62 | |||
| 63 | do_install() { | ||
| 64 | autotools_do_install | ||
| 65 | |||
| 66 | # don't install /var/run when populating rootfs. Do it through volatile | ||
| 67 | rm -rf ${D}/var | ||
| 68 | install -d ${D}${sysconfdir}/default/volatiles | ||
| 69 | install -m 0644 ${WORKDIR}/99_pam ${D}/etc/default/volatiles | ||
| 70 | |||
| 71 | install -d ${D}${sysconfdir}/pam.d/ | ||
| 72 | install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ | ||
| 73 | } | ||
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 @@ | |||
| 1 | If check is detected, it makes the builds non-determinstic so just force | ||
| 2 | it to be disabled. | ||
| 3 | |||
| 4 | RP - 4/11/08 | ||
| 5 | |||
| 6 | Index: parted-1.9.0/configure.ac | ||
| 7 | =================================================================== | ||
| 8 | --- parted-1.9.0.orig/configure.ac 2009-07-23 18:52:08.000000000 +0100 | ||
| 9 | +++ parted-1.9.0/configure.ac 2010-02-02 14:13:56.013905093 +0000 | ||
| 10 | @@ -477,7 +477,7 @@ | ||
| 11 | AM_CONDITIONAL([BUILD_LINUX], [test "$OS" = linux]) | ||
| 12 | |||
| 13 | dnl check for "check", unit testing library/header | ||
| 14 | -PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no) | ||
| 15 | +have_check=no | ||
| 16 | if test "$have_check" != "yes"; then | ||
| 17 | AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building]) | ||
| 18 | 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 @@ | |||
| 1 | --- | ||
| 2 | libparted/arch/linux.c | 13 +++++++++++++ | ||
| 3 | 1 file changed, 13 insertions(+) | ||
| 4 | |||
| 5 | Index: parted-1.9.0/libparted/arch/linux.c | ||
| 6 | =================================================================== | ||
| 7 | --- parted-1.9.0.orig/libparted/arch/linux.c 2009-07-23 18:52:08.000000000 +0100 | ||
| 8 | +++ parted-1.9.0/libparted/arch/linux.c 2010-02-02 14:14:16.523904768 +0000 | ||
| 9 | @@ -17,6 +17,8 @@ | ||
| 10 | |||
| 11 | #define PROC_DEVICES_BUFSIZ 16384 | ||
| 12 | |||
| 13 | +#include <linux/version.h> | ||
| 14 | + | ||
| 15 | #include <config.h> | ||
| 16 | #include <arch/linux.h> | ||
| 17 | |||
| 18 | @@ -1477,12 +1479,14 @@ | ||
| 19 | |||
| 20 | #if SIZEOF_OFF_T < 8 | ||
| 21 | |||
| 22 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) | ||
| 23 | static _syscall5(int,_llseek, | ||
| 24 | unsigned int, fd, | ||
| 25 | unsigned long, offset_high, | ||
| 26 | unsigned long, offset_low, | ||
| 27 | loff_t*, result, | ||
| 28 | unsigned int, origin) | ||
| 29 | +#endif | ||
| 30 | |||
| 31 | loff_t | ||
| 32 | llseek (unsigned int fd, loff_t offset, unsigned int whence) | ||
| 33 | @@ -1490,11 +1494,20 @@ | ||
| 34 | loff_t result; | ||
| 35 | int retval; | ||
| 36 | |||
| 37 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) | ||
| 38 | retval = _llseek(fd, | ||
| 39 | ((unsigned long long)offset) >> 32, | ||
| 40 | ((unsigned long long)offset) & 0xffffffff, | ||
| 41 | &result, | ||
| 42 | whence); | ||
| 43 | +#else | ||
| 44 | + retval = syscall(__NR__llseek, fd, | ||
| 45 | + ((unsigned long long)offset) >> 32, | ||
| 46 | + ((unsigned long long)offset) & 0xffffffff, | ||
| 47 | + &result, | ||
| 48 | + whence); | ||
| 49 | +#endif | ||
| 50 | + | ||
| 51 | return (retval==-1 ? (loff_t) retval : result); | ||
| 52 | } | ||
| 53 | |||
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 @@ | |||
| 1 | DESCRIPTION = "parted, the GNU partition resizing program" | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/parted/parted.html" | ||
| 3 | LICENSE = "GPLv2" | ||
| 4 | SECTION = "console/tools" | ||
| 5 | DEPENDS = "readline e2fsprogs" | ||
| 6 | PR = "r3" | ||
| 7 | |||
| 8 | SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.gz \ | ||
| 9 | file://no_check.patch;patch=1 \ | ||
| 10 | file://syscalls.patch;patch=1 " | ||
| 11 | |||
| 12 | EXTRA_OECONF = "--disable-Werror --disable-device-mapper" | ||
| 13 | |||
| 14 | inherit autotools pkgconfig gettext | ||
| 15 | |||
| 16 | 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 @@ | |||
| 1 | HOMEPAGE = "http://www.packagekit.org/" | ||
| 2 | DEPENDS = "polkit dbus-glib gconf gtk+" | ||
| 3 | |||
| 4 | SRC_URI = "http://hal.freedesktop.org/releases/polkit-gnome-${PV}.tar.bz2 \ | ||
| 5 | " | ||
| 6 | |||
| 7 | EXTRA_OECONF = " --disable-scrollkeeper \ | ||
| 8 | --disable-man-pages \ | ||
| 9 | --disable-examples \ | ||
| 10 | --disable-gtk-doc \ | ||
| 11 | --disable-introspection " | ||
| 12 | |||
| 13 | inherit autotools pkgconfig | ||
| 14 | |||
| 15 | FILES_${PN} += " ${datadir}/dbus-1 \ | ||
| 16 | ${datadir}/PolicyKit \ | ||
| 17 | " | ||
| 18 | |||
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 @@ | |||
| 1 | DESCRIPTION = "The polkit package is an application-level toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes." | ||
| 2 | HOMEPAGE = "http://code.google.com/p/polkit/" | ||
| 3 | LICENSE = "LGPLv2+" | ||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=155db86cdbafa7532b41f390409283eb \ | ||
| 5 | file://src/polkit/polkit.h;md5=8aa8924570fc5570d20e4a4ad5d2db51 \ | ||
| 6 | file://docs/polkit/html/license.html;md5=4c17ef1587e0f096c82157160d4e340e" | ||
| 7 | |||
| 8 | SRC_URI = "http://hal.freedesktop.org/releases/polkit-${PV}.tar.gz" | ||
| 9 | PR = "r2" | ||
| 10 | DEPENDS = "libpam expat dbus-glib eggdbus intltool" | ||
| 11 | RDEPENDS = "libpam" | ||
| 12 | EXTRA_OECONF = "--with-authfw=pam --with-os-type=moblin --disable-man-pages --disable-gtk-doc --disable-introspection" | ||
| 13 | |||
| 14 | 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 @@ | |||
| 1 | uClibc needs to link against an external libintl but it doesn't do this by | ||
| 2 | default. The configure script correctly figures out if this is needed, but | ||
| 3 | doesn't actually link to the libraries it decides on. This makes it link to | ||
| 4 | them if they are needed: | ||
| 5 | |||
| 6 | --- psmisc-22.2/src/Makefile.am 2006/06/28 00:14:07 1.1 | ||
| 7 | +++ psmisc-22.2/src/Makefile.am 2006/06/28 00:14:24 | ||
| 8 | @@ -5,15 +5,19 @@ | ||
| 9 | |||
| 10 | oldfuser_SOURCES = oldfuser.c comm.h signals.c signals.h loop.h i18n.h | ||
| 11 | |||
| 12 | +oldfuser_LDADD = @INTLLIBS@ | ||
| 13 | + | ||
| 14 | fuser_SOURCES = fuser.c comm.h signals.c signals.h i18n.h fuser.h | ||
| 15 | |||
| 16 | +fuser_LDADD = @INTLLIBS@ | ||
| 17 | + | ||
| 18 | killall_SOURCES = killall.c comm.h signals.c signals.h i18n.h | ||
| 19 | |||
| 20 | -killall_LDADD = @SELINUX_LIB@ | ||
| 21 | +killall_LDADD = @SELINUX_LIB@ @INTLLIBS@ | ||
| 22 | |||
| 23 | pstree_SOURCES = pstree.c comm.h i18n.h | ||
| 24 | |||
| 25 | -pstree_LDADD = @TERMCAP_LIB@ @SELINUX_LIB@ | ||
| 26 | +pstree_LDADD = @TERMCAP_LIB@ @SELINUX_LIB@ @INTLLIBS@ | ||
| 27 | |||
| 28 | BUILT_SOURCES = signames.h | ||
| 29 | |||
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 @@ | |||
| 1 | LICENSE = "GPL" | ||
| 2 | DESCRIPTION = "procfs tools" | ||
| 3 | SECTION = "base" | ||
| 4 | PRIORITY = "required" | ||
| 5 | DEPENDS = "ncurses virtual/libintl" | ||
| 6 | |||
| 7 | SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz \ | ||
| 8 | file://libintl-link.patch;patch=1" | ||
| 9 | S = "${WORKDIR}/psmisc-${PV}" | ||
| 10 | |||
| 11 | inherit autotools gettext | ||
| 12 | |||
| 13 | ALLOW_EMPTY = "1" | ||
| 14 | |||
| 15 | PACKAGES = "${PN} \ | ||
| 16 | fuser-dbg fuser fuser-doc \ | ||
| 17 | killall-dbg killall killall-doc \ | ||
| 18 | pstree-dbg pstree pstree-doc" | ||
| 19 | |||
| 20 | FILES_${PN} = "" | ||
| 21 | RDEPENDS_${PN} = "fuser killall pstree" | ||
| 22 | |||
| 23 | FILES_fuser = "${bindir}/fuser.${PN}" | ||
| 24 | FILES_fuser-doc = "${mandir}/man1/fuser*" | ||
| 25 | FILES_fuser-dbg = "${bindir}/.debug/fuser" | ||
| 26 | |||
| 27 | FILES_killall = "${bindir}/killall.${PN}" | ||
| 28 | FILES_killall-doc = "${mandir}/man1/killall*" | ||
| 29 | FILES_killall-dbg = "${bindir}/.debug/killall*" | ||
| 30 | |||
| 31 | FILES_pstree = "${bindir}/pstree" | ||
| 32 | FILES_pstree-doc = "${mandir}/man1/pstree*" | ||
| 33 | FILES_pstree-dbg = "${bindir}/.debug/pstree" | ||
| 34 | |||
| 35 | do_install_append() { | ||
| 36 | mv ${D}${bindir}/killall ${D}${bindir}/killall.${PN} | ||
| 37 | mv ${D}${bindir}/fuser ${D}${bindir}/fuser.${PN} | ||
| 38 | } | ||
| 39 | |||
| 40 | pkg_postinst_killall() { | ||
| 41 | update-alternatives --install ${bindir}/killall killall killall.${PN} 90 | ||
| 42 | } | ||
| 43 | |||
| 44 | pkg_postrm_killall() { | ||
| 45 | update-alternatives --remove ${bindir}/killall killall.${PN} | ||
| 46 | } | ||
| 47 | |||
| 48 | pkg_postinst_fuser() { | ||
| 49 | update-alternatives --install ${bindir}/fuser fuser fuser.${PN} 90 | ||
| 50 | } | ||
| 51 | |||
| 52 | pkg_postrm_fuser() { | ||
| 53 | update-alternatives --remove ${bindir}/fuser fuser.${PN} | ||
| 54 | } | ||
| 55 | |||
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 @@ | |||
| 1 | require psmisc.inc | ||
| 2 | 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 @@ | |||
| 1 | Change the getline return type to match its declaration. | ||
| 2 | |||
| 3 | Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> | ||
| 4 | |||
| 5 | diff -urN sed-4.1.2-orig/lib/getline.c sed-4.1.2/lib/getline.c | ||
| 6 | --- sed-4.1.2-orig/lib/getline.c 2010-08-31 08:47:50.070094024 +0800 | ||
| 7 | +++ sed-4.1.2/lib/getline.c 2010-08-31 08:48:50.982178172 +0800 | ||
| 8 | @@ -30,7 +30,7 @@ | ||
| 9 | necessary. Returns the number of characters read (not including the | ||
| 10 | null terminator), or -1 on error or EOF. */ | ||
| 11 | |||
| 12 | -size_t | ||
| 13 | +ssize_t | ||
| 14 | getline (lineptr, n, stream) | ||
| 15 | char **lineptr; | ||
| 16 | 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 @@ | |||
| 1 | DESCRIPTION = "sed is a Stream EDitor." | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/sed/" | ||
| 3 | LICENSE = "GPLv2+" | ||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ | ||
| 5 | file://sed/sed.h;beginline=1;endline=17;md5=e00ffd1837f298439a214fd197f6a407" | ||
| 6 | SECTION = "console/utils" | ||
| 7 | PR = "r3" | ||
| 8 | |||
| 9 | DEPENDS = "gettext" | ||
| 10 | |||
| 11 | SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \ | ||
| 12 | file://fix_return_type.patch" | ||
| 13 | |||
| 14 | inherit autotools | ||
| 15 | |||
| 16 | do_install () { | ||
| 17 | autotools_do_install | ||
| 18 | install -d ${D}${base_bindir} | ||
| 19 | mv ${D}${bindir}/sed ${D}${base_bindir}/sed.${PN} | ||
| 20 | } | ||
| 21 | |||
| 22 | |||
| 23 | pkg_postinst_${PN} () { | ||
| 24 | update-alternatives --install ${base_bindir}/sed sed sed.${PN} 100 | ||
| 25 | } | ||
| 26 | |||
| 27 | |||
| 28 | pkg_prerm_${PN} () { | ||
| 29 | update-alternatives --remove sed sed.${PN} | ||
| 30 | } | ||
| 31 | |||
| 32 | 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 @@ | |||
| 1 | # fix underquotes, rebased to 1.7.2p7 | ||
| 2 | # | ||
| 3 | # by Kevin Tian <kevin.tian@intel.com>, 06/23/2010 | ||
| 4 | Index: sudo-1.7.2p7/aclocal.m4 | ||
| 5 | =================================================================== | ||
| 6 | --- sudo-1.7.2p7.orig/aclocal.m4 2010-06-23 13:33:57.000000000 +0800 | ||
| 7 | +++ sudo-1.7.2p7/aclocal.m4 2010-06-23 13:36:41.000000000 +0800 | ||
| 8 | @@ -10,7 +10,7 @@ | ||
| 9 | dnl | ||
| 10 | dnl check for sendmail | ||
| 11 | dnl | ||
| 12 | -AC_DEFUN(SUDO_PROG_SENDMAIL, [AC_MSG_CHECKING(for sendmail) | ||
| 13 | +AC_DEFUN([SUDO_PROG_SENDMAIL], [AC_MSG_CHECKING(for sendmail) | ||
| 14 | if test -f "/usr/sbin/sendmail"; then | ||
| 15 | AC_MSG_RESULT(/usr/sbin/sendmail) | ||
| 16 | SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/sbin/sendmail") | ||
| 17 | @@ -37,7 +37,7 @@ | ||
| 18 | dnl | ||
| 19 | dnl check for vi | ||
| 20 | dnl | ||
| 21 | -AC_DEFUN(SUDO_PROG_VI, [AC_MSG_CHECKING(for vi) | ||
| 22 | +AC_DEFUN([SUDO_PROG_VI], [AC_MSG_CHECKING(for vi) | ||
| 23 | if test -f "/usr/bin/vi"; then | ||
| 24 | AC_MSG_RESULT(/usr/bin/vi) | ||
| 25 | SUDO_DEFINE(_PATH_VI, "/usr/bin/vi") | ||
| 26 | @@ -61,7 +61,7 @@ | ||
| 27 | dnl | ||
| 28 | dnl check for mv | ||
| 29 | dnl | ||
| 30 | -AC_DEFUN(SUDO_PROG_MV, [AC_MSG_CHECKING(for mv) | ||
| 31 | +AC_DEFUN([SUDO_PROG_MV], [AC_MSG_CHECKING(for mv) | ||
| 32 | if test -f "/usr/bin/mv"; then | ||
| 33 | AC_MSG_RESULT(/usr/bin/mv) | ||
| 34 | SUDO_DEFINE(_PATH_MV, "/usr/bin/mv") | ||
| 35 | @@ -82,7 +82,7 @@ | ||
| 36 | dnl | ||
| 37 | dnl check for bourne shell | ||
| 38 | dnl | ||
| 39 | -AC_DEFUN(SUDO_PROG_BSHELL, [AC_MSG_CHECKING(for bourne shell) | ||
| 40 | +AC_DEFUN([SUDO_PROG_BSHELL], [AC_MSG_CHECKING(for bourne shell) | ||
| 41 | if test -f "/bin/sh"; then | ||
| 42 | AC_MSG_RESULT(/bin/sh) | ||
| 43 | SUDO_DEFINE(_PATH_BSHELL, "/bin/sh") | ||
| 44 | @@ -115,7 +115,7 @@ | ||
| 45 | dnl | ||
| 46 | dnl Where the log file goes, use /var/log if it exists, else /{var,usr}/adm | ||
| 47 | dnl | ||
| 48 | -AC_DEFUN(SUDO_LOGFILE, [AC_MSG_CHECKING(for log file location) | ||
| 49 | +AC_DEFUN([SUDO_LOGFILE], [AC_MSG_CHECKING(for log file location) | ||
| 50 | if test -n "$with_logpath"; then | ||
| 51 | AC_MSG_RESULT($with_logpath) | ||
| 52 | SUDO_DEFINE_UNQUOTED(_PATH_SUDO_LOGFILE, "$with_logpath") | ||
| 53 | @@ -136,7 +136,7 @@ | ||
| 54 | dnl | ||
| 55 | dnl Where the log file goes, use /var/log if it exists, else /{var,usr}/adm | ||
| 56 | dnl | ||
| 57 | -AC_DEFUN(SUDO_TIMEDIR, [AC_MSG_CHECKING(for timestamp file location) | ||
| 58 | +AC_DEFUN([SUDO_TIMEDIR], [AC_MSG_CHECKING(for timestamp file location) | ||
| 59 | if test -n "$with_timedir"; then | ||
| 60 | AC_MSG_RESULT($with_timedir) | ||
| 61 | SUDO_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$with_timedir") | ||
| 62 | @@ -160,7 +160,7 @@ | ||
| 63 | dnl SUDO_CHECK_TYPE(TYPE, DEFAULT) | ||
| 64 | dnl XXX - should require the check for unistd.h... | ||
| 65 | dnl | ||
| 66 | -AC_DEFUN(SUDO_CHECK_TYPE, | ||
| 67 | +AC_DEFUN([SUDO_CHECK_TYPE], | ||
| 68 | [AC_REQUIRE([AC_HEADER_STDC])dnl | ||
| 69 | AC_MSG_CHECKING(for $1) | ||
| 70 | AC_CACHE_VAL(sudo_cv_type_$1, | ||
| 71 | @@ -181,31 +181,31 @@ | ||
| 72 | dnl | ||
| 73 | dnl Check for size_t declation | ||
| 74 | dnl | ||
| 75 | -AC_DEFUN(SUDO_TYPE_SIZE_T, | ||
| 76 | +AC_DEFUN([SUDO_TYPE_SIZE_T], | ||
| 77 | [SUDO_CHECK_TYPE(size_t, int)]) | ||
| 78 | |||
| 79 | dnl | ||
| 80 | dnl Check for ssize_t declation | ||
| 81 | dnl | ||
| 82 | -AC_DEFUN(SUDO_TYPE_SSIZE_T, | ||
| 83 | +AC_DEFUN([SUDO_TYPE_SSIZE_T], | ||
| 84 | [SUDO_CHECK_TYPE(ssize_t, int)]) | ||
| 85 | |||
| 86 | dnl | ||
| 87 | dnl Check for dev_t declation | ||
| 88 | dnl | ||
| 89 | -AC_DEFUN(SUDO_TYPE_DEV_T, | ||
| 90 | +AC_DEFUN([SUDO_TYPE_DEV_T], | ||
| 91 | [SUDO_CHECK_TYPE(dev_t, int)]) | ||
| 92 | |||
| 93 | dnl | ||
| 94 | dnl Check for ino_t declation | ||
| 95 | dnl | ||
| 96 | -AC_DEFUN(SUDO_TYPE_INO_T, | ||
| 97 | +AC_DEFUN([SUDO_TYPE_INO_T], | ||
| 98 | [SUDO_CHECK_TYPE(ino_t, unsigned int)]) | ||
| 99 | |||
| 100 | dnl | ||
| 101 | dnl check for working fnmatch(3) | ||
| 102 | dnl | ||
| 103 | -AC_DEFUN(SUDO_FUNC_FNMATCH, | ||
| 104 | +AC_DEFUN([SUDO_FUNC_FNMATCH], | ||
| 105 | [AC_MSG_CHECKING([for working fnmatch with FNM_CASEFOLD]) | ||
| 106 | AC_CACHE_VAL(sudo_cv_func_fnmatch, | ||
| 107 | [rm -f conftestdata; > conftestdata | ||
| 108 | @@ -271,7 +271,7 @@ | ||
| 109 | dnl | ||
| 110 | dnl check for sa_len field in struct sockaddr | ||
| 111 | dnl | ||
| 112 | -AC_DEFUN(SUDO_SOCK_SA_LEN, | ||
| 113 | +AC_DEFUN([SUDO_SOCK_SA_LEN], | ||
| 114 | [AC_MSG_CHECKING(for sa_len field in struct sockaddr) | ||
| 115 | AC_CACHE_VAL(sudo_cv_sock_sa_len, | ||
| 116 | [AC_TRY_RUN([#include <sys/types.h> | ||
| 117 | @@ -294,7 +294,7 @@ | ||
| 118 | dnl we can't really trust UID_MAX or MAXUID since they may exist | ||
| 119 | dnl only for backwards compatibility. | ||
| 120 | dnl | ||
| 121 | -AC_DEFUN(SUDO_UID_T_LEN, | ||
| 122 | +AC_DEFUN([SUDO_UID_T_LEN], | ||
| 123 | [AC_REQUIRE([AC_TYPE_UID_T]) | ||
| 124 | AC_MSG_CHECKING(max length of uid_t) | ||
| 125 | AC_CACHE_VAL(sudo_cv_uid_t_len, | ||
| 126 | @@ -327,7 +327,7 @@ | ||
| 127 | dnl | ||
| 128 | dnl Check for presence of long long and for sizeof(long long) == sizeof(long) | ||
| 129 | dnl | ||
| 130 | -AC_DEFUN(SUDO_TYPE_LONG_LONG, | ||
| 131 | +AC_DEFUN([SUDO_TYPE_LONG_LONG], | ||
| 132 | [AC_CHECK_TYPES(long long, [AC_DEFINE(HAVE_LONG_LONG, 1, [Define if your compiler supports the "long long" type.])] | ||
| 133 | [AC_MSG_CHECKING(for long and long long equivalence) | ||
| 134 | AC_CACHE_VAL(sudo_cv_type_long_is_quad, | ||
| 135 | @@ -347,7 +347,7 @@ | ||
| 136 | dnl | ||
| 137 | dnl append a libpath to an LDFLAGS style variable | ||
| 138 | dnl | ||
| 139 | -AC_DEFUN(SUDO_APPEND_LIBPATH, [ | ||
| 140 | +AC_DEFUN([SUDO_APPEND_LIBPATH], [ | ||
| 141 | if test X"$with_rpath" = X"yes"; then | ||
| 142 | case "$host" in | ||
| 143 | *-*-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 @@ | |||
| 1 | # libtool requires library's name to start with 'lib', or else error is reported. with "-module" option | ||
| 2 | # that check is skipped | ||
| 3 | # | ||
| 4 | # comments added by Kevin Tian <kevin.tian@intel.com>, 06/23/2010 | ||
| 5 | Index: sudo-1.6.8p6/Makefile.in | ||
| 6 | =================================================================== | ||
| 7 | --- sudo-1.6.8p6.orig/Makefile.in 2005-01-21 19:09:26.963276656 -0500 | ||
| 8 | +++ sudo-1.6.8p6/Makefile.in 2005-01-21 19:16:11.918714072 -0500 | ||
| 9 | @@ -187,7 +187,7 @@ | ||
| 10 | $(CC) -o $@ $(TESTOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS) | ||
| 11 | |||
| 12 | sudo_noexec.la: sudo_noexec.lo | ||
| 13 | - $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir) | ||
| 14 | + $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -module -rpath $(noexecdir) | ||
| 15 | |||
| 16 | # Uncomment the following if you want "make distclean" to clean the parser | ||
| 17 | @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 @@ | |||
| 1 | # this could be pushed upstream to allowing conditional strip. Now it's not applied. | ||
| 2 | # we use sed in recipe for same purpose. Keep here as reminder for upstream | ||
| 3 | # | ||
| 4 | # comment added by Kevin Tian <kevin.tian@intel.com>, 07/01/2010 | ||
| 5 | # | ||
| 6 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
| 7 | # | ||
| 8 | |||
| 9 | Index: sudo-1.6.8p5/Makefile.in | ||
| 10 | =================================================================== | ||
| 11 | --- sudo-1.6.8p5.orig/Makefile.in 2005-01-21 18:19:05.762568976 -0500 | ||
| 12 | +++ sudo-1.6.8p5/Makefile.in 2005-01-21 18:19:34.701169640 -0500 | ||
| 13 | @@ -307,8 +307,8 @@ | ||
| 14 | $(DESTDIR)$(noexecdir) | ||
| 15 | |||
| 16 | install-binaries: $(PROGS) | ||
| 17 | - $(INSTALL) $(install_owncmd) -m 4555 -s sudo $(DESTDIR)$(sudodir)/sudo | ||
| 18 | - $(INSTALL) $(install_owncmd) -m 0555 -s visudo $(DESTDIR)$(visudodir)/visudo | ||
| 19 | + $(INSTALL) $(install_owncmd) -m 4555 sudo $(DESTDIR)$(sudodir)/sudo | ||
| 20 | + $(INSTALL) $(install_owncmd) -m 0555 visudo $(DESTDIR)$(visudodir)/visudo | ||
| 21 | rm -f $(DESTDIR)$(sudodir)/sudoedit | ||
| 22 | ln $(DESTDIR)$(sudodir)/sudo $(DESTDIR)$(sudodir)/sudoedit | ||
| 23 | |||
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 @@ | |||
| 1 | # is sizeof(long long) == sizeof(long) | ||
| 2 | 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 @@ | |||
| 1 | # is sizeof(long long) == sizeof(long) | ||
| 2 | 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 @@ | |||
| 1 | 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." | ||
| 2 | HOMEPAGE = "http://www.courtesan.com/sudo/" | ||
| 3 | BUGTRACKER = "http://www.sudo.ws/bugs/" | ||
| 4 | PRIORITY = "optional" | ||
| 5 | SECTION = "admin" | ||
| 6 | LICENSE = "ISC & UCB & MIT" | ||
| 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=a7dfe8895011d65d0c2e24aaf5ad0843 \ | ||
| 8 | file://nonunix.h;startline=4;endline=28;md5=1e70feedac93a3fd7f5254e3fec52677 \ | ||
| 9 | file://vasgroups.c;startline=4;endline=28;md5=1e70feedac93a3fd7f5254e3fec52677 \ | ||
| 10 | file://fnmatch.c;startline=6;endline=31;md5=0779058eafd6e23b966585b45bfa54f3 \ | ||
| 11 | file://getcwd.c;startline=5;endline=27;md5=08d82914995224a0ca42116d7ca2a218 \ | ||
| 12 | file://glob.c;startline=6;endline=31;md5=299cb38ec8d56e89118ce57fb83b4f78 \ | ||
| 13 | file://snprintf.c;startline=6;endline=31;md5=dabd56a89a7a773850dc06ee4f1ecde2" | ||
| 14 | |||
| 15 | inherit autotools | ||
| 16 | |||
| 17 | EXTRA_OECONF = "--with-editor=/bin/vi --with-env-editor" | ||
| 18 | |||
| 19 | do_configure_prepend () { | ||
| 20 | # Prevent binaries from being stripped on the host | ||
| 21 | sed -i 's/\($(INSTALL).*\) -s \(.*[(sudo|visudo)]\)/\1 \2/g' Makefile.in | ||
| 22 | |||
| 23 | rm -f acsite.m4 | ||
| 24 | if [ ! -e acinclude.m4 ]; then | ||
| 25 | cat aclocal.m4 > acinclude.m4 | ||
| 26 | fi | ||
| 27 | } | ||
| 28 | |||
| 29 | pkg_postinst() { | ||
| 30 | if [ "x$D" != "x" ]; then | ||
| 31 | exit 1 | ||
| 32 | fi | ||
| 33 | |||
| 34 | chmod 4111 /usr/bin/sudo | ||
| 35 | chmod 0440 /etc/sudoers | ||
| 36 | } | ||
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 @@ | |||
| 1 | PR = "r0" | ||
| 2 | |||
| 3 | SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-1.7.2p7.tar.gz \ | ||
| 4 | file://noexec-link.patch" | ||
| 5 | |||
| 6 | require sudo.inc | ||
| 7 | 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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 | ||
| 2 | --- tcp_wrappers_7.6.orig/hosts_access.5 1995-01-30 19:51:47.000000000 +0100 | ||
| 3 | +++ tcp_wrappers_7.6/hosts_access.5 2004-04-09 16:59:45.000000000 +0200 | ||
| 4 | @@ -173,7 +173,7 @@ | ||
| 5 | Patterns like these can be used when the machine has different internet | ||
| 6 | addresses with different internet hostnames. Service providers can use | ||
| 7 | this facility to offer FTP, GOPHER or WWW archives with internet names | ||
| 8 | -that may even belong to different organizations. See also the `twist' | ||
| 9 | +that may even belong to different organizations. See also the `twist\' | ||
| 10 | option in the hosts_options(5) document. Some systems (Solaris, | ||
| 11 | FreeBSD) can have more than one internet address on one physical | ||
| 12 | interface; with other systems you may have to resort to SLIP or PPP | ||
| 13 | @@ -236,10 +236,10 @@ | ||
| 14 | Before accepting a client request, the wrappers can use the IDENT | ||
| 15 | service to find out that the client did not send the request at all. | ||
| 16 | When the client host provides IDENT service, a negative IDENT lookup | ||
| 17 | -result (the client matches `UNKNOWN@host') is strong evidence of a host | ||
| 18 | +result (the client matches `UNKNOWN@host\') is strong evidence of a host | ||
| 19 | spoofing attack. | ||
| 20 | .PP | ||
| 21 | -A positive IDENT lookup result (the client matches `KNOWN@host') is | ||
| 22 | +A positive IDENT lookup result (the client matches `KNOWN@host\') is | ||
| 23 | less trustworthy. It is possible for an intruder to spoof both the | ||
| 24 | client connection and the IDENT lookup, although doing so is much | ||
| 25 | harder than spoofing just a client connection. It may also be that | ||
| 26 | diff -ruN tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5 | ||
| 27 | --- tcp_wrappers_7.6.orig/hosts_options.5 1994-12-28 17:42:29.000000000 +0100 | ||
| 28 | +++ tcp_wrappers_7.6/hosts_options.5 2004-04-09 16:59:49.000000000 +0200 | ||
| 29 | @@ -124,7 +124,7 @@ | ||
| 30 | value is taken. | ||
| 31 | .SH MISCELLANEOUS | ||
| 32 | .IP "banners /some/directory" | ||
| 33 | -Look for a file in `/some/directory' with the same name as the daemon | ||
| 34 | +Look for a file in `/some/directory\' with the same name as the daemon | ||
| 35 | process (for example in.telnetd for the telnet service), and copy its | ||
| 36 | contents to the client. Newline characters are replaced by | ||
| 37 | carriage-return newline, and %<letter> sequences are expanded (see | ||
| 38 | diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8 | ||
| 39 | --- tcp_wrappers_7.6.orig/tcpdmatch.8 1996-02-11 17:01:36.000000000 +0100 | ||
| 40 | +++ tcp_wrappers_7.6/tcpdmatch.8 2004-04-09 17:00:49.000000000 +0200 | ||
| 41 | @@ -26,7 +26,7 @@ | ||
| 42 | A daemon process name. Typically, the last component of a daemon | ||
| 43 | executable pathname. | ||
| 44 | .IP client | ||
| 45 | -A host name or network address, or one of the `unknown' or `paranoid' | ||
| 46 | +A host name or network address, or one of the `unknown\' or `paranoid\' | ||
| 47 | wildcard patterns. | ||
| 48 | .sp | ||
| 49 | When a client host name is specified, \fItcpdmatch\fR gives a | ||
| 50 | @@ -37,13 +37,13 @@ | ||
| 51 | .PP | ||
| 52 | Optional information specified with the \fIdaemon@server\fR form: | ||
| 53 | .IP server | ||
| 54 | -A host name or network address, or one of the `unknown' or `paranoid' | ||
| 55 | -wildcard patterns. The default server name is `unknown'. | ||
| 56 | +A host name or network address, or one of the `unknown\' or `paranoid\' | ||
| 57 | +wildcard patterns. The default server name is `unknown\'. | ||
| 58 | .PP | ||
| 59 | Optional information specified with the \fIuser@client\fR form: | ||
| 60 | .IP user | ||
| 61 | A client user identifier. Typically, a login name or a numeric userid. | ||
| 62 | -The default user name is `unknown'. | ||
| 63 | +The default user name is `unknown\'. | ||
| 64 | .SH OPTIONS | ||
| 65 | .IP -d | ||
| 66 | Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current | ||
| 67 | @@ -70,7 +70,7 @@ | ||
| 68 | .ti +5 | ||
| 69 | tcpdmatch in.telnetd paranoid | ||
| 70 | .PP | ||
| 71 | -On some systems, daemon names have no `in.' prefix, or \fItcpdmatch\fR | ||
| 72 | +On some systems, daemon names have no `in.\' prefix, or \fItcpdmatch\fR | ||
| 73 | may need some help to locate the inetd configuration file. | ||
| 74 | .SH FILES | ||
| 75 | .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 @@ | |||
| 1 | diff -ruNp tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3 | ||
| 2 | --- tcp_wrappers_7.6.orig/hosts_access.3 2005-03-09 18:30:25.000000000 +0100 | ||
| 3 | +++ tcp_wrappers_7.6/hosts_access.3 2005-03-09 18:27:03.000000000 +0100 | ||
| 4 | @@ -3,7 +3,7 @@ | ||
| 5 | hosts_access, hosts_ctl, request_init, request_set \- access control library | ||
| 6 | .SH SYNOPSIS | ||
| 7 | .nf | ||
| 8 | -#include "tcpd.h" | ||
| 9 | +#include <tcpd.h> | ||
| 10 | |||
| 11 | extern int allow_severity; | ||
| 12 | extern int deny_severity; | ||
| 13 | diff -ruNp tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 | ||
| 14 | --- tcp_wrappers_7.6.orig/hosts_access.5 2005-03-09 18:30:25.000000000 +0100 | ||
| 15 | +++ tcp_wrappers_7.6/hosts_access.5 2005-03-09 18:30:18.000000000 +0100 | ||
| 16 | @@ -8,9 +8,9 @@ name, host name/address) patterns. Exam | ||
| 17 | impatient reader is encouraged to skip to the EXAMPLES section for a | ||
| 18 | quick introduction. | ||
| 19 | .PP | ||
| 20 | -An extended version of the access control language is described in the | ||
| 21 | -\fIhosts_options\fR(5) document. The extensions are turned on at | ||
| 22 | -program build time by building with -DPROCESS_OPTIONS. | ||
| 23 | +The extended version of the access control language is described in the | ||
| 24 | +\fIhosts_options\fR(5) document. \fBNote that this language supersedes | ||
| 25 | +the meaning of \fIshell_command\fB as documented below.\fR | ||
| 26 | .PP | ||
| 27 | In the following text, \fIdaemon\fR is the the process name of a | ||
| 28 | network daemon process, and \fIclient\fR is the name and/or address of | ||
| 29 | @@ -346,8 +346,8 @@ in.tftpd: LOCAL, .my.domain | ||
| 30 | /etc/hosts.deny: | ||
| 31 | .in +3 | ||
| 32 | .nf | ||
| 33 | -in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\ | ||
| 34 | - /usr/ucb/mail -s %d-%h root) & | ||
| 35 | +in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\ | ||
| 36 | + /usr/bin/mail -s %d-%h root) & | ||
| 37 | .fi | ||
| 38 | .PP | ||
| 39 | The safe_finger command comes with the tcpd wrapper and should be | ||
| 40 | @@ -383,6 +383,7 @@ that shouldn\'t. All problems are repor | ||
| 41 | .fi | ||
| 42 | .SH SEE ALSO | ||
| 43 | .nf | ||
| 44 | +hosts_options(5) extended syntax. | ||
| 45 | tcpd(8) tcp/ip daemon wrapper program. | ||
| 46 | tcpdchk(8), tcpdmatch(8), test programs. | ||
| 47 | .SH BUGS | ||
| 48 | diff -ruNp tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5 | ||
| 49 | --- tcp_wrappers_7.6.orig/hosts_options.5 2005-03-09 18:30:24.000000000 +0100 | ||
| 50 | +++ tcp_wrappers_7.6/hosts_options.5 2005-03-09 18:27:03.000000000 +0100 | ||
| 51 | @@ -2,10 +2,8 @@ | ||
| 52 | .SH NAME | ||
| 53 | hosts_options \- host access control language extensions | ||
| 54 | .SH DESCRIPTION | ||
| 55 | -This document describes optional extensions to the language described | ||
| 56 | -in the hosts_access(5) document. The extensions are enabled at program | ||
| 57 | -build time. For example, by editing the Makefile and turning on the | ||
| 58 | -PROCESS_OPTIONS compile-time option. | ||
| 59 | +This document describes extensions to the language described | ||
| 60 | +in the hosts_access(5) document. | ||
| 61 | .PP | ||
| 62 | The extensible language uses the following format: | ||
| 63 | .sp | ||
| 64 | @@ -58,12 +56,12 @@ Notice the leading dot on the domain nam | ||
| 65 | Execute, in a child process, the specified shell command, after | ||
| 66 | performing the %<letter> expansions described in the hosts_access(5) | ||
| 67 | manual page. The command is executed with stdin, stdout and stderr | ||
| 68 | -connected to the null device, so that it won\'t mess up the | ||
| 69 | +connected to the null device, so that it won't mess up the | ||
| 70 | conversation with the client host. Example: | ||
| 71 | .sp | ||
| 72 | .nf | ||
| 73 | .ti +3 | ||
| 74 | -spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) & | ||
| 75 | +spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) & | ||
| 76 | .fi | ||
| 77 | .sp | ||
| 78 | executes, in a background child process, the shell command "safe_finger | ||
| 79 | diff -ruNp tcp_wrappers_7.6.orig/inetcf.c tcp_wrappers_7.6/inetcf.c | ||
| 80 | --- tcp_wrappers_7.6.orig/inetcf.c 1997-02-12 02:13:24.000000000 +0100 | ||
| 81 | +++ tcp_wrappers_7.6/inetcf.c 2005-03-09 18:27:03.000000000 +0100 | ||
| 82 | @@ -26,13 +26,17 @@ extern void exit(); | ||
| 83 | * guesses. Shorter names follow longer ones. | ||
| 84 | */ | ||
| 85 | char *inet_files[] = { | ||
| 86 | +#if 0 | ||
| 87 | "/private/etc/inetd.conf", /* NEXT */ | ||
| 88 | "/etc/inet/inetd.conf", /* SYSV4 */ | ||
| 89 | "/usr/etc/inetd.conf", /* IRIX?? */ | ||
| 90 | +#endif | ||
| 91 | "/etc/inetd.conf", /* BSD */ | ||
| 92 | +#if 0 | ||
| 93 | "/etc/net/tlid.conf", /* SYSV4?? */ | ||
| 94 | "/etc/saf/tlid.conf", /* SYSV4?? */ | ||
| 95 | "/etc/tlid.conf", /* SYSV4?? */ | ||
| 96 | +#endif | ||
| 97 | 0, | ||
| 98 | }; | ||
| 99 | |||
| 100 | diff -ruNp tcp_wrappers_7.6.orig/tcpd.8 tcp_wrappers_7.6/tcpd.8 | ||
| 101 | --- tcp_wrappers_7.6.orig/tcpd.8 1996-02-21 16:39:16.000000000 +0100 | ||
| 102 | +++ tcp_wrappers_7.6/tcpd.8 2005-03-09 18:27:03.000000000 +0100 | ||
| 103 | @@ -12,7 +12,11 @@ The program supports both 4.3BSD-style s | ||
| 104 | TLI. Functionality may be limited when the protocol underneath TLI is | ||
| 105 | not an internet protocol. | ||
| 106 | .PP | ||
| 107 | -Operation is as follows: whenever a request for service arrives, the | ||
| 108 | +There are two possible modes of operation: execution of \fItcpd\fP | ||
| 109 | +before a service started by \fIinetd\fP, or linking a daemon with | ||
| 110 | +the \fIlibwrap\fP shared library as documented in the \fIhosts_access\fR(3) | ||
| 111 | +manual page. Operation when started by \fIinetd\fP | ||
| 112 | +is as follows: whenever a request for service arrives, the | ||
| 113 | \fIinetd\fP daemon is tricked into running the \fItcpd\fP program | ||
| 114 | instead of the desired server. \fItcpd\fP logs the request and does | ||
| 115 | some additional checks. When all is well, \fItcpd\fP runs the | ||
| 116 | @@ -88,11 +92,11 @@ configuration files. | ||
| 117 | .sp | ||
| 118 | .in +5 | ||
| 119 | # mkdir /other/place | ||
| 120 | -# mv /usr/etc/in.fingerd /other/place | ||
| 121 | -# cp tcpd /usr/etc/in.fingerd | ||
| 122 | +# mv /usr/sbin/in.fingerd /other/place | ||
| 123 | +# cp tcpd /usr/sbin/in.fingerd | ||
| 124 | .fi | ||
| 125 | .PP | ||
| 126 | -The example assumes that the network daemons live in /usr/etc. On some | ||
| 127 | +The example assumes that the network daemons live in /usr/sbin. On some | ||
| 128 | systems, network daemons live in /usr/sbin or in /usr/libexec, or have | ||
| 129 | no `in.\' prefix to their name. | ||
| 130 | .SH EXAMPLE 2 | ||
| 131 | @@ -101,35 +105,34 @@ are left in their original place. | ||
| 132 | .PP | ||
| 133 | In order to monitor access to the \fIfinger\fR service, perform the | ||
| 134 | following edits on the \fIinetd\fR configuration file (usually | ||
| 135 | -\fI/etc/inetd.conf\fR or \fI/etc/inet/inetd.conf\fR): | ||
| 136 | +\fI/etc/inetd.conf\fR): | ||
| 137 | .nf | ||
| 138 | .sp | ||
| 139 | .ti +5 | ||
| 140 | -finger stream tcp nowait nobody /usr/etc/in.fingerd in.fingerd | ||
| 141 | +finger stream tcp nowait nobody /usr/sbin/in.fingerd in.fingerd | ||
| 142 | .sp | ||
| 143 | becomes: | ||
| 144 | .sp | ||
| 145 | .ti +5 | ||
| 146 | -finger stream tcp nowait nobody /some/where/tcpd in.fingerd | ||
| 147 | +finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd | ||
| 148 | .sp | ||
| 149 | .fi | ||
| 150 | .PP | ||
| 151 | -The example assumes that the network daemons live in /usr/etc. On some | ||
| 152 | +The example assumes that the network daemons live in /usr/sbin. On some | ||
| 153 | systems, network daemons live in /usr/sbin or in /usr/libexec, the | ||
| 154 | daemons have no `in.\' prefix to their name, or there is no userid | ||
| 155 | field in the inetd configuration file. | ||
| 156 | .PP | ||
| 157 | Similar changes will be needed for the other services that are to be | ||
| 158 | covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8) | ||
| 159 | -process to make the changes effective. AIX users may also have to | ||
| 160 | -execute the `inetimp\' command. | ||
| 161 | +process to make the changes effective. | ||
| 162 | .SH EXAMPLE 3 | ||
| 163 | In the case of daemons that do not live in a common directory ("secret" | ||
| 164 | or otherwise), edit the \fIinetd\fR configuration file so that it | ||
| 165 | specifies an absolute path name for the process name field. For example: | ||
| 166 | .nf | ||
| 167 | .sp | ||
| 168 | - ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd | ||
| 169 | + ntalk dgram udp wait root /usr/sbin/tcpd /usr/local/lib/ntalkd | ||
| 170 | .sp | ||
| 171 | .fi | ||
| 172 | .PP | ||
| 173 | @@ -164,6 +167,7 @@ The default locations of the host access | ||
| 174 | .SH SEE ALSO | ||
| 175 | .na | ||
| 176 | .nf | ||
| 177 | +hosts_access(3), functions provided by the libwrap library. | ||
| 178 | hosts_access(5), format of the tcpd access control tables. | ||
| 179 | syslog.conf(5), format of the syslogd control file. | ||
| 180 | inetd.conf(5), format of the inetd control file. | ||
| 181 | diff -ruNp tcp_wrappers_7.6.orig/tcpdchk.8 tcp_wrappers_7.6/tcpdchk.8 | ||
| 182 | --- tcp_wrappers_7.6.orig/tcpdchk.8 1995-01-08 17:00:31.000000000 +0100 | ||
| 183 | +++ tcp_wrappers_7.6/tcpdchk.8 2005-03-09 18:27:03.000000000 +0100 | ||
| 184 | @@ -9,8 +9,8 @@ tcpdchk [-a] [-d] [-i inet_conf] [-v] | ||
| 185 | potential and real problems it can find. The program examines the | ||
| 186 | \fItcpd\fR access control files (by default, these are | ||
| 187 | \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR), and compares the | ||
| 188 | -entries in these files against entries in the \fIinetd\fR or \fItlid\fR | ||
| 189 | -network configuration files. | ||
| 190 | +entries in these files against entries in the \fIinetd\fR | ||
| 191 | +network configuration file. | ||
| 192 | .PP | ||
| 193 | \fItcpdchk\fR reports problems such as non-existent pathnames; services | ||
| 194 | that appear in \fItcpd\fR access control rules, but are not controlled | ||
| 195 | @@ -26,14 +26,13 @@ problem. | ||
| 196 | .SH OPTIONS | ||
| 197 | .IP -a | ||
| 198 | Report access control rules that permit access without an explicit | ||
| 199 | -ALLOW keyword. This applies only when the extended access control | ||
| 200 | -language is enabled (build with -DPROCESS_OPTIONS). | ||
| 201 | +ALLOW keyword. | ||
| 202 | .IP -d | ||
| 203 | Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current | ||
| 204 | directory instead of the default ones. | ||
| 205 | .IP "-i inet_conf" | ||
| 206 | Specify this option when \fItcpdchk\fR is unable to find your | ||
| 207 | -\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when | ||
| 208 | +\fIinetd.conf\fR network configuration file, or when | ||
| 209 | you suspect that the program uses the wrong one. | ||
| 210 | .IP -v | ||
| 211 | Display the contents of each access control rule. Daemon lists, client | ||
| 212 | @@ -54,7 +53,6 @@ tcpdmatch(8), explain what tcpd would do | ||
| 213 | hosts_access(5), format of the tcpd access control tables. | ||
| 214 | hosts_options(5), format of the language extensions. | ||
| 215 | inetd.conf(5), format of the inetd control file. | ||
| 216 | -tlid.conf(5), format of the tlid control file. | ||
| 217 | .SH AUTHORS | ||
| 218 | .na | ||
| 219 | .nf | ||
| 220 | diff -ruNp tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8 | ||
| 221 | --- tcp_wrappers_7.6.orig/tcpdmatch.8 2005-03-09 18:30:24.000000000 +0100 | ||
| 222 | +++ tcp_wrappers_7.6/tcpdmatch.8 2005-03-09 18:27:03.000000000 +0100 | ||
| 223 | @@ -13,7 +13,7 @@ request for service. Examples are given | ||
| 224 | The program examines the \fItcpd\fR access control tables (default | ||
| 225 | \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR) and prints its | ||
| 226 | conclusion. For maximal accuracy, it extracts additional information | ||
| 227 | -from your \fIinetd\fR or \fItlid\fR network configuration file. | ||
| 228 | +from your \fIinetd\fR network configuration file. | ||
| 229 | .PP | ||
| 230 | When \fItcpdmatch\fR finds a match in the access control tables, it | ||
| 231 | identifies the matched rule. In addition, it displays the optional | ||
| 232 | @@ -50,7 +50,7 @@ Examine \fIhosts.allow\fR and \fIhosts.d | ||
| 233 | directory instead of the default ones. | ||
| 234 | .IP "-i inet_conf" | ||
| 235 | Specify this option when \fItcpdmatch\fR is unable to find your | ||
| 236 | -\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when | ||
| 237 | +\fIinetd.conf\fR network configuration file, or when | ||
| 238 | you suspect that the program uses the wrong one. | ||
| 239 | .SH EXAMPLES | ||
| 240 | To predict how \fItcpd\fR would handle a telnet request from the local | ||
| 241 | @@ -86,7 +86,6 @@ tcpdchk(8), tcpd configuration checker | ||
| 242 | hosts_access(5), format of the tcpd access control tables. | ||
| 243 | hosts_options(5), format of the language extensions. | ||
| 244 | inetd.conf(5), format of the inetd control file. | ||
| 245 | -tlid.conf(5), format of the tlid control file. | ||
| 246 | .SH AUTHORS | ||
| 247 | .na | ||
| 248 | .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 @@ | |||
| 1 | See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=17847 | ||
| 2 | |||
| 3 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 | ||
| 4 | --- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 18:54:33.000000000 +0200 | ||
| 5 | +++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 18:54:27.000000000 +0200 | ||
| 6 | @@ -89,6 +89,10 @@ | ||
| 7 | bitwise AND of the address and the `mask\'. For example, the net/mask | ||
| 8 | pattern `131.155.72.0/255.255.254.0\' matches every address in the | ||
| 9 | range `131.155.72.0\' through `131.155.73.255\'. | ||
| 10 | +.IP \(bu | ||
| 11 | +Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This | ||
| 12 | +method of matching cannot be used in conjunction with `net/mask\' matching, | ||
| 13 | +hostname matching beginning with `.\' or IP address matching ending with `.\'. | ||
| 14 | .SH WILDCARDS | ||
| 15 | The access control language supports explicit wildcards: | ||
| 16 | .IP ALL | ||
| 17 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c | ||
| 18 | --- tcp_wrappers_7.6.orig/hosts_access.c 1997-02-12 02:13:23.000000000 +0100 | ||
| 19 | +++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 18:52:21.000000000 +0200 | ||
| 20 | @@ -289,6 +289,11 @@ | ||
| 21 | { | ||
| 22 | int n; | ||
| 23 | |||
| 24 | +#ifndef DISABLE_WILDCARD_MATCHING | ||
| 25 | + if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */ | ||
| 26 | + return (match_pattern_ylo(string,tok)); | ||
| 27 | + } else | ||
| 28 | +#endif | ||
| 29 | if (tok[0] == '.') { /* suffix */ | ||
| 30 | n = strlen(string) - strlen(tok); | ||
| 31 | return (n > 0 && STR_EQ(tok, string + n)); | ||
| 32 | @@ -329,3 +334,71 @@ | ||
| 33 | } | ||
| 34 | return ((addr & mask) == net); | ||
| 35 | } | ||
| 36 | + | ||
| 37 | +#ifndef DISABLE_WILDCARD_MATCHING | ||
| 38 | +/* Note: this feature has been adapted in a pretty straightforward way | ||
| 39 | + from Tatu Ylonen's last SSH version under free license by | ||
| 40 | + Pekka Savola <pekkas@netcore.fi>. | ||
| 41 | + | ||
| 42 | + Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | ||
| 43 | +*/ | ||
| 44 | + | ||
| 45 | +/* Returns true if the given string matches the pattern (which may contain | ||
| 46 | + ? and * as wildcards), and zero if it does not match. */ | ||
| 47 | + | ||
| 48 | +int match_pattern_ylo(const char *s, const char *pattern) | ||
| 49 | +{ | ||
| 50 | + while (1) | ||
| 51 | + { | ||
| 52 | + /* If at end of pattern, accept if also at end of string. */ | ||
| 53 | + if (!*pattern) | ||
| 54 | + return !*s; | ||
| 55 | + | ||
| 56 | + /* Process '*'. */ | ||
| 57 | + if (*pattern == '*') | ||
| 58 | + { | ||
| 59 | + /* Skip the asterisk. */ | ||
| 60 | + pattern++; | ||
| 61 | + | ||
| 62 | + /* If at end of pattern, accept immediately. */ | ||
| 63 | + if (!*pattern) | ||
| 64 | + return 1; | ||
| 65 | + | ||
| 66 | + /* If next character in pattern is known, optimize. */ | ||
| 67 | + if (*pattern != '?' && *pattern != '*') | ||
| 68 | + { | ||
| 69 | + /* Look instances of the next character in pattern, and try | ||
| 70 | + to match starting from those. */ | ||
| 71 | + for (; *s; s++) | ||
| 72 | + if (*s == *pattern && | ||
| 73 | + match_pattern_ylo(s + 1, pattern + 1)) | ||
| 74 | + return 1; | ||
| 75 | + /* Failed. */ | ||
| 76 | + return 0; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /* Move ahead one character at a time and try to match at each | ||
| 80 | + position. */ | ||
| 81 | + for (; *s; s++) | ||
| 82 | + if (match_pattern_ylo(s, pattern)) | ||
| 83 | + return 1; | ||
| 84 | + /* Failed. */ | ||
| 85 | + return 0; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + /* There must be at least one more character in the string. If we are | ||
| 89 | + at the end, fail. */ | ||
| 90 | + if (!*s) | ||
| 91 | + return 0; | ||
| 92 | + | ||
| 93 | + /* Check if the next character of the string is acceptable. */ | ||
| 94 | + if (*pattern != '?' && *pattern != *s) | ||
| 95 | + return 0; | ||
| 96 | + | ||
| 97 | + /* Move to the next character, both in string and in pattern. */ | ||
| 98 | + s++; | ||
| 99 | + pattern++; | ||
| 100 | + } | ||
| 101 | + /*NOTREACHED*/ | ||
| 102 | +} | ||
| 103 | +#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 @@ | |||
| 1 | * Mon Feb 5 2001 Preston Brown <pbrown@redhat.com> | ||
| 2 | - fix gethostbyname to work better with dot "." notation (#16949) | ||
| 3 | |||
| 4 | --- tcp_wrappers_7.6/socket.c.fixgethostbyname Fri Mar 21 13:27:25 1997 | ||
| 5 | +++ tcp_wrappers_7.6/socket.c Mon Feb 5 14:09:40 2001 | ||
| 6 | @@ -52,7 +52,8 @@ | ||
| 7 | char *name; | ||
| 8 | { | ||
| 9 | char dot_name[MAXHOSTNAMELEN + 1]; | ||
| 10 | - | ||
| 11 | + struct hostent *hp; | ||
| 12 | + | ||
| 13 | /* | ||
| 14 | * Don't append dots to unqualified names. Such names are likely to come | ||
| 15 | * from local hosts files or from NIS. | ||
| 16 | @@ -61,8 +62,12 @@ | ||
| 17 | if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) { | ||
| 18 | return (gethostbyname(name)); | ||
| 19 | } else { | ||
| 20 | - sprintf(dot_name, "%s.", name); | ||
| 21 | - return (gethostbyname(dot_name)); | ||
| 22 | + sprintf(dot_name, "%s.", name); | ||
| 23 | + hp = gethostbyname(dot_name); | ||
| 24 | + if (hp) | ||
| 25 | + return hp; | ||
| 26 | + else | ||
| 27 | + return (gethostbyname(name)); | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/fix_options.c tcp_wrappers_7.6/fix_options.c | ||
| 2 | --- tcp_wrappers_7.6.orig/fix_options.c 1997-04-08 02:29:19.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/fix_options.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 4 | @@ -11,6 +11,9 @@ | ||
| 5 | |||
| 6 | #include <sys/types.h> | ||
| 7 | #include <sys/param.h> | ||
| 8 | +#ifdef INET6 | ||
| 9 | +#include <sys/socket.h> | ||
| 10 | +#endif | ||
| 11 | #include <netinet/in.h> | ||
| 12 | #include <netinet/in_systm.h> | ||
| 13 | #include <netinet/ip.h> | ||
| 14 | @@ -41,6 +44,22 @@ | ||
| 15 | unsigned int opt; | ||
| 16 | int optlen; | ||
| 17 | struct in_addr dummy; | ||
| 18 | +#ifdef INET6 | ||
| 19 | + struct sockaddr_storage ss; | ||
| 20 | + int sslen; | ||
| 21 | + | ||
| 22 | + /* | ||
| 23 | + * check if this is AF_INET socket | ||
| 24 | + * XXX IPv6 support? | ||
| 25 | + */ | ||
| 26 | + sslen = sizeof(ss); | ||
| 27 | + if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) { | ||
| 28 | + syslog(LOG_ERR, "getpeername: %m"); | ||
| 29 | + clean_exit(request); | ||
| 30 | + } | ||
| 31 | + if (ss.ss_family != AF_INET) | ||
| 32 | + return; | ||
| 33 | +#endif | ||
| 34 | |||
| 35 | if ((ip = getprotobyname("ip")) != 0) | ||
| 36 | ipproto = ip->p_proto; | ||
| 37 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 | ||
| 38 | --- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:22:58.000000000 +0200 | ||
| 39 | +++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:07:43.000000000 +0200 | ||
| 40 | @@ -85,11 +85,18 @@ | ||
| 41 | for daemon process names or for client user names. | ||
| 42 | .IP \(bu | ||
| 43 | An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a | ||
| 44 | -`net/mask\' pair. A host address is matched if `net\' is equal to the | ||
| 45 | +`net/mask\' pair. An IPv4 host address is matched if `net\' is equal to the | ||
| 46 | bitwise AND of the address and the `mask\'. For example, the net/mask | ||
| 47 | pattern `131.155.72.0/255.255.254.0\' matches every address in the | ||
| 48 | range `131.155.72.0\' through `131.155.73.255\'. | ||
| 49 | .IP \(bu | ||
| 50 | +An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a | ||
| 51 | +`[net]/prefixlen\' pair. An IPv6 host address is matched if | ||
| 52 | +`prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the | ||
| 53 | +address. For example, the [net]/prefixlen pattern | ||
| 54 | +`[3ffe:505:2:1::]/64\' matches every address in the range | ||
| 55 | +`3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'. | ||
| 56 | +.IP \(bu | ||
| 57 | Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This | ||
| 58 | method of matching cannot be used in conjunction with `net/mask\' matching, | ||
| 59 | hostname matching beginning with `.\' or IP address matching ending with `.\'. | ||
| 60 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c | ||
| 61 | --- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:22:58.000000000 +0200 | ||
| 62 | +++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 63 | @@ -24,7 +24,13 @@ | ||
| 64 | /* System libraries. */ | ||
| 65 | |||
| 66 | #include <sys/types.h> | ||
| 67 | +#ifdef INT32_T | ||
| 68 | + typedef uint32_t u_int32_t; | ||
| 69 | +#endif | ||
| 70 | #include <sys/param.h> | ||
| 71 | +#ifdef INET6 | ||
| 72 | +#include <sys/socket.h> | ||
| 73 | +#endif | ||
| 74 | #include <netinet/in.h> | ||
| 75 | #include <arpa/inet.h> | ||
| 76 | #include <stdio.h> | ||
| 77 | @@ -33,6 +39,9 @@ | ||
| 78 | #include <errno.h> | ||
| 79 | #include <setjmp.h> | ||
| 80 | #include <string.h> | ||
| 81 | +#ifdef INET6 | ||
| 82 | +#include <netdb.h> | ||
| 83 | +#endif | ||
| 84 | |||
| 85 | extern char *fgets(); | ||
| 86 | extern int errno; | ||
| 87 | @@ -82,6 +91,10 @@ | ||
| 88 | static int host_match(); | ||
| 89 | static int string_match(); | ||
| 90 | static int masked_match(); | ||
| 91 | +#ifdef INET6 | ||
| 92 | +static int masked_match4(); | ||
| 93 | +static int masked_match6(); | ||
| 94 | +#endif | ||
| 95 | |||
| 96 | /* Size of logical line buffer. */ | ||
| 97 | |||
| 98 | @@ -289,6 +302,13 @@ | ||
| 99 | { | ||
| 100 | int n; | ||
| 101 | |||
| 102 | +#ifdef INET6 | ||
| 103 | + /* convert IPv4 mapped IPv6 address to IPv4 address */ | ||
| 104 | + if (STRN_EQ(string, "::ffff:", 7) | ||
| 105 | + && dot_quad_addr(string + 7) != INADDR_NONE) { | ||
| 106 | + string += 7; | ||
| 107 | + } | ||
| 108 | +#endif | ||
| 109 | #ifndef DISABLE_WILDCARD_MATCHING | ||
| 110 | if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */ | ||
| 111 | return (match_pattern_ylo(string,tok)); | ||
| 112 | @@ -304,20 +324,72 @@ | ||
| 113 | } else if (tok[(n = strlen(tok)) - 1] == '.') { /* prefix */ | ||
| 114 | return (STRN_EQ(tok, string, n)); | ||
| 115 | } else { /* exact match */ | ||
| 116 | +#ifdef INET6 | ||
| 117 | + struct addrinfo hints, *res; | ||
| 118 | + struct sockaddr_in6 pat, addr; | ||
| 119 | + int len, ret; | ||
| 120 | + char ch; | ||
| 121 | + | ||
| 122 | + len = strlen(tok); | ||
| 123 | + if (*tok == '[' && tok[len - 1] == ']') { | ||
| 124 | + ch = tok[len - 1]; | ||
| 125 | + tok[len - 1] = '\0'; | ||
| 126 | + memset(&hints, 0, sizeof(hints)); | ||
| 127 | + hints.ai_family = AF_INET6; | ||
| 128 | + hints.ai_socktype = SOCK_STREAM; | ||
| 129 | + hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; | ||
| 130 | + if ((ret = getaddrinfo(tok + 1, NULL, &hints, &res)) == 0) { | ||
| 131 | + memcpy(&pat, res->ai_addr, sizeof(pat)); | ||
| 132 | + freeaddrinfo(res); | ||
| 133 | + } | ||
| 134 | + tok[len - 1] = ch; | ||
| 135 | + if (ret != 0 || getaddrinfo(string, NULL, &hints, &res) != 0) | ||
| 136 | + return NO; | ||
| 137 | + memcpy(&addr, res->ai_addr, sizeof(addr)); | ||
| 138 | + freeaddrinfo(res); | ||
| 139 | +#ifdef NI_WITHSCOPEID | ||
| 140 | + if (pat.sin6_scope_id != 0 && | ||
| 141 | + addr.sin6_scope_id != pat.sin6_scope_id) | ||
| 142 | + return NO; | ||
| 143 | +#endif | ||
| 144 | + return (!memcmp(&pat.sin6_addr, &addr.sin6_addr, | ||
| 145 | + sizeof(struct in6_addr))); | ||
| 146 | + return (ret); | ||
| 147 | + } | ||
| 148 | +#endif | ||
| 149 | return (STR_EQ(tok, string)); | ||
| 150 | } | ||
| 151 | } | ||
| 152 | |||
| 153 | /* masked_match - match address against netnumber/netmask */ | ||
| 154 | |||
| 155 | +#ifdef INET6 | ||
| 156 | static int masked_match(net_tok, mask_tok, string) | ||
| 157 | char *net_tok; | ||
| 158 | char *mask_tok; | ||
| 159 | char *string; | ||
| 160 | { | ||
| 161 | + return (masked_match4(net_tok, mask_tok, string) || | ||
| 162 | + masked_match6(net_tok, mask_tok, string)); | ||
| 163 | +} | ||
| 164 | + | ||
| 165 | +static int masked_match4(net_tok, mask_tok, string) | ||
| 166 | +#else | ||
| 167 | +static int masked_match(net_tok, mask_tok, string) | ||
| 168 | +#endif | ||
| 169 | +char *net_tok; | ||
| 170 | +char *mask_tok; | ||
| 171 | +char *string; | ||
| 172 | +{ | ||
| 173 | +#ifdef INET6 | ||
| 174 | + u_int32_t net; | ||
| 175 | + u_int32_t mask; | ||
| 176 | + u_int32_t addr; | ||
| 177 | +#else | ||
| 178 | unsigned long net; | ||
| 179 | unsigned long mask; | ||
| 180 | unsigned long addr; | ||
| 181 | +#endif | ||
| 182 | |||
| 183 | /* | ||
| 184 | * Disallow forms other than dotted quad: the treatment that inet_addr() | ||
| 185 | @@ -329,12 +401,78 @@ | ||
| 186 | return (NO); | ||
| 187 | if ((net = dot_quad_addr(net_tok)) == INADDR_NONE | ||
| 188 | || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) { | ||
| 189 | +#ifndef INET6 | ||
| 190 | tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok); | ||
| 191 | +#endif | ||
| 192 | return (NO); /* not tcpd_jump() */ | ||
| 193 | } | ||
| 194 | return ((addr & mask) == net); | ||
| 195 | } | ||
| 196 | |||
| 197 | +#ifdef INET6 | ||
| 198 | +static int masked_match6(net_tok, mask_tok, string) | ||
| 199 | +char *net_tok; | ||
| 200 | +char *mask_tok; | ||
| 201 | +char *string; | ||
| 202 | +{ | ||
| 203 | + struct addrinfo hints, *res; | ||
| 204 | + struct sockaddr_in6 net, addr; | ||
| 205 | + u_int32_t mask; | ||
| 206 | + int len, mask_len, i = 0; | ||
| 207 | + char ch; | ||
| 208 | + | ||
| 209 | + memset(&hints, 0, sizeof(hints)); | ||
| 210 | + hints.ai_family = AF_INET6; | ||
| 211 | + hints.ai_socktype = SOCK_STREAM; | ||
| 212 | + hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; | ||
| 213 | + if (getaddrinfo(string, NULL, &hints, &res) != 0) | ||
| 214 | + return NO; | ||
| 215 | + memcpy(&addr, res->ai_addr, sizeof(addr)); | ||
| 216 | + freeaddrinfo(res); | ||
| 217 | + | ||
| 218 | + if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) { | ||
| 219 | + if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE | ||
| 220 | + || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) | ||
| 221 | + return (NO); | ||
| 222 | + return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]); | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + /* match IPv6 address against netnumber/prefixlen */ | ||
| 226 | + len = strlen(net_tok); | ||
| 227 | + if (*net_tok != '[' || net_tok[len - 1] != ']') | ||
| 228 | + return NO; | ||
| 229 | + ch = net_tok[len - 1]; | ||
| 230 | + net_tok[len - 1] = '\0'; | ||
| 231 | + if (getaddrinfo(net_tok + 1, NULL, &hints, &res) != 0) { | ||
| 232 | + net_tok[len - 1] = ch; | ||
| 233 | + return NO; | ||
| 234 | + } | ||
| 235 | + memcpy(&net, res->ai_addr, sizeof(net)); | ||
| 236 | + freeaddrinfo(res); | ||
| 237 | + net_tok[len - 1] = ch; | ||
| 238 | + if ((mask_len = atoi(mask_tok)) < 0 || mask_len > 128) | ||
| 239 | + return NO; | ||
| 240 | + | ||
| 241 | +#ifdef NI_WITHSCOPEID | ||
| 242 | + if (net.sin6_scope_id != 0 && addr.sin6_scope_id != net.sin6_scope_id) | ||
| 243 | + return NO; | ||
| 244 | +#endif | ||
| 245 | + while (mask_len > 0) { | ||
| 246 | + if (mask_len < 32) { | ||
| 247 | + mask = htonl(~(0xffffffff >> mask_len)); | ||
| 248 | + if ((*(u_int32_t *)&addr.sin6_addr.s6_addr[i] & mask) != (*(u_int32_t *)&net.sin6_addr.s6_addr[i] & mask)) | ||
| 249 | + return NO; | ||
| 250 | + break; | ||
| 251 | + } | ||
| 252 | + if (*(u_int32_t *)&addr.sin6_addr.s6_addr[i] != *(u_int32_t *)&net.sin6_addr.s6_addr[i]) | ||
| 253 | + return NO; | ||
| 254 | + i += 4; | ||
| 255 | + mask_len -= 32; | ||
| 256 | + } | ||
| 257 | + return YES; | ||
| 258 | +} | ||
| 259 | +#endif /* INET6 */ | ||
| 260 | + | ||
| 261 | #ifndef DISABLE_WILDCARD_MATCHING | ||
| 262 | /* Note: this feature has been adapted in a pretty straightforward way | ||
| 263 | from Tatu Ylonen's last SSH version under free license by | ||
| 264 | diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile | ||
| 265 | --- tcp_wrappers_7.6.orig/Makefile 1997-03-21 19:27:21.000000000 +0100 | ||
| 266 | +++ tcp_wrappers_7.6/Makefile 2004-04-10 19:22:44.000000000 +0200 | ||
| 267 | @@ -21,7 +21,7 @@ | ||
| 268 | @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix" | ||
| 269 | @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211" | ||
| 270 | @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4" | ||
| 271 | - @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2" | ||
| 272 | + @echo " sunos40 sunos5 solaris8 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2" | ||
| 273 | @echo " uts215 uxp" | ||
| 274 | @echo | ||
| 275 | @echo "If none of these match your environment, edit the system" | ||
| 276 | @@ -131,20 +131,34 @@ | ||
| 277 | NETGROUP=-DNETGROUP TLI= SYSTYPE="-systype bsd43" all | ||
| 278 | |||
| 279 | # Freebsd and linux by default have no NIS. | ||
| 280 | -386bsd netbsd bsdos: | ||
| 281 | +386bsd bsdos: | ||
| 282 | @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | ||
| 283 | LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \ | ||
| 284 | EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all | ||
| 285 | |||
| 286 | freebsd: | ||
| 287 | @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | ||
| 288 | + LIBS="-L/usr/local/v6/lib -linet6" \ | ||
| 289 | LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \ | ||
| 290 | - EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all | ||
| 291 | + EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" \ | ||
| 292 | + VSYSLOG= all | ||
| 293 | + | ||
| 294 | +netbsd: | ||
| 295 | + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | ||
| 296 | + LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \ | ||
| 297 | + EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" VSYSLOG= all | ||
| 298 | |||
| 299 | linux: | ||
| 300 | @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | ||
| 301 | - LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \ | ||
| 302 | - NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all | ||
| 303 | + LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \ | ||
| 304 | + NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \ | ||
| 305 | + EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all | ||
| 306 | + | ||
| 307 | +gnu: | ||
| 308 | + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | ||
| 309 | + LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \ | ||
| 310 | + NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \ | ||
| 311 | + EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all | ||
| 312 | |||
| 313 | # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x. | ||
| 314 | hpux hpux8 hpux9 hpux10: | ||
| 315 | @@ -196,6 +210,13 @@ | ||
| 316 | NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \ | ||
| 317 | BUGS="$(BUGS) -DSOLARIS_24_GETHOSTBYNAME_BUG" all | ||
| 318 | |||
| 319 | +# SunOS 5.8 is another SYSV4 variant, but has IPv6 support | ||
| 320 | +solaris8: | ||
| 321 | + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | ||
| 322 | + LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv VSYSLOG= \ | ||
| 323 | + NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \ | ||
| 324 | + EXTRA_CFLAGS="-DINET6 -DNO_CLONE_DEVICE -DINT32_T" all | ||
| 325 | + | ||
| 326 | # Generic SYSV40 | ||
| 327 | esix sysv4: | ||
| 328 | @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | ||
| 329 | diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c | ||
| 330 | --- tcp_wrappers_7.6.orig/misc.c 1996-02-11 17:01:30.000000000 +0100 | ||
| 331 | +++ tcp_wrappers_7.6/misc.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 332 | @@ -58,9 +58,31 @@ | ||
| 333 | { | ||
| 334 | char *cp; | ||
| 335 | |||
| 336 | +#ifdef INET6 | ||
| 337 | + int bracket = 0; | ||
| 338 | + | ||
| 339 | + for (cp = string; cp && *cp; cp++) { | ||
| 340 | + switch (*cp) { | ||
| 341 | + case '[': | ||
| 342 | + bracket++; | ||
| 343 | + break; | ||
| 344 | + case ']': | ||
| 345 | + bracket--; | ||
| 346 | + break; | ||
| 347 | + default: | ||
| 348 | + if (bracket == 0 && *cp == delimiter) { | ||
| 349 | + *cp++ = 0; | ||
| 350 | + return cp; | ||
| 351 | + } | ||
| 352 | + break; | ||
| 353 | + } | ||
| 354 | + } | ||
| 355 | + return (NULL); | ||
| 356 | +#else | ||
| 357 | if ((cp = strchr(string, delimiter)) != 0) | ||
| 358 | *cp++ = 0; | ||
| 359 | return (cp); | ||
| 360 | +#endif | ||
| 361 | } | ||
| 362 | |||
| 363 | /* dot_quad_addr - convert dotted quad to internal form */ | ||
| 364 | diff -ruN tcp_wrappers_7.6.orig/refuse.c tcp_wrappers_7.6/refuse.c | ||
| 365 | --- tcp_wrappers_7.6.orig/refuse.c 1994-12-28 17:42:40.000000000 +0100 | ||
| 366 | +++ tcp_wrappers_7.6/refuse.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 367 | @@ -25,7 +25,12 @@ | ||
| 368 | void refuse(request) | ||
| 369 | struct request_info *request; | ||
| 370 | { | ||
| 371 | +#ifdef INET6 | ||
| 372 | + syslog(deny_severity, "refused connect from %s (%s)", | ||
| 373 | + eval_client(request), eval_hostaddr(request->client)); | ||
| 374 | +#else | ||
| 375 | syslog(deny_severity, "refused connect from %s", eval_client(request)); | ||
| 376 | +#endif | ||
| 377 | clean_exit(request); | ||
| 378 | /* NOTREACHED */ | ||
| 379 | } | ||
| 380 | diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c | ||
| 381 | --- tcp_wrappers_7.6.orig/rfc931.c 1995-01-02 16:11:34.000000000 +0100 | ||
| 382 | +++ tcp_wrappers_7.6/rfc931.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 383 | @@ -68,20 +68,50 @@ | ||
| 384 | /* rfc931 - return remote user name, given socket structures */ | ||
| 385 | |||
| 386 | void rfc931(rmt_sin, our_sin, dest) | ||
| 387 | +#ifdef INET6 | ||
| 388 | +struct sockaddr *rmt_sin; | ||
| 389 | +struct sockaddr *our_sin; | ||
| 390 | +#else | ||
| 391 | struct sockaddr_in *rmt_sin; | ||
| 392 | struct sockaddr_in *our_sin; | ||
| 393 | +#endif | ||
| 394 | char *dest; | ||
| 395 | { | ||
| 396 | unsigned rmt_port; | ||
| 397 | unsigned our_port; | ||
| 398 | +#ifdef INET6 | ||
| 399 | + struct sockaddr_storage rmt_query_sin; | ||
| 400 | + struct sockaddr_storage our_query_sin; | ||
| 401 | + int alen; | ||
| 402 | +#else | ||
| 403 | struct sockaddr_in rmt_query_sin; | ||
| 404 | struct sockaddr_in our_query_sin; | ||
| 405 | +#endif | ||
| 406 | char user[256]; /* XXX */ | ||
| 407 | char buffer[512]; /* XXX */ | ||
| 408 | char *cp; | ||
| 409 | char *result = unknown; | ||
| 410 | FILE *fp; | ||
| 411 | |||
| 412 | +#ifdef INET6 | ||
| 413 | + /* address family must be the same */ | ||
| 414 | + if (rmt_sin->sa_family != our_sin->sa_family) { | ||
| 415 | + STRN_CPY(dest, result, STRING_LENGTH); | ||
| 416 | + return; | ||
| 417 | + } | ||
| 418 | + switch (our_sin->sa_family) { | ||
| 419 | + case AF_INET: | ||
| 420 | + alen = sizeof(struct sockaddr_in); | ||
| 421 | + break; | ||
| 422 | + case AF_INET6: | ||
| 423 | + alen = sizeof(struct sockaddr_in6); | ||
| 424 | + break; | ||
| 425 | + default: | ||
| 426 | + STRN_CPY(dest, result, STRING_LENGTH); | ||
| 427 | + return; | ||
| 428 | + } | ||
| 429 | +#endif | ||
| 430 | + | ||
| 431 | /* | ||
| 432 | * Use one unbuffered stdio stream for writing to and for reading from | ||
| 433 | * the RFC931 etc. server. This is done because of a bug in the SunOS | ||
| 434 | @@ -92,7 +122,11 @@ | ||
| 435 | * sockets. | ||
| 436 | */ | ||
| 437 | |||
| 438 | +#ifdef INET6 | ||
| 439 | + if ((fp = fsocket(our_sin->sa_family, SOCK_STREAM, 0)) != 0) { | ||
| 440 | +#else | ||
| 441 | if ((fp = fsocket(AF_INET, SOCK_STREAM, 0)) != 0) { | ||
| 442 | +#endif | ||
| 443 | setbuf(fp, (char *) 0); | ||
| 444 | |||
| 445 | /* | ||
| 446 | @@ -112,6 +146,25 @@ | ||
| 447 | * addresses from the query socket. | ||
| 448 | */ | ||
| 449 | |||
| 450 | +#ifdef INET6 | ||
| 451 | + memcpy(&our_query_sin, our_sin, alen); | ||
| 452 | + memcpy(&rmt_query_sin, rmt_sin, alen); | ||
| 453 | + switch (our_sin->sa_family) { | ||
| 454 | + case AF_INET: | ||
| 455 | + ((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT); | ||
| 456 | + ((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC931_PORT); | ||
| 457 | + break; | ||
| 458 | + case AF_INET6: | ||
| 459 | + ((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT); | ||
| 460 | + ((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC931_PORT); | ||
| 461 | + break; | ||
| 462 | + } | ||
| 463 | + | ||
| 464 | + if (bind(fileno(fp), (struct sockaddr *) & our_query_sin, | ||
| 465 | + alen) >= 0 && | ||
| 466 | + connect(fileno(fp), (struct sockaddr *) & rmt_query_sin, | ||
| 467 | + alen) >= 0) { | ||
| 468 | +#else | ||
| 469 | our_query_sin = *our_sin; | ||
| 470 | our_query_sin.sin_port = htons(ANY_PORT); | ||
| 471 | rmt_query_sin = *rmt_sin; | ||
| 472 | @@ -121,6 +174,7 @@ | ||
| 473 | sizeof(our_query_sin)) >= 0 && | ||
| 474 | connect(fileno(fp), (struct sockaddr *) & rmt_query_sin, | ||
| 475 | sizeof(rmt_query_sin)) >= 0) { | ||
| 476 | +#endif | ||
| 477 | |||
| 478 | /* | ||
| 479 | * Send query to server. Neglect the risk that a 13-byte | ||
| 480 | @@ -129,8 +183,13 @@ | ||
| 481 | */ | ||
| 482 | |||
| 483 | fprintf(fp, "%u,%u\r\n", | ||
| 484 | +#ifdef INET6 | ||
| 485 | + ntohs(((struct sockaddr_in *)rmt_sin)->sin_port), | ||
| 486 | + ntohs(((struct sockaddr_in *)our_sin)->sin_port)); | ||
| 487 | +#else | ||
| 488 | ntohs(rmt_sin->sin_port), | ||
| 489 | ntohs(our_sin->sin_port)); | ||
| 490 | +#endif | ||
| 491 | fflush(fp); | ||
| 492 | |||
| 493 | /* | ||
| 494 | @@ -144,8 +203,13 @@ | ||
| 495 | && ferror(fp) == 0 && feof(fp) == 0 | ||
| 496 | && sscanf(buffer, "%u , %u : USERID :%*[^:]:%255s", | ||
| 497 | &rmt_port, &our_port, user) == 3 | ||
| 498 | +#ifdef INET6 | ||
| 499 | + && ntohs(((struct sockaddr_in *)rmt_sin)->sin_port) == rmt_port | ||
| 500 | + && ntohs(((struct sockaddr_in *)our_sin)->sin_port) == our_port) { | ||
| 501 | +#else | ||
| 502 | && ntohs(rmt_sin->sin_port) == rmt_port | ||
| 503 | && ntohs(our_sin->sin_port) == our_port) { | ||
| 504 | +#endif | ||
| 505 | |||
| 506 | /* | ||
| 507 | * Strip trailing carriage return. It is part of the | ||
| 508 | diff -ruN tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c | ||
| 509 | --- tcp_wrappers_7.6.orig/scaffold.c 1997-03-21 19:27:24.000000000 +0100 | ||
| 510 | +++ tcp_wrappers_7.6/scaffold.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 511 | @@ -25,7 +25,9 @@ | ||
| 512 | #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ | ||
| 513 | #endif | ||
| 514 | |||
| 515 | +#ifndef INET6 | ||
| 516 | extern char *malloc(); | ||
| 517 | +#endif | ||
| 518 | |||
| 519 | /* Application-specific. */ | ||
| 520 | |||
| 521 | @@ -39,6 +41,7 @@ | ||
| 522 | int deny_severity = LOG_WARNING; | ||
| 523 | int rfc931_timeout = RFC931_TIMEOUT; | ||
| 524 | |||
| 525 | +#ifndef INET6 | ||
| 526 | /* dup_hostent - create hostent in one memory block */ | ||
| 527 | |||
| 528 | static struct hostent *dup_hostent(hp) | ||
| 529 | @@ -73,9 +76,46 @@ | ||
| 530 | } | ||
| 531 | return (&hb->host); | ||
| 532 | } | ||
| 533 | +#endif | ||
| 534 | |||
| 535 | /* find_inet_addr - find all addresses for this host, result to free() */ | ||
| 536 | |||
| 537 | +#ifdef INET6 | ||
| 538 | +struct addrinfo *find_inet_addr(host) | ||
| 539 | +char *host; | ||
| 540 | +{ | ||
| 541 | + struct addrinfo hints, *res; | ||
| 542 | + | ||
| 543 | + memset(&hints, 0, sizeof(hints)); | ||
| 544 | + hints.ai_family = PF_UNSPEC; | ||
| 545 | + hints.ai_socktype = SOCK_STREAM; | ||
| 546 | + hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; | ||
| 547 | + if (getaddrinfo(host, NULL, &hints, &res) == 0) | ||
| 548 | + return (res); | ||
| 549 | + | ||
| 550 | + memset(&hints, 0, sizeof(hints)); | ||
| 551 | + hints.ai_family = PF_UNSPEC; | ||
| 552 | + hints.ai_socktype = SOCK_STREAM; | ||
| 553 | + hints.ai_flags = AI_PASSIVE | AI_CANONNAME; | ||
| 554 | + if (getaddrinfo(host, NULL, &hints, &res) != 0) { | ||
| 555 | + tcpd_warn("%s: host not found", host); | ||
| 556 | + return (0); | ||
| 557 | + } | ||
| 558 | + if (res->ai_family != AF_INET6 && res->ai_family != AF_INET) { | ||
| 559 | + tcpd_warn("%d: not an internet host", res->ai_family); | ||
| 560 | + freeaddrinfo(res); | ||
| 561 | + return (0); | ||
| 562 | + } | ||
| 563 | + if (!res->ai_canonname) { | ||
| 564 | + tcpd_warn("%s: hostname alias", host); | ||
| 565 | + tcpd_warn("(cannot obtain official name)", res->ai_canonname); | ||
| 566 | + } else if (STR_NE(host, res->ai_canonname)) { | ||
| 567 | + tcpd_warn("%s: hostname alias", host); | ||
| 568 | + tcpd_warn("(official name: %.*s)", STRING_LENGTH, res->ai_canonname); | ||
| 569 | + } | ||
| 570 | + return (res); | ||
| 571 | +} | ||
| 572 | +#else | ||
| 573 | struct hostent *find_inet_addr(host) | ||
| 574 | char *host; | ||
| 575 | { | ||
| 576 | @@ -118,6 +158,7 @@ | ||
| 577 | } | ||
| 578 | return (dup_hostent(hp)); | ||
| 579 | } | ||
| 580 | +#endif | ||
| 581 | |||
| 582 | /* check_dns - give each address thorough workout, return address count */ | ||
| 583 | |||
| 584 | @@ -125,8 +166,13 @@ | ||
| 585 | char *host; | ||
| 586 | { | ||
| 587 | struct request_info request; | ||
| 588 | +#ifdef INET6 | ||
| 589 | + struct sockaddr_storage sin; | ||
| 590 | + struct addrinfo *hp, *res; | ||
| 591 | +#else | ||
| 592 | struct sockaddr_in sin; | ||
| 593 | struct hostent *hp; | ||
| 594 | +#endif | ||
| 595 | int count; | ||
| 596 | char *addr; | ||
| 597 | |||
| 598 | @@ -134,11 +180,18 @@ | ||
| 599 | return (0); | ||
| 600 | request_init(&request, RQ_CLIENT_SIN, &sin, 0); | ||
| 601 | sock_methods(&request); | ||
| 602 | +#ifndef INET6 | ||
| 603 | memset((char *) &sin, 0, sizeof(sin)); | ||
| 604 | sin.sin_family = AF_INET; | ||
| 605 | +#endif | ||
| 606 | |||
| 607 | +#ifdef INET6 | ||
| 608 | + for (res = hp, count = 0; res; res = res->ai_next, count++) { | ||
| 609 | + memcpy(&sin, res->ai_addr, res->ai_addrlen); | ||
| 610 | +#else | ||
| 611 | for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) { | ||
| 612 | memcpy((char *) &sin.sin_addr, addr, sizeof(sin.sin_addr)); | ||
| 613 | +#endif | ||
| 614 | |||
| 615 | /* | ||
| 616 | * Force host name and address conversions. Use the request structure | ||
| 617 | @@ -151,7 +204,11 @@ | ||
| 618 | tcpd_warn("host address %s->name lookup failed", | ||
| 619 | eval_hostaddr(request.client)); | ||
| 620 | } | ||
| 621 | +#ifdef INET6 | ||
| 622 | + freeaddrinfo(hp); | ||
| 623 | +#else | ||
| 624 | free((char *) hp); | ||
| 625 | +#endif | ||
| 626 | return (count); | ||
| 627 | } | ||
| 628 | |||
| 629 | diff -ruN tcp_wrappers_7.6.orig/scaffold.h tcp_wrappers_7.6/scaffold.h | ||
| 630 | --- tcp_wrappers_7.6.orig/scaffold.h 1994-12-31 18:19:20.000000000 +0100 | ||
| 631 | +++ tcp_wrappers_7.6/scaffold.h 2004-04-10 19:07:43.000000000 +0200 | ||
| 632 | @@ -4,6 +4,10 @@ | ||
| 633 | * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. | ||
| 634 | */ | ||
| 635 | |||
| 636 | +#ifdef INET6 | ||
| 637 | +extern struct addrinfo *find_inet_addr(); | ||
| 638 | +#else | ||
| 639 | extern struct hostent *find_inet_addr(); | ||
| 640 | +#endif | ||
| 641 | extern int check_dns(); | ||
| 642 | extern int check_path(); | ||
| 643 | diff -ruN tcp_wrappers_7.6.orig/socket.c tcp_wrappers_7.6/socket.c | ||
| 644 | --- tcp_wrappers_7.6.orig/socket.c 2004-04-10 19:22:58.000000000 +0200 | ||
| 645 | +++ tcp_wrappers_7.6/socket.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 646 | @@ -24,13 +24,22 @@ | ||
| 647 | #include <sys/types.h> | ||
| 648 | #include <sys/param.h> | ||
| 649 | #include <sys/socket.h> | ||
| 650 | +#ifdef INT32_T | ||
| 651 | +typedef uint32_t u_int32_t; | ||
| 652 | +#endif | ||
| 653 | #include <netinet/in.h> | ||
| 654 | #include <netdb.h> | ||
| 655 | #include <stdio.h> | ||
| 656 | #include <syslog.h> | ||
| 657 | #include <string.h> | ||
| 658 | |||
| 659 | +#ifdef INET6 | ||
| 660 | +#ifndef NI_WITHSCOPEID | ||
| 661 | +#define NI_WITHSCOPEID 0 | ||
| 662 | +#endif | ||
| 663 | +#else | ||
| 664 | extern char *inet_ntoa(); | ||
| 665 | +#endif | ||
| 666 | |||
| 667 | /* Local stuff. */ | ||
| 668 | |||
| 669 | @@ -79,8 +88,13 @@ | ||
| 670 | void sock_host(request) | ||
| 671 | struct request_info *request; | ||
| 672 | { | ||
| 673 | +#ifdef INET6 | ||
| 674 | + static struct sockaddr_storage client; | ||
| 675 | + static struct sockaddr_storage server; | ||
| 676 | +#else | ||
| 677 | static struct sockaddr_in client; | ||
| 678 | static struct sockaddr_in server; | ||
| 679 | +#endif | ||
| 680 | int len; | ||
| 681 | char buf[BUFSIZ]; | ||
| 682 | int fd = request->fd; | ||
| 683 | @@ -109,7 +123,11 @@ | ||
| 684 | memset(buf, 0 sizeof(buf)); | ||
| 685 | #endif | ||
| 686 | } | ||
| 687 | +#ifdef INET6 | ||
| 688 | + request->client->sin = (struct sockaddr *)&client; | ||
| 689 | +#else | ||
| 690 | request->client->sin = &client; | ||
| 691 | +#endif | ||
| 692 | |||
| 693 | /* | ||
| 694 | * Determine the server binding. This is used for client username | ||
| 695 | @@ -122,7 +140,11 @@ | ||
| 696 | tcpd_warn("getsockname: %m"); | ||
| 697 | return; | ||
| 698 | } | ||
| 699 | +#ifdef INET6 | ||
| 700 | + request->server->sin = (struct sockaddr *)&server; | ||
| 701 | +#else | ||
| 702 | request->server->sin = &server; | ||
| 703 | +#endif | ||
| 704 | } | ||
| 705 | |||
| 706 | /* sock_hostaddr - map endpoint address to printable form */ | ||
| 707 | @@ -130,10 +152,26 @@ | ||
| 708 | void sock_hostaddr(host) | ||
| 709 | struct host_info *host; | ||
| 710 | { | ||
| 711 | +#ifdef INET6 | ||
| 712 | + struct sockaddr *sin = host->sin; | ||
| 713 | + int salen; | ||
| 714 | + | ||
| 715 | + if (!sin) | ||
| 716 | + return; | ||
| 717 | +#ifdef SIN6_LEN | ||
| 718 | + salen = sin->sa_len; | ||
| 719 | +#else | ||
| 720 | + salen = (sin->sa_family == AF_INET) ? sizeof(struct sockaddr_in) | ||
| 721 | + : sizeof(struct sockaddr_in6); | ||
| 722 | +#endif | ||
| 723 | + getnameinfo(sin, salen, host->addr, sizeof(host->addr), | ||
| 724 | + NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); | ||
| 725 | +#else | ||
| 726 | struct sockaddr_in *sin = host->sin; | ||
| 727 | |||
| 728 | if (sin != 0) | ||
| 729 | STRN_CPY(host->addr, inet_ntoa(sin->sin_addr), sizeof(host->addr)); | ||
| 730 | +#endif | ||
| 731 | } | ||
| 732 | |||
| 733 | /* sock_hostname - map endpoint address to host name */ | ||
| 734 | @@ -141,6 +179,160 @@ | ||
| 735 | void sock_hostname(host) | ||
| 736 | struct host_info *host; | ||
| 737 | { | ||
| 738 | +#ifdef INET6 | ||
| 739 | + struct sockaddr *sin = host->sin; | ||
| 740 | + struct sockaddr_in sin4; | ||
| 741 | + struct addrinfo hints, *res, *res0 = NULL; | ||
| 742 | + int salen, alen, err = 1; | ||
| 743 | + char *ap = NULL, *rap, hname[NI_MAXHOST]; | ||
| 744 | + | ||
| 745 | + if (sin != NULL) { | ||
| 746 | + if (sin->sa_family == AF_INET6) { | ||
| 747 | + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sin; | ||
| 748 | + | ||
| 749 | + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { | ||
| 750 | + memset(&sin4, 0, sizeof(sin4)); | ||
| 751 | +#ifdef SIN6_LEN | ||
| 752 | + sin4.sin_len = sizeof(sin4); | ||
| 753 | +#endif | ||
| 754 | + sin4.sin_family = AF_INET; | ||
| 755 | + sin4.sin_port = sin6->sin6_port; | ||
| 756 | + sin4.sin_addr.s_addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; | ||
| 757 | + sin = (struct sockaddr *)&sin4; | ||
| 758 | + } | ||
| 759 | + } | ||
| 760 | + switch (sin->sa_family) { | ||
| 761 | + case AF_INET: | ||
| 762 | + ap = (char *)&((struct sockaddr_in *)sin)->sin_addr; | ||
| 763 | + alen = sizeof(struct in_addr); | ||
| 764 | + salen = sizeof(struct sockaddr_in); | ||
| 765 | + break; | ||
| 766 | + case AF_INET6: | ||
| 767 | + ap = (char *)&((struct sockaddr_in6 *)sin)->sin6_addr; | ||
| 768 | + alen = sizeof(struct in6_addr); | ||
| 769 | + salen = sizeof(struct sockaddr_in6); | ||
| 770 | + break; | ||
| 771 | + default: | ||
| 772 | + break; | ||
| 773 | + } | ||
| 774 | + if (ap) | ||
| 775 | + err = getnameinfo(sin, salen, hname, sizeof(hname), | ||
| 776 | + NULL, 0, NI_WITHSCOPEID | NI_NAMEREQD); | ||
| 777 | + } | ||
| 778 | + if (!err) { | ||
| 779 | + | ||
| 780 | + STRN_CPY(host->name, hname, sizeof(host->name)); | ||
| 781 | + | ||
| 782 | + /* reject numeric addresses */ | ||
| 783 | + memset(&hints, 0, sizeof(hints)); | ||
| 784 | + hints.ai_family = sin->sa_family; | ||
| 785 | + hints.ai_socktype = SOCK_STREAM; | ||
| 786 | + hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST; | ||
| 787 | + if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) { | ||
| 788 | + freeaddrinfo(res0); | ||
| 789 | + res0 = NULL; | ||
| 790 | + tcpd_warn("host name/name mismatch: " | ||
| 791 | + "reverse lookup results in non-FQDN %s", | ||
| 792 | + host->name); | ||
| 793 | + strcpy(host->name, paranoid); /* name is bad, clobber it */ | ||
| 794 | + } | ||
| 795 | + err = !err; | ||
| 796 | + } | ||
| 797 | + if (!err) { | ||
| 798 | + /* we are now sure that this is non-numeric */ | ||
| 799 | + | ||
| 800 | + /* | ||
| 801 | + * Verify that the address is a member of the address list returned | ||
| 802 | + * by gethostbyname(hostname). | ||
| 803 | + * | ||
| 804 | + * Verify also that gethostbyaddr() and gethostbyname() return the same | ||
| 805 | + * hostname, or rshd and rlogind may still end up being spoofed. | ||
| 806 | + * | ||
| 807 | + * On some sites, gethostbyname("localhost") returns "localhost.domain". | ||
| 808 | + * This is a DNS artefact. We treat it as a special case. When we | ||
| 809 | + * can't believe the address list from gethostbyname("localhost") | ||
| 810 | + * we're in big trouble anyway. | ||
| 811 | + */ | ||
| 812 | + | ||
| 813 | + memset(&hints, 0, sizeof(hints)); | ||
| 814 | + hints.ai_family = sin->sa_family; | ||
| 815 | + hints.ai_socktype = SOCK_STREAM; | ||
| 816 | + hints.ai_flags = AI_PASSIVE | AI_CANONNAME; | ||
| 817 | + if (getaddrinfo(host->name, NULL, &hints, &res0) != 0) { | ||
| 818 | + | ||
| 819 | + /* | ||
| 820 | + * Unable to verify that the host name matches the address. This | ||
| 821 | + * may be a transient problem or a botched name server setup. | ||
| 822 | + */ | ||
| 823 | + | ||
| 824 | + tcpd_warn("can't verify hostname: getaddrinfo(%s, %s) failed", | ||
| 825 | + host->name, | ||
| 826 | + (sin->sa_family == AF_INET) ? "AF_INET" : "AF_INET6"); | ||
| 827 | + | ||
| 828 | + } else if ((res0->ai_canonname == NULL | ||
| 829 | + || STR_NE(host->name, res0->ai_canonname)) | ||
| 830 | + && STR_NE(host->name, "localhost")) { | ||
| 831 | + | ||
| 832 | + /* | ||
| 833 | + * The gethostbyaddr() and gethostbyname() calls did not return | ||
| 834 | + * the same hostname. This could be a nameserver configuration | ||
| 835 | + * problem. It could also be that someone is trying to spoof us. | ||
| 836 | + */ | ||
| 837 | + | ||
| 838 | + tcpd_warn("host name/name mismatch: %s != %.*s", | ||
| 839 | + host->name, STRING_LENGTH, | ||
| 840 | + (res0->ai_canonname == NULL) ? "" : res0->ai_canonname); | ||
| 841 | + | ||
| 842 | + } else { | ||
| 843 | + | ||
| 844 | + /* | ||
| 845 | + * The address should be a member of the address list returned by | ||
| 846 | + * gethostbyname(). We should first verify that the h_addrtype | ||
| 847 | + * field is AF_INET, but this program has already caused too much | ||
| 848 | + * grief on systems with broken library code. | ||
| 849 | + */ | ||
| 850 | + | ||
| 851 | + for (res = res0; res; res = res->ai_next) { | ||
| 852 | + if (res->ai_family != sin->sa_family) | ||
| 853 | + continue; | ||
| 854 | + switch (res->ai_family) { | ||
| 855 | + case AF_INET: | ||
| 856 | + rap = (char *)&((struct sockaddr_in *)res->ai_addr)->sin_addr; | ||
| 857 | + break; | ||
| 858 | + case AF_INET6: | ||
| 859 | + /* need to check scope_id */ | ||
| 860 | + if (((struct sockaddr_in6 *)sin)->sin6_scope_id != | ||
| 861 | + ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id) { | ||
| 862 | + continue; | ||
| 863 | + } | ||
| 864 | + rap = (char *)&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; | ||
| 865 | + break; | ||
| 866 | + default: | ||
| 867 | + continue; | ||
| 868 | + } | ||
| 869 | + if (memcmp(rap, ap, alen) == 0) { | ||
| 870 | + freeaddrinfo(res0); | ||
| 871 | + return; /* name is good, keep it */ | ||
| 872 | + } | ||
| 873 | + } | ||
| 874 | + | ||
| 875 | + /* | ||
| 876 | + * The host name does not map to the initial address. Perhaps | ||
| 877 | + * someone has messed up. Perhaps someone compromised a name | ||
| 878 | + * server. | ||
| 879 | + */ | ||
| 880 | + | ||
| 881 | + getnameinfo(sin, salen, hname, sizeof(hname), | ||
| 882 | + NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); | ||
| 883 | + tcpd_warn("host name/address mismatch: %s != %.*s", | ||
| 884 | + hname, STRING_LENGTH, | ||
| 885 | + (res0->ai_canonname == NULL) ? "" : res0->ai_canonname); | ||
| 886 | + } | ||
| 887 | + strcpy(host->name, paranoid); /* name is bad, clobber it */ | ||
| 888 | + if (res0) | ||
| 889 | + freeaddrinfo(res0); | ||
| 890 | + } | ||
| 891 | +#else /* INET6 */ | ||
| 892 | struct sockaddr_in *sin = host->sin; | ||
| 893 | struct hostent *hp; | ||
| 894 | int i; | ||
| 895 | @@ -220,6 +412,7 @@ | ||
| 896 | } | ||
| 897 | strcpy(host->name, paranoid); /* name is bad, clobber it */ | ||
| 898 | } | ||
| 899 | +#endif /* INET6 */ | ||
| 900 | } | ||
| 901 | |||
| 902 | /* sock_sink - absorb unreceived IP datagram */ | ||
| 903 | @@ -228,7 +421,11 @@ | ||
| 904 | int fd; | ||
| 905 | { | ||
| 906 | char buf[BUFSIZ]; | ||
| 907 | +#ifdef INET6 | ||
| 908 | + struct sockaddr_storage sin; | ||
| 909 | +#else | ||
| 910 | struct sockaddr_in sin; | ||
| 911 | +#endif | ||
| 912 | int size = sizeof(sin); | ||
| 913 | |||
| 914 | /* | ||
| 915 | diff -ruN tcp_wrappers_7.6.orig/tcpd.c tcp_wrappers_7.6/tcpd.c | ||
| 916 | --- tcp_wrappers_7.6.orig/tcpd.c 1996-02-11 17:01:33.000000000 +0100 | ||
| 917 | +++ tcp_wrappers_7.6/tcpd.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 918 | @@ -120,7 +120,12 @@ | ||
| 919 | |||
| 920 | /* Report request and invoke the real daemon program. */ | ||
| 921 | |||
| 922 | +#ifdef INET6 | ||
| 923 | + syslog(allow_severity, "connect from %s (%s)", | ||
| 924 | + eval_client(&request), eval_hostaddr(request.client)); | ||
| 925 | +#else | ||
| 926 | syslog(allow_severity, "connect from %s", eval_client(&request)); | ||
| 927 | +#endif | ||
| 928 | closelog(); | ||
| 929 | (void) execv(path, argv); | ||
| 930 | syslog(LOG_ERR, "error: cannot execute %s: %m", path); | ||
| 931 | diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c | ||
| 932 | --- tcp_wrappers_7.6.orig/tcpdchk.c 1997-02-12 02:13:25.000000000 +0100 | ||
| 933 | +++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 934 | @@ -22,6 +22,9 @@ | ||
| 935 | |||
| 936 | #include <sys/types.h> | ||
| 937 | #include <sys/stat.h> | ||
| 938 | +#ifdef INET6 | ||
| 939 | +#include <sys/socket.h> | ||
| 940 | +#endif | ||
| 941 | #include <netinet/in.h> | ||
| 942 | #include <arpa/inet.h> | ||
| 943 | #include <stdio.h> | ||
| 944 | @@ -397,6 +400,31 @@ | ||
| 945 | } | ||
| 946 | } | ||
| 947 | |||
| 948 | +#ifdef INET6 | ||
| 949 | +static int is_inet6_addr(pat) | ||
| 950 | + char *pat; | ||
| 951 | +{ | ||
| 952 | + struct addrinfo hints, *res; | ||
| 953 | + int len, ret; | ||
| 954 | + char ch; | ||
| 955 | + | ||
| 956 | + if (*pat != '[') | ||
| 957 | + return (0); | ||
| 958 | + len = strlen(pat); | ||
| 959 | + if ((ch = pat[len - 1]) != ']') | ||
| 960 | + return (0); | ||
| 961 | + pat[len - 1] = '\0'; | ||
| 962 | + memset(&hints, 0, sizeof(hints)); | ||
| 963 | + hints.ai_family = AF_INET6; | ||
| 964 | + hints.ai_socktype = SOCK_STREAM; | ||
| 965 | + hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; | ||
| 966 | + if ((ret = getaddrinfo(pat + 1, NULL, &hints, &res)) == 0) | ||
| 967 | + freeaddrinfo(res); | ||
| 968 | + pat[len - 1] = ch; | ||
| 969 | + return (ret == 0); | ||
| 970 | +} | ||
| 971 | +#endif | ||
| 972 | + | ||
| 973 | /* check_host - criticize host pattern */ | ||
| 974 | |||
| 975 | static int check_host(pat) | ||
| 976 | @@ -423,14 +451,27 @@ | ||
| 977 | #endif | ||
| 978 | #endif | ||
| 979 | } else if (mask = split_at(pat, '/')) { /* network/netmask */ | ||
| 980 | +#ifdef INET6 | ||
| 981 | + int mask_len; | ||
| 982 | + | ||
| 983 | + if ((dot_quad_addr(pat) == INADDR_NONE | ||
| 984 | + || dot_quad_addr(mask) == INADDR_NONE) | ||
| 985 | + && (!is_inet6_addr(pat) | ||
| 986 | + || ((mask_len = atoi(mask)) < 0 || mask_len > 128))) | ||
| 987 | +#else | ||
| 988 | if (dot_quad_addr(pat) == INADDR_NONE | ||
| 989 | || dot_quad_addr(mask) == INADDR_NONE) | ||
| 990 | +#endif | ||
| 991 | tcpd_warn("%s/%s: bad net/mask pattern", pat, mask); | ||
| 992 | } else if (STR_EQ(pat, "FAIL")) { /* obsolete */ | ||
| 993 | tcpd_warn("FAIL is no longer recognized"); | ||
| 994 | tcpd_warn("(use EXCEPT or DENY instead)"); | ||
| 995 | } else if (reserved_name(pat)) { /* other reserved */ | ||
| 996 | /* void */ ; | ||
| 997 | +#ifdef INET6 | ||
| 998 | + } else if (is_inet6_addr(pat)) { /* IPv6 address */ | ||
| 999 | + addr_count = 1; | ||
| 1000 | +#endif | ||
| 1001 | } else if (NOT_INADDR(pat)) { /* internet name */ | ||
| 1002 | if (pat[strlen(pat) - 1] == '.') { | ||
| 1003 | tcpd_warn("%s: domain or host name ends in dot", pat); | ||
| 1004 | diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h | ||
| 1005 | --- tcp_wrappers_7.6.orig/tcpd.h 1996-03-19 16:22:25.000000000 +0100 | ||
| 1006 | +++ tcp_wrappers_7.6/tcpd.h 2004-04-10 19:07:43.000000000 +0200 | ||
| 1007 | @@ -11,7 +11,11 @@ | ||
| 1008 | struct host_info { | ||
| 1009 | char name[STRING_LENGTH]; /* access via eval_hostname(host) */ | ||
| 1010 | char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */ | ||
| 1011 | +#ifdef INET6 | ||
| 1012 | + struct sockaddr *sin; /* socket address or 0 */ | ||
| 1013 | +#else | ||
| 1014 | struct sockaddr_in *sin; /* socket address or 0 */ | ||
| 1015 | +#endif | ||
| 1016 | struct t_unitdata *unit; /* TLI transport address or 0 */ | ||
| 1017 | struct request_info *request; /* for shared information */ | ||
| 1018 | }; | ||
| 1019 | diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.c tcp_wrappers_7.6/tcpdmatch.c | ||
| 1020 | --- tcp_wrappers_7.6.orig/tcpdmatch.c 1996-02-11 17:01:36.000000000 +0100 | ||
| 1021 | +++ tcp_wrappers_7.6/tcpdmatch.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 1022 | @@ -57,7 +57,11 @@ | ||
| 1023 | int argc; | ||
| 1024 | char **argv; | ||
| 1025 | { | ||
| 1026 | +#ifdef INET6 | ||
| 1027 | + struct addrinfo hints, *hp, *res; | ||
| 1028 | +#else | ||
| 1029 | struct hostent *hp; | ||
| 1030 | +#endif | ||
| 1031 | char *myname = argv[0]; | ||
| 1032 | char *client; | ||
| 1033 | char *server; | ||
| 1034 | @@ -68,8 +72,13 @@ | ||
| 1035 | int ch; | ||
| 1036 | char *inetcf = 0; | ||
| 1037 | int count; | ||
| 1038 | +#ifdef INET6 | ||
| 1039 | + struct sockaddr_storage server_sin; | ||
| 1040 | + struct sockaddr_storage client_sin; | ||
| 1041 | +#else | ||
| 1042 | struct sockaddr_in server_sin; | ||
| 1043 | struct sockaddr_in client_sin; | ||
| 1044 | +#endif | ||
| 1045 | struct stat st; | ||
| 1046 | |||
| 1047 | /* | ||
| 1048 | @@ -172,13 +181,20 @@ | ||
| 1049 | if (NOT_INADDR(server) == 0 || HOSTNAME_KNOWN(server)) { | ||
| 1050 | if ((hp = find_inet_addr(server)) == 0) | ||
| 1051 | exit(1); | ||
| 1052 | +#ifndef INET6 | ||
| 1053 | memset((char *) &server_sin, 0, sizeof(server_sin)); | ||
| 1054 | server_sin.sin_family = AF_INET; | ||
| 1055 | +#endif | ||
| 1056 | request_set(&request, RQ_SERVER_SIN, &server_sin, 0); | ||
| 1057 | |||
| 1058 | +#ifdef INET6 | ||
| 1059 | + for (res = hp, count = 0; res; res = res->ai_next, count++) { | ||
| 1060 | + memcpy(&server_sin, res->ai_addr, res->ai_addrlen); | ||
| 1061 | +#else | ||
| 1062 | for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) { | ||
| 1063 | memcpy((char *) &server_sin.sin_addr, addr, | ||
| 1064 | sizeof(server_sin.sin_addr)); | ||
| 1065 | +#endif | ||
| 1066 | |||
| 1067 | /* | ||
| 1068 | * Force evaluation of server host name and address. Host name | ||
| 1069 | @@ -194,7 +210,11 @@ | ||
| 1070 | fprintf(stderr, "Please specify an address instead\n"); | ||
| 1071 | exit(1); | ||
| 1072 | } | ||
| 1073 | +#ifdef INET6 | ||
| 1074 | + freeaddrinfo(hp); | ||
| 1075 | +#else | ||
| 1076 | free((char *) hp); | ||
| 1077 | +#endif | ||
| 1078 | } else { | ||
| 1079 | request_set(&request, RQ_SERVER_NAME, server, 0); | ||
| 1080 | } | ||
| 1081 | @@ -208,6 +228,18 @@ | ||
| 1082 | tcpdmatch(&request); | ||
| 1083 | exit(0); | ||
| 1084 | } | ||
| 1085 | +#ifdef INET6 | ||
| 1086 | + memset(&hints, 0, sizeof(hints)); | ||
| 1087 | + hints.ai_family = AF_INET6; | ||
| 1088 | + hints.ai_socktype = SOCK_STREAM; | ||
| 1089 | + hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; | ||
| 1090 | + if (getaddrinfo(client, NULL, &hints, &res) == 0) { | ||
| 1091 | + freeaddrinfo(res); | ||
| 1092 | + request_set(&request, RQ_CLIENT_ADDR, client, 0); | ||
| 1093 | + tcpdmatch(&request); | ||
| 1094 | + exit(0); | ||
| 1095 | + } | ||
| 1096 | +#endif | ||
| 1097 | |||
| 1098 | /* | ||
| 1099 | * Perhaps they are testing special client hostname patterns that aren't | ||
| 1100 | @@ -229,6 +261,34 @@ | ||
| 1101 | */ | ||
| 1102 | if ((hp = find_inet_addr(client)) == 0) | ||
| 1103 | exit(1); | ||
| 1104 | +#ifdef INET6 | ||
| 1105 | + request_set(&request, RQ_CLIENT_SIN, &client_sin, 0); | ||
| 1106 | + | ||
| 1107 | + for (res = hp, count = 0; res; res = res->ai_next, count++) { | ||
| 1108 | + memcpy(&client_sin, res->ai_addr, res->ai_addrlen); | ||
| 1109 | + | ||
| 1110 | + /* | ||
| 1111 | + * getnameinfo() doesn't do reverse lookup against link-local | ||
| 1112 | + * address. So, we pass through host name evaluation against | ||
| 1113 | + * such addresses. | ||
| 1114 | + */ | ||
| 1115 | + if (res->ai_family != AF_INET6 || | ||
| 1116 | + !IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr)) { | ||
| 1117 | + /* | ||
| 1118 | + * Force evaluation of client host name and address. Host name | ||
| 1119 | + * conflicts will be reported while eval_hostname() does its job. | ||
| 1120 | + */ | ||
| 1121 | + request_set(&request, RQ_CLIENT_NAME, "", RQ_CLIENT_ADDR, "", 0); | ||
| 1122 | + if (STR_EQ(eval_hostname(request.client), unknown)) | ||
| 1123 | + tcpd_warn("host address %s->name lookup failed", | ||
| 1124 | + eval_hostaddr(request.client)); | ||
| 1125 | + } | ||
| 1126 | + tcpdmatch(&request); | ||
| 1127 | + if (res->ai_next) | ||
| 1128 | + printf("\n"); | ||
| 1129 | + } | ||
| 1130 | + freeaddrinfo(hp); | ||
| 1131 | +#else | ||
| 1132 | memset((char *) &client_sin, 0, sizeof(client_sin)); | ||
| 1133 | client_sin.sin_family = AF_INET; | ||
| 1134 | request_set(&request, RQ_CLIENT_SIN, &client_sin, 0); | ||
| 1135 | @@ -250,6 +310,7 @@ | ||
| 1136 | printf("\n"); | ||
| 1137 | } | ||
| 1138 | free((char *) hp); | ||
| 1139 | +#endif | ||
| 1140 | exit(0); | ||
| 1141 | } | ||
| 1142 | |||
| 1143 | diff -ruN tcp_wrappers_7.6.orig/tli.c tcp_wrappers_7.6/tli.c | ||
| 1144 | --- tcp_wrappers_7.6.orig/tli.c 1997-03-21 19:27:26.000000000 +0100 | ||
| 1145 | +++ tcp_wrappers_7.6/tli.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 1146 | @@ -65,8 +65,13 @@ | ||
| 1147 | void tli_host(request) | ||
| 1148 | struct request_info *request; | ||
| 1149 | { | ||
| 1150 | +#ifdef INET6 | ||
| 1151 | + static struct sockaddr_storage client; | ||
| 1152 | + static struct sockaddr_storage server; | ||
| 1153 | +#else | ||
| 1154 | static struct sockaddr_in client; | ||
| 1155 | static struct sockaddr_in server; | ||
| 1156 | +#endif | ||
| 1157 | |||
| 1158 | /* | ||
| 1159 | * If we discover that we are using an IP transport, pretend we never | ||
| 1160 | @@ -76,14 +81,29 @@ | ||
| 1161 | |||
| 1162 | tli_endpoints(request); | ||
| 1163 | if ((request->config = tli_transport(request->fd)) != 0 | ||
| 1164 | +#ifdef INET6 | ||
| 1165 | + && (STR_EQ(request->config->nc_protofmly, "inet") || | ||
| 1166 | + STR_EQ(request->config->nc_protofmly, "inet6"))) { | ||
| 1167 | +#else | ||
| 1168 | && STR_EQ(request->config->nc_protofmly, "inet")) { | ||
| 1169 | +#endif | ||
| 1170 | if (request->client->unit != 0) { | ||
| 1171 | +#ifdef INET6 | ||
| 1172 | + client = *(struct sockaddr_storage *) request->client->unit->addr.buf; | ||
| 1173 | + request->client->sin = (struct sockaddr *) &client; | ||
| 1174 | +#else | ||
| 1175 | client = *(struct sockaddr_in *) request->client->unit->addr.buf; | ||
| 1176 | request->client->sin = &client; | ||
| 1177 | +#endif | ||
| 1178 | } | ||
| 1179 | if (request->server->unit != 0) { | ||
| 1180 | +#ifdef INET6 | ||
| 1181 | + server = *(struct sockaddr_storage *) request->server->unit->addr.buf; | ||
| 1182 | + request->server->sin = (struct sockaddr *) &server; | ||
| 1183 | +#else | ||
| 1184 | server = *(struct sockaddr_in *) request->server->unit->addr.buf; | ||
| 1185 | request->server->sin = &server; | ||
| 1186 | +#endif | ||
| 1187 | } | ||
| 1188 | tli_cleanup(request); | ||
| 1189 | sock_methods(request); | ||
| 1190 | @@ -187,7 +207,15 @@ | ||
| 1191 | } | ||
| 1192 | while (config = getnetconfig(handlep)) { | ||
| 1193 | if (stat(config->nc_device, &from_config) == 0) { | ||
| 1194 | +#ifdef NO_CLONE_DEVICE | ||
| 1195 | + /* | ||
| 1196 | + * If the network devices are not cloned (as is the case for | ||
| 1197 | + * Solaris 8 Beta), we must compare the major device numbers. | ||
| 1198 | + */ | ||
| 1199 | + if (major(from_config.st_rdev) == major(from_client.st_rdev)) | ||
| 1200 | +#else | ||
| 1201 | if (minor(from_config.st_rdev) == major(from_client.st_rdev)) | ||
| 1202 | +#endif | ||
| 1203 | break; | ||
| 1204 | } | ||
| 1205 | } | ||
| 1206 | diff -ruN tcp_wrappers_7.6.orig/update.c tcp_wrappers_7.6/update.c | ||
| 1207 | --- tcp_wrappers_7.6.orig/update.c 1994-12-28 17:42:56.000000000 +0100 | ||
| 1208 | +++ tcp_wrappers_7.6/update.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 1209 | @@ -46,10 +46,18 @@ | ||
| 1210 | request->fd = va_arg(ap, int); | ||
| 1211 | continue; | ||
| 1212 | case RQ_CLIENT_SIN: | ||
| 1213 | +#ifdef INET6 | ||
| 1214 | + request->client->sin = va_arg(ap, struct sockaddr *); | ||
| 1215 | +#else | ||
| 1216 | request->client->sin = va_arg(ap, struct sockaddr_in *); | ||
| 1217 | +#endif | ||
| 1218 | continue; | ||
| 1219 | case RQ_SERVER_SIN: | ||
| 1220 | +#ifdef INET6 | ||
| 1221 | + request->server->sin = va_arg(ap, struct sockaddr *); | ||
| 1222 | +#else | ||
| 1223 | request->server->sin = va_arg(ap, struct sockaddr_in *); | ||
| 1224 | +#endif | ||
| 1225 | continue; | ||
| 1226 | |||
| 1227 | /* | ||
| 1228 | diff -ruN tcp_wrappers_7.6.orig/workarounds.c tcp_wrappers_7.6/workarounds.c | ||
| 1229 | --- tcp_wrappers_7.6.orig/workarounds.c 1996-03-19 16:22:26.000000000 +0100 | ||
| 1230 | +++ tcp_wrappers_7.6/workarounds.c 2004-04-10 19:07:43.000000000 +0200 | ||
| 1231 | @@ -166,11 +166,22 @@ | ||
| 1232 | int *len; | ||
| 1233 | { | ||
| 1234 | int ret; | ||
| 1235 | +#ifdef INET6 | ||
| 1236 | + struct sockaddr *sin = sa; | ||
| 1237 | +#else | ||
| 1238 | struct sockaddr_in *sin = (struct sockaddr_in *) sa; | ||
| 1239 | +#endif | ||
| 1240 | |||
| 1241 | if ((ret = getpeername(sock, sa, len)) >= 0 | ||
| 1242 | +#ifdef INET6 | ||
| 1243 | + && ((sin->su_si.si_family == AF_INET6 | ||
| 1244 | + && IN6_IS_ADDR_UNSPECIFIED(&sin->su_sin6.sin6_addr)) | ||
| 1245 | + || (sin->su_si.si_family == AF_INET | ||
| 1246 | + && sin->su_sin.sin_addr.s_addr == 0))) { | ||
| 1247 | +#else | ||
| 1248 | && sa->sa_family == AF_INET | ||
| 1249 | && sin->sin_addr.s_addr == 0) { | ||
| 1250 | +#endif | ||
| 1251 | errno = ENOTCONN; | ||
| 1252 | return (-1); | ||
| 1253 | } 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 @@ | |||
| 1 | Path: news.porcupine.org!news.porcupine.org!not-for-mail | ||
| 2 | From: Wietse Venema <wietse@((no)(spam)(please))wzv.win.tue.nl> | ||
| 3 | Newsgroups: comp.mail.sendmail,comp.security.unix | ||
| 4 | Subject: TCP Wrapper Blacklist Extension | ||
| 5 | Followup-To: poster | ||
| 6 | Date: 8 Sep 1997 18:53:13 -0400 | ||
| 7 | Organization: Wietse's hangout while on sabattical in the USA | ||
| 8 | Lines: 147 | ||
| 9 | Sender: wietse@spike.porcupine.org | ||
| 10 | Message-ID: <5v1vkp$h4f$1@spike.porcupine.org> | ||
| 11 | NNTP-Posting-Host: spike.porcupine.org | ||
| 12 | Xref: news.porcupine.org comp.mail.sendmail:3541 comp.security.unix:7158 | ||
| 13 | |||
| 14 | The patch below adds a new host pattern to the TCP Wrapper access | ||
| 15 | control language. Instead of a host name or address pattern, you | ||
| 16 | can specify an external /file/name with host name or address | ||
| 17 | patterns. The feature can be used recursively. | ||
| 18 | |||
| 19 | The /file/name extension makes it easy to blacklist bad sites, for | ||
| 20 | example, to block unwanted electronic mail when libwrap is linked | ||
| 21 | into sendmail. Adding hosts to a simple text file is much easier | ||
| 22 | than having to edit a more complex hosts.allow/deny file. | ||
| 23 | |||
| 24 | I developed this a year or so ago as a substitute for NIS netgroups. | ||
| 25 | At that time, I did not consider it of sufficient interest for | ||
| 26 | inclusion in the TCP Wrapper distribution. How times have changed. | ||
| 27 | |||
| 28 | The patch is relative to TCP Wrappers version 7.6. The main archive | ||
| 29 | site is ftp://ftp.win.tue.nl/pub/security/tcp_wrappers_7.6.tar.gz | ||
| 30 | |||
| 31 | Thanks to the Debian LINUX folks for expressing their interest in | ||
| 32 | this patch. | ||
| 33 | |||
| 34 | Wietse | ||
| 35 | |||
| 36 | |||
| 37 | [diff updated by Md] | ||
| 38 | |||
| 39 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 | ||
| 40 | --- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:28:09.000000000 +0200 | ||
| 41 | +++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:28:01.000000000 +0200 | ||
| 42 | @@ -97,6 +97,13 @@ | ||
| 43 | `[3ffe:505:2:1::]/64\' matches every address in the range | ||
| 44 | `3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'. | ||
| 45 | .IP \(bu | ||
| 46 | +A string that begins with a `/\' character is treated as a file | ||
| 47 | +name. A host name or address is matched if it matches any host name | ||
| 48 | +or address pattern listed in the named file. The file format is | ||
| 49 | +zero or more lines with zero or more host name or address patterns | ||
| 50 | +separated by whitespace. A file name pattern can be used anywhere | ||
| 51 | +a host name or address pattern can be used. | ||
| 52 | +.IP \(bu | ||
| 53 | Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This | ||
| 54 | method of matching cannot be used in conjunction with `net/mask\' matching, | ||
| 55 | hostname matching beginning with `.\' or IP address matching ending with `.\'. | ||
| 56 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c | ||
| 57 | --- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:28:09.000000000 +0200 | ||
| 58 | +++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:27:05.000000000 +0200 | ||
| 59 | @@ -253,6 +253,26 @@ | ||
| 60 | } | ||
| 61 | } | ||
| 62 | |||
| 63 | +/* hostfile_match - look up host patterns from file */ | ||
| 64 | + | ||
| 65 | +static int hostfile_match(path, host) | ||
| 66 | +char *path; | ||
| 67 | +struct hosts_info *host; | ||
| 68 | +{ | ||
| 69 | + char tok[BUFSIZ]; | ||
| 70 | + int match = NO; | ||
| 71 | + FILE *fp; | ||
| 72 | + | ||
| 73 | + if ((fp = fopen(path, "r")) != 0) { | ||
| 74 | + while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host))) | ||
| 75 | + /* void */ ; | ||
| 76 | + fclose(fp); | ||
| 77 | + } else if (errno != ENOENT) { | ||
| 78 | + tcpd_warn("open %s: %m", path); | ||
| 79 | + } | ||
| 80 | + return (match); | ||
| 81 | +} | ||
| 82 | + | ||
| 83 | /* host_match - match host name and/or address against pattern */ | ||
| 84 | |||
| 85 | static int host_match(tok, host) | ||
| 86 | @@ -280,6 +300,8 @@ | ||
| 87 | tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */ | ||
| 88 | return (NO); | ||
| 89 | #endif | ||
| 90 | + } else if (tok[0] == '/') { /* /file hack */ | ||
| 91 | + return (hostfile_match(tok, host)); | ||
| 92 | } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */ | ||
| 93 | char *name = eval_hostname(host); | ||
| 94 | return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name)); | ||
| 95 | diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c | ||
| 96 | --- tcp_wrappers_7.6.orig/tcpdchk.c 2004-04-10 19:28:09.000000000 +0200 | ||
| 97 | +++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:27:05.000000000 +0200 | ||
| 98 | @@ -353,6 +353,8 @@ | ||
| 99 | { | ||
| 100 | if (pat[0] == '@') { | ||
| 101 | tcpd_warn("%s: daemon name begins with \"@\"", pat); | ||
| 102 | + } else if (pat[0] == '/') { | ||
| 103 | + tcpd_warn("%s: daemon name begins with \"/\"", pat); | ||
| 104 | } else if (pat[0] == '.') { | ||
| 105 | tcpd_warn("%s: daemon name begins with dot", pat); | ||
| 106 | } else if (pat[strlen(pat) - 1] == '.') { | ||
| 107 | @@ -385,6 +387,8 @@ | ||
| 108 | { | ||
| 109 | if (pat[0] == '@') { /* @netgroup */ | ||
| 110 | tcpd_warn("%s: user name begins with \"@\"", pat); | ||
| 111 | + } else if (pat[0] == '/') { | ||
| 112 | + tcpd_warn("%s: user name begins with \"/\"", pat); | ||
| 113 | } else if (pat[0] == '.') { | ||
| 114 | tcpd_warn("%s: user name begins with dot", pat); | ||
| 115 | } else if (pat[strlen(pat) - 1] == '.') { | ||
| 116 | @@ -430,8 +434,13 @@ | ||
| 117 | static int check_host(pat) | ||
| 118 | char *pat; | ||
| 119 | { | ||
| 120 | + char buf[BUFSIZ]; | ||
| 121 | char *mask; | ||
| 122 | int addr_count = 1; | ||
| 123 | + FILE *fp; | ||
| 124 | + struct tcpd_context saved_context; | ||
| 125 | + char *cp; | ||
| 126 | + char *wsp = " \t\r\n"; | ||
| 127 | |||
| 128 | if (pat[0] == '@') { /* @netgroup */ | ||
| 129 | #ifdef NO_NETGRENT | ||
| 130 | @@ -450,6 +459,21 @@ | ||
| 131 | tcpd_warn("netgroup support disabled"); | ||
| 132 | #endif | ||
| 133 | #endif | ||
| 134 | + } else if (pat[0] == '/') { /* /path/name */ | ||
| 135 | + if ((fp = fopen(pat, "r")) != 0) { | ||
| 136 | + saved_context = tcpd_context; | ||
| 137 | + tcpd_context.file = pat; | ||
| 138 | + tcpd_context.line = 0; | ||
| 139 | + while (fgets(buf, sizeof(buf), fp)) { | ||
| 140 | + tcpd_context.line++; | ||
| 141 | + for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp)) | ||
| 142 | + check_host(cp); | ||
| 143 | + } | ||
| 144 | + tcpd_context = saved_context; | ||
| 145 | + fclose(fp); | ||
| 146 | + } else if (errno != ENOENT) { | ||
| 147 | + tcpd_warn("open %s: %m", pat); | ||
| 148 | + } | ||
| 149 | } else if (mask = split_at(pat, '/')) { /* network/netmask */ | ||
| 150 | #ifdef INET6 | ||
| 151 | 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 @@ | |||
| 1 | diff -uN tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.new/hosts_access.c | ||
| 2 | --- tcp_wrappers_7.6/hosts_access.c Mon May 20 14:00:56 2002 | ||
| 3 | +++ tcp_wrappers_7.6.new/hosts_access.c Mon May 20 14:25:05 2002 | ||
| 4 | @@ -448,6 +448,15 @@ | ||
| 5 | int len, mask_len, i = 0; | ||
| 6 | char ch; | ||
| 7 | |||
| 8 | + /* | ||
| 9 | + * Behavior of getaddrinfo() against IPv4-mapped IPv6 address is | ||
| 10 | + * different between KAME and Solaris8. While KAME returns | ||
| 11 | + * AF_INET6, Solaris8 returns AF_INET. So, we avoid this here. | ||
| 12 | + */ | ||
| 13 | + if (STRN_EQ(string, "::ffff:", 7) | ||
| 14 | + && dot_quad_addr(string + 7) != INADDR_NONE) | ||
| 15 | + return (masked_match4(net_tok, mask_tok, string + 7)); | ||
| 16 | + | ||
| 17 | memset(&hints, 0, sizeof(hints)); | ||
| 18 | hints.ai_family = AF_INET6; | ||
| 19 | hints.ai_socktype = SOCK_STREAM; | ||
| 20 | @@ -457,13 +466,6 @@ | ||
| 21 | memcpy(&addr, res->ai_addr, sizeof(addr)); | ||
| 22 | freeaddrinfo(res); | ||
| 23 | |||
| 24 | - if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) { | ||
| 25 | - if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE | ||
| 26 | - || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) | ||
| 27 | - return (NO); | ||
| 28 | - return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]); | ||
| 29 | - } | ||
| 30 | - | ||
| 31 | /* match IPv6 address against netnumber/prefixlen */ | ||
| 32 | len = strlen(net_tok); | ||
| 33 | if (*net_tok != '[' || net_tok[len - 1] != ']') | ||
| 34 | diff -uN tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.new/socket.c | ||
| 35 | --- tcp_wrappers_7.6/socket.c Mon May 20 13:48:35 2002 | ||
| 36 | +++ tcp_wrappers_7.6.new/socket.c Mon May 20 14:22:27 2002 | ||
| 37 | @@ -228,7 +228,7 @@ | ||
| 38 | hints.ai_family = sin->sa_family; | ||
| 39 | hints.ai_socktype = SOCK_STREAM; | ||
| 40 | hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST; | ||
| 41 | - if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) { | ||
| 42 | + if ((err = getaddrinfo(host->name, NULL, &hints, &res0)) == 0) { | ||
| 43 | freeaddrinfo(res0); | ||
| 44 | res0 = NULL; | ||
| 45 | 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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile | ||
| 2 | --- tcp_wrappers_7.6.orig/Makefile 2003-08-21 01:43:39.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/Makefile 2003-08-21 01:43:35.000000000 +0200 | ||
| 4 | @@ -45,7 +45,7 @@ | ||
| 5 | # | ||
| 6 | # SysV.4 Solaris 2.x OSF AIX | ||
| 7 | #REAL_DAEMON_DIR=/usr/sbin | ||
| 8 | -# | ||
| 9 | +REAL_DAEMON_DIR=/usr/sbin | ||
| 10 | # BSD 4.4 | ||
| 11 | #REAL_DAEMON_DIR=/usr/libexec | ||
| 12 | # | ||
| 13 | @@ -512,6 +519,7 @@ | ||
| 14 | # (examples: allow, deny, banners, twist and spawn). | ||
| 15 | # | ||
| 16 | #STYLE = -DPROCESS_OPTIONS # Enable language extensions. | ||
| 17 | +STYLE = -DPROCESS_OPTIONS | ||
| 18 | |||
| 19 | ################################################################ | ||
| 20 | # Optional: Changing the default disposition of logfile records | ||
| 21 | @@ -535,6 +543,7 @@ | ||
| 22 | # The LOG_XXX names below are taken from the /usr/include/syslog.h file. | ||
| 23 | |||
| 24 | FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use | ||
| 25 | +FACILITY= LOG_DAEMON | ||
| 26 | |||
| 27 | # The syslog priority at which successful connections are logged. | ||
| 28 | |||
| 29 | @@ -631,6 +640,7 @@ | ||
| 30 | # lookups altogether, see the next section. | ||
| 31 | |||
| 32 | PARANOID= -DPARANOID | ||
| 33 | +PARANOID= | ||
| 34 | |||
| 35 | ######################################## | ||
| 36 | # Optional: turning off hostname lookups | ||
| 37 | @@ -644,6 +654,7 @@ | ||
| 38 | # mode (see previous section) and comment out the following definition. | ||
| 39 | |||
| 40 | HOSTNAME= -DALWAYS_HOSTNAME | ||
| 41 | +HOSTNAME= | ||
| 42 | |||
| 43 | ############################################# | ||
| 44 | # Optional: Turning on host ADDRESS checking | ||
| 45 | @@ -670,6 +681,7 @@ | ||
| 46 | # Solaris 2.x, and Linux. See your system documentation for details. | ||
| 47 | # | ||
| 48 | # KILL_OPT= -DKILL_IP_OPTIONS | ||
| 49 | +KILL_OPT= -DKILL_IP_OPTIONS | ||
| 50 | |||
| 51 | ## End configuration options | ||
| 52 | ############################ | ||
| 53 | @@ -677,9 +689,10 @@ | ||
| 54 | # Protection against weird shells or weird make programs. | ||
| 55 | |||
| 56 | SHELL = /bin/sh | ||
| 57 | -.c.o:; $(CC) $(CFLAGS) -c $*.c | ||
| 58 | +.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c | ||
| 59 | |||
| 60 | -CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ | ||
| 61 | +COPTS = -O2 -g | ||
| 62 | +CFLAGS = $(COPTS) -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ | ||
| 63 | $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \ | ||
| 64 | -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \ | ||
| 65 | -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ | ||
| 66 | @@ -712,10 +725,11 @@ | ||
| 67 | |||
| 68 | config-check: | ||
| 69 | @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; } | ||
| 70 | - @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \ | ||
| 71 | - if cmp cflags /tmp/cflags.$$$$ ; \ | ||
| 72 | - then rm /tmp/cflags.$$$$ ; \ | ||
| 73 | - else mv /tmp/cflags.$$$$ cflags ; \ | ||
| 74 | + @set +e; echo $(CFLAGS) >cflags.new ; \ | ||
| 75 | + if cmp cflags cflags.new ; \ | ||
| 76 | + then rm cflags.new ; \ | ||
| 77 | + else mv cflags.new cflags ; \ | ||
| 78 | fi >/dev/null 2>/dev/null | ||
| 79 | + @if [ ! -d shared ]; then mkdir shared; fi | ||
| 80 | |||
| 81 | $(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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile | ||
| 2 | --- tcp_wrappers_7.6.orig/Makefile 2004-05-02 15:37:59.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/Makefile 2004-05-02 15:31:09.000000000 +0200 | ||
| 4 | @@ -150,15 +150,15 @@ | ||
| 5 | |||
| 6 | linux: | ||
| 7 | @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | ||
| 8 | - LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \ | ||
| 9 | + LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ | ||
| 10 | NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \ | ||
| 11 | - EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all | ||
| 12 | + EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all | ||
| 13 | |||
| 14 | gnu: | ||
| 15 | @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | ||
| 16 | - LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \ | ||
| 17 | + LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ | ||
| 18 | NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \ | ||
| 19 | - EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all | ||
| 20 | + EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" all | ||
| 21 | |||
| 22 | # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x. | ||
| 23 | hpux hpux8 hpux9 hpux10: | ||
| 24 | @@ -713,7 +713,22 @@ | ||
| 25 | |||
| 26 | LIB = libwrap.a | ||
| 27 | |||
| 28 | -all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk | ||
| 29 | +shared/%.o: %.c | ||
| 30 | + $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@ | ||
| 31 | + | ||
| 32 | +SOMAJOR = 0 | ||
| 33 | +SOMINOR = 7.6 | ||
| 34 | + | ||
| 35 | +SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR) | ||
| 36 | +SHLIBSOMAJ = shared/libwrap.so.$(SOMAJOR) | ||
| 37 | +SHLIBSO = shared/libwrap.so | ||
| 38 | +SHLIBFLAGS = -Lshared -lwrap | ||
| 39 | + | ||
| 40 | +SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS) | ||
| 41 | +SHCFLAGS = -fPIC -shared -D_REENTRANT | ||
| 42 | +SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ)); | ||
| 43 | + | ||
| 44 | +all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB) | ||
| 45 | |||
| 46 | # Invalidate all object files when the compiler options (CFLAGS) have changed. | ||
| 47 | |||
| 48 | @@ -731,27 +746,33 @@ | ||
| 49 | $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ) | ||
| 50 | -$(RANLIB) $(LIB) | ||
| 51 | |||
| 52 | -tcpd: tcpd.o $(LIB) | ||
| 53 | - $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS) | ||
| 54 | +$(SHLIB): $(SHLIB_OBJ) | ||
| 55 | + rm -f $(SHLIB) | ||
| 56 | + $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) | ||
| 57 | + ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ) | ||
| 58 | + ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO) | ||
| 59 | + | ||
| 60 | +tcpd: tcpd.o $(SHLIB) | ||
| 61 | + $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS) | ||
| 62 | |||
| 63 | miscd: miscd.o $(LIB) | ||
| 64 | $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS) | ||
| 65 | |||
| 66 | -safe_finger: safe_finger.o $(LIB) | ||
| 67 | - $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS) | ||
| 68 | +safe_finger: safe_finger.o $(SHLIB) | ||
| 69 | + $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS) | ||
| 70 | |||
| 71 | TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o | ||
| 72 | |||
| 73 | -tcpdmatch: $(TCPDMATCH_OBJ) $(LIB) | ||
| 74 | - $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS) | ||
| 75 | +tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB) | ||
| 76 | + $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS) | ||
| 77 | |||
| 78 | -try-from: try-from.o fakelog.o $(LIB) | ||
| 79 | - $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS) | ||
| 80 | +try-from: try-from.o fakelog.o $(SHLIB) | ||
| 81 | + $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS) | ||
| 82 | |||
| 83 | TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o | ||
| 84 | |||
| 85 | -tcpdchk: $(TCPDCHK_OBJ) $(LIB) | ||
| 86 | - $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS) | ||
| 87 | +tcpdchk: $(TCPDCHK_OBJ) $(SHLIB) | ||
| 88 | + $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS) | ||
| 89 | |||
| 90 | shar: $(KIT) | ||
| 91 | @shar $(KIT) | ||
| 92 | @@ -767,7 +788,9 @@ | ||
| 93 | |||
| 94 | clean: | ||
| 95 | rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \ | ||
| 96 | + libwrap*.so* \ | ||
| 97 | cflags | ||
| 98 | + rm -rf shared/ | ||
| 99 | |||
| 100 | tidy: clean | ||
| 101 | chmod -R a+r . | ||
| 102 | @@ -913,5 +936,6 @@ | ||
| 103 | update.o: mystdarg.h | ||
| 104 | update.o: tcpd.h | ||
| 105 | vfprintf.o: cflags | ||
| 106 | +weak_symbols.o: tcpd.h | ||
| 107 | workarounds.o: cflags | ||
| 108 | workarounds.o: tcpd.h | ||
| 109 | diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h | ||
| 110 | --- tcp_wrappers_7.6.orig/tcpd.h 2004-05-02 15:37:59.000000000 +0200 | ||
| 111 | +++ tcp_wrappers_7.6/tcpd.h 2004-05-02 15:37:49.000000000 +0200 | ||
| 112 | @@ -4,6 +4,15 @@ | ||
| 113 | * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. | ||
| 114 | */ | ||
| 115 | |||
| 116 | +#ifndef _TCPWRAPPERS_TCPD_H | ||
| 117 | +#define _TCPWRAPPERS_TCPD_H | ||
| 118 | + | ||
| 119 | +/* Need definitions of struct sockaddr_in and FILE. */ | ||
| 120 | +#include <netinet/in.h> | ||
| 121 | +#include <stdio.h> | ||
| 122 | + | ||
| 123 | +__BEGIN_DECLS | ||
| 124 | + | ||
| 125 | /* Structure to describe one communications endpoint. */ | ||
| 126 | |||
| 127 | #define STRING_LENGTH 128 /* hosts, users, processes */ | ||
| 128 | @@ -29,10 +38,10 @@ | ||
| 129 | char pid[10]; /* access via eval_pid(request) */ | ||
| 130 | struct host_info client[1]; /* client endpoint info */ | ||
| 131 | struct host_info server[1]; /* server endpoint info */ | ||
| 132 | - void (*sink) (); /* datagram sink function or 0 */ | ||
| 133 | - void (*hostname) (); /* address to printable hostname */ | ||
| 134 | - void (*hostaddr) (); /* address to printable address */ | ||
| 135 | - void (*cleanup) (); /* cleanup function or 0 */ | ||
| 136 | + void (*sink) (int); /* datagram sink function or 0 */ | ||
| 137 | + void (*hostname) (struct host_info *); /* address to printable hostname */ | ||
| 138 | + void (*hostaddr) (struct host_info *); /* address to printable address */ | ||
| 139 | + void (*cleanup) (struct request_info *); /* cleanup function or 0 */ | ||
| 140 | struct netconfig *config; /* netdir handle */ | ||
| 141 | }; | ||
| 142 | |||
| 143 | @@ -70,20 +79,27 @@ | ||
| 144 | #define fromhost sock_host /* no TLI support needed */ | ||
| 145 | #endif | ||
| 146 | |||
| 147 | -extern int hosts_access(); /* access control */ | ||
| 148 | -extern void shell_cmd(); /* execute shell command */ | ||
| 149 | -extern char *percent_x(); /* do %<char> expansion */ | ||
| 150 | -extern void rfc931(); /* client name from RFC 931 daemon */ | ||
| 151 | -extern void clean_exit(); /* clean up and exit */ | ||
| 152 | -extern void refuse(); /* clean up and exit */ | ||
| 153 | -extern char *xgets(); /* fgets() on steroids */ | ||
| 154 | -extern char *split_at(); /* strchr() and split */ | ||
| 155 | -extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ | ||
| 156 | +extern int hosts_access(struct request_info *request); /* access control */ | ||
| 157 | +extern void shell_cmd(char *); /* execute shell command */ | ||
| 158 | +extern char *percent_x(char *, int, char *, struct request_info *); | ||
| 159 | + /* do %<char> expansion */ | ||
| 160 | +extern void rfc931(struct sockaddr *, struct sockaddr *, char *); | ||
| 161 | + /* client name from RFC 931 daemon */ | ||
| 162 | +extern void clean_exit(struct request_info *); /* clean up and exit */ | ||
| 163 | +extern void refuse(struct request_info *); /* clean up and exit */ | ||
| 164 | +extern char *xgets(char *, int, FILE *); /* fgets() on steroids */ | ||
| 165 | +extern char *split_at(char *, int); /* strchr() and split */ | ||
| 166 | +extern unsigned long dot_quad_addr(char *); /* restricted inet_addr() */ | ||
| 167 | |||
| 168 | /* Global variables. */ | ||
| 169 | |||
| 170 | +#ifdef HAVE_WEAKSYMS | ||
| 171 | +extern int allow_severity __attribute__ ((weak)); /* for connection logging */ | ||
| 172 | +extern int deny_severity __attribute__ ((weak)); /* for connection logging */ | ||
| 173 | +#else | ||
| 174 | extern int allow_severity; /* for connection logging */ | ||
| 175 | extern int deny_severity; /* for connection logging */ | ||
| 176 | +#endif | ||
| 177 | extern char *hosts_allow_table; /* for verification mode redirection */ | ||
| 178 | extern char *hosts_deny_table; /* for verification mode redirection */ | ||
| 179 | extern int hosts_access_verbose; /* for verbose matching mode */ | ||
| 180 | @@ -98,6 +114,8 @@ | ||
| 181 | #ifdef __STDC__ | ||
| 182 | extern struct request_info *request_init(struct request_info *,...); | ||
| 183 | extern struct request_info *request_set(struct request_info *,...); | ||
| 184 | +extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, | ||
| 185 | + char *client_user); | ||
| 186 | #else | ||
| 187 | extern struct request_info *request_init(); /* initialize request */ | ||
| 188 | extern struct request_info *request_set(); /* update request structure */ | ||
| 189 | @@ -121,20 +139,23 @@ | ||
| 190 | * host_info structures serve as caches for the lookup results. | ||
| 191 | */ | ||
| 192 | |||
| 193 | -extern char *eval_user(); /* client user */ | ||
| 194 | -extern char *eval_hostname(); /* printable hostname */ | ||
| 195 | -extern char *eval_hostaddr(); /* printable host address */ | ||
| 196 | -extern char *eval_hostinfo(); /* host name or address */ | ||
| 197 | -extern char *eval_client(); /* whatever is available */ | ||
| 198 | -extern char *eval_server(); /* whatever is available */ | ||
| 199 | +extern char *eval_user(struct request_info *); /* client user */ | ||
| 200 | +extern char *eval_hostname(struct host_info *); /* printable hostname */ | ||
| 201 | +extern char *eval_hostaddr(struct host_info *); /* printable host address */ | ||
| 202 | +extern char *eval_hostinfo(struct host_info *); /* host name or address */ | ||
| 203 | +extern char *eval_client(struct request_info *);/* whatever is available */ | ||
| 204 | +extern char *eval_server(struct request_info *);/* whatever is available */ | ||
| 205 | #define eval_daemon(r) ((r)->daemon) /* daemon process name */ | ||
| 206 | #define eval_pid(r) ((r)->pid) /* process id */ | ||
| 207 | |||
| 208 | /* Socket-specific methods, including DNS hostname lookups. */ | ||
| 209 | |||
| 210 | -extern void sock_host(); /* look up endpoint addresses */ | ||
| 211 | -extern void sock_hostname(); /* translate address to hostname */ | ||
| 212 | -extern void sock_hostaddr(); /* address to printable address */ | ||
| 213 | +/* look up endpoint addresses */ | ||
| 214 | +extern void sock_host(struct request_info *); | ||
| 215 | +/* translate address to hostname */ | ||
| 216 | +extern void sock_hostname(struct host_info *); | ||
| 217 | +/* address to printable address */ | ||
| 218 | +extern void sock_hostaddr(struct host_info *); | ||
| 219 | #define sock_methods(r) \ | ||
| 220 | { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } | ||
| 221 | |||
| 222 | @@ -182,7 +203,7 @@ | ||
| 223 | * behavior. | ||
| 224 | */ | ||
| 225 | |||
| 226 | -extern void process_options(); /* execute options */ | ||
| 227 | +extern void process_options(char *, struct request_info *);/* execute options */ | ||
| 228 | extern int dry_run; /* verification flag */ | ||
| 229 | |||
| 230 | /* Bug workarounds. */ | ||
| 231 | @@ -221,3 +242,7 @@ | ||
| 232 | #define strtok my_strtok | ||
| 233 | extern char *my_strtok(); | ||
| 234 | #endif | ||
| 235 | + | ||
| 236 | +__END_DECLS | ||
| 237 | + | ||
| 238 | +#endif | ||
| 239 | diff -ruN tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c | ||
| 240 | --- tcp_wrappers_7.6.orig/weak_symbols.c 1970-01-01 01:00:00.000000000 +0100 | ||
| 241 | +++ tcp_wrappers_7.6/weak_symbols.c 2004-05-02 15:31:09.000000000 +0200 | ||
| 242 | @@ -0,0 +1,11 @@ | ||
| 243 | + /* | ||
| 244 | + * @(#) weak_symbols.h 1.5 99/12/29 23:50 | ||
| 245 | + * | ||
| 246 | + * Author: Anthony Towns <ajt@debian.org> | ||
| 247 | + */ | ||
| 248 | + | ||
| 249 | +#ifdef HAVE_WEAKSYMS | ||
| 250 | +#include <syslog.h> | ||
| 251 | +int deny_severity = LOG_WARNING; | ||
| 252 | +int allow_severity = SEVERITY; | ||
| 253 | +#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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 | ||
| 2 | --- tcp_wrappers_7.6.orig/hosts_access.5 2003-08-21 03:15:36.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/hosts_access.5 2003-08-21 03:15:31.000000000 +0200 | ||
| 4 | @@ -90,6 +90,10 @@ | ||
| 5 | pattern `131.155.72.0/255.255.254.0\' matches every address in the | ||
| 6 | range `131.155.72.0\' through `131.155.73.255\'. | ||
| 7 | .IP \(bu | ||
| 8 | +An expression of the form `n.n.n.n/mm' is interpreted as a | ||
| 9 | +`net/masklength' pair, where `mm' is the number of consecutive `1' | ||
| 10 | +bits in the netmask applied to the `n.n.n.n' address. | ||
| 11 | +.IP \(bu | ||
| 12 | An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a | ||
| 13 | `[net]/prefixlen\' pair. An IPv6 host address is matched if | ||
| 14 | `prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the | ||
| 15 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c | ||
| 16 | --- tcp_wrappers_7.6.orig/hosts_access.c 2003-08-21 03:15:36.000000000 +0200 | ||
| 17 | +++ tcp_wrappers_7.6/hosts_access.c 2003-08-21 03:09:30.000000000 +0200 | ||
| 18 | @@ -417,7 +417,8 @@ | ||
| 19 | if ((addr = dot_quad_addr(string)) == INADDR_NONE) | ||
| 20 | return (NO); | ||
| 21 | if ((net = dot_quad_addr(net_tok)) == INADDR_NONE | ||
| 22 | - || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) { | ||
| 23 | + || ((mask = dot_quad_addr(mask_tok)) == INADDR_NONE | ||
| 24 | + && (mask = cidr_mask_addr(mask_tok)) == 0)) { | ||
| 25 | #ifndef INET6 | ||
| 26 | tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok); | ||
| 27 | #endif | ||
| 28 | diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c | ||
| 29 | --- tcp_wrappers_7.6.orig/misc.c 2003-08-21 03:15:36.000000000 +0200 | ||
| 30 | +++ tcp_wrappers_7.6/misc.c 2003-08-21 03:09:30.000000000 +0200 | ||
| 31 | @@ -107,3 +107,17 @@ | ||
| 32 | } | ||
| 33 | return (runs == 4 ? inet_addr(str) : INADDR_NONE); | ||
| 34 | } | ||
| 35 | + | ||
| 36 | +/* cidr_mask_addr - convert cidr netmask length to internal form */ | ||
| 37 | + | ||
| 38 | +unsigned long cidr_mask_addr(str) | ||
| 39 | +char *str; | ||
| 40 | +{ | ||
| 41 | + int maskbits; | ||
| 42 | + | ||
| 43 | + maskbits = atoi(str); | ||
| 44 | + if (maskbits < 1 || maskbits > 32) | ||
| 45 | + return (0); | ||
| 46 | + return htonl(0xFFFFFFFF << (32 - maskbits)); | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c | ||
| 50 | --- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 03:15:36.000000000 +0200 | ||
| 51 | +++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 03:09:30.000000000 +0200 | ||
| 52 | @@ -497,12 +497,12 @@ | ||
| 53 | int mask_len; | ||
| 54 | |||
| 55 | if ((dot_quad_addr(pat) == INADDR_NONE | ||
| 56 | - || dot_quad_addr(mask) == INADDR_NONE) | ||
| 57 | + || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0) | ||
| 58 | && (!is_inet6_addr(pat) | ||
| 59 | || ((mask_len = atoi(mask)) < 0 || mask_len > 128))) | ||
| 60 | #else | ||
| 61 | if (dot_quad_addr(pat) == INADDR_NONE | ||
| 62 | - || dot_quad_addr(mask) == INADDR_NONE) | ||
| 63 | + || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0) | ||
| 64 | #endif | ||
| 65 | tcpd_warn("%s/%s: bad net/mask pattern", pat, mask); | ||
| 66 | } 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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 | ||
| 2 | --- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-25 12:17:59.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/hosts_access.5 2004-04-25 12:17:53.000000000 +0200 | ||
| 4 | @@ -89,6 +89,8 @@ | ||
| 5 | bitwise AND of the address and the `mask\'. For example, the net/mask | ||
| 6 | pattern `131.155.72.0/255.255.254.0\' matches every address in the | ||
| 7 | range `131.155.72.0\' through `131.155.73.255\'. | ||
| 8 | +`255.255.255.255\' is not a valid mask value, so a single host can be | ||
| 9 | +matched just by its IP. | ||
| 10 | .IP \(bu | ||
| 11 | An expression of the form `n.n.n.n/mm' is interpreted as a | ||
| 12 | `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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/eval.c tcp_wrappers_7.6/eval.c | ||
| 2 | --- tcp_wrappers_7.6.orig/eval.c 1995-01-30 19:51:46.000000000 +0100 | ||
| 3 | +++ tcp_wrappers_7.6/eval.c 2004-11-04 13:59:01.000000000 +0100 | ||
| 4 | @@ -98,6 +98,28 @@ | ||
| 5 | } | ||
| 6 | } | ||
| 7 | |||
| 8 | +/* eval_port - return string with the port */ | ||
| 9 | +char *eval_port(saddr) | ||
| 10 | +#ifdef INET6 | ||
| 11 | +struct sockaddr *saddr; | ||
| 12 | +#else | ||
| 13 | +struct sockaddr_in *saddr; | ||
| 14 | +#endif | ||
| 15 | +{ | ||
| 16 | + static char port[16]; | ||
| 17 | + if (saddr != 0) { | ||
| 18 | + sprintf(port, "%u", | ||
| 19 | +#ifdef INET6 | ||
| 20 | + ntohs(((struct sockaddr_in *)saddr)->sin_port)); | ||
| 21 | +#else | ||
| 22 | + ntohs(saddr->sin_port)); | ||
| 23 | +#endif | ||
| 24 | + } else { | ||
| 25 | + strcpy(port, "0"); | ||
| 26 | + } | ||
| 27 | + return (port); | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | /* eval_client - return string with as much about the client as we know */ | ||
| 31 | |||
| 32 | char *eval_client(request) | ||
| 33 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 | ||
| 34 | --- tcp_wrappers_7.6.orig/hosts_access.5 2004-11-04 13:17:45.000000000 +0100 | ||
| 35 | +++ tcp_wrappers_7.6/hosts_access.5 2004-11-04 13:55:32.000000000 +0100 | ||
| 36 | @@ -175,6 +175,8 @@ | ||
| 37 | unavailable. | ||
| 38 | .IP "%n (%N)" | ||
| 39 | The client (server) host name (or "unknown" or "paranoid"). | ||
| 40 | +.IP "%r (%R)" | ||
| 41 | +The clients (servers) port number (or "0"). | ||
| 42 | .IP %p | ||
| 43 | The daemon process id. | ||
| 44 | .IP %s | ||
| 45 | diff -ruN tcp_wrappers_7.6.orig/percent_x.c tcp_wrappers_7.6/percent_x.c | ||
| 46 | --- tcp_wrappers_7.6.orig/percent_x.c 1994-12-28 17:42:38.000000000 +0100 | ||
| 47 | +++ tcp_wrappers_7.6/percent_x.c 2004-11-04 13:19:29.000000000 +0100 | ||
| 48 | @@ -63,6 +63,8 @@ | ||
| 49 | ch == 'n' ? eval_hostname(request->client) : | ||
| 50 | ch == 'N' ? eval_hostname(request->server) : | ||
| 51 | ch == 'p' ? eval_pid(request) : | ||
| 52 | + ch == 'r' ? eval_port(request->client->sin) : | ||
| 53 | + ch == 'R' ? eval_port(request->server->sin) : | ||
| 54 | ch == 's' ? eval_server(request) : | ||
| 55 | ch == 'u' ? eval_user(request) : | ||
| 56 | ch == '%' ? "%" : (tcpd_warn("unrecognized %%%c", ch), ""); | ||
| 57 | diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h | ||
| 58 | --- tcp_wrappers_7.6.orig/tcpd.h 2004-11-04 13:17:45.000000000 +0100 | ||
| 59 | +++ tcp_wrappers_7.6/tcpd.h 2004-11-04 13:19:13.000000000 +0100 | ||
| 60 | @@ -145,6 +145,11 @@ | ||
| 61 | extern char *eval_hostinfo(struct host_info *); /* host name or address */ | ||
| 62 | extern char *eval_client(struct request_info *);/* whatever is available */ | ||
| 63 | extern char *eval_server(struct request_info *);/* whatever is available */ | ||
| 64 | +#ifdef INET6 | ||
| 65 | +extern char *eval_port(struct sockaddr *); | ||
| 66 | +#else | ||
| 67 | +extern char *eval_port(struct sockaddr_in *); | ||
| 68 | +#endif | ||
| 69 | #define eval_daemon(r) ((r)->daemon) /* daemon process name */ | ||
| 70 | #define eval_pid(r) ((r)->pid) /* process id */ | ||
| 71 | |||
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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/percent_m.c tcp_wrappers_7.6/percent_m.c | ||
| 2 | --- tcp_wrappers_7.6.orig/percent_m.c 1994-12-28 17:42:37.000000000 +0100 | ||
| 3 | +++ tcp_wrappers_7.6/percent_m.c 2003-08-21 02:45:31.000000000 +0200 | ||
| 4 | @@ -29,11 +29,15 @@ | ||
| 5 | |||
| 6 | while (*bp = *cp) | ||
| 7 | if (*cp == '%' && cp[1] == 'm') { | ||
| 8 | +#ifdef HAVE_STRERROR | ||
| 9 | + strcpy(bp, strerror(errno)); | ||
| 10 | +#else | ||
| 11 | if (errno < sys_nerr && errno > 0) { | ||
| 12 | strcpy(bp, sys_errlist[errno]); | ||
| 13 | } else { | ||
| 14 | sprintf(bp, "Unknown error %d", errno); | ||
| 15 | } | ||
| 16 | +#endif | ||
| 17 | bp += strlen(bp); | ||
| 18 | cp += 2; | ||
| 19 | } 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 @@ | |||
| 1 | Index: tcp_wrappers_7.6.orig/Makefile | ||
| 2 | =================================================================== | ||
| 3 | --- tcp_wrappers_7.6.orig.orig/Makefile 2009-04-06 10:55:47.000000000 +0000 | ||
| 4 | +++ tcp_wrappers_7.6.orig/Makefile 2009-04-06 10:57:04.000000000 +0000 | ||
| 5 | @@ -748,31 +748,31 @@ | ||
| 6 | |||
| 7 | $(SHLIB): $(SHLIB_OBJ) | ||
| 8 | rm -f $(SHLIB) | ||
| 9 | - $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) | ||
| 10 | + $(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) | ||
| 11 | ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ) | ||
| 12 | ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO) | ||
| 13 | |||
| 14 | tcpd: tcpd.o $(SHLIB) | ||
| 15 | - $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS) | ||
| 16 | + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ tcpd.o $(SHLIBFLAGS) | ||
| 17 | |||
| 18 | miscd: miscd.o $(LIB) | ||
| 19 | - $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS) | ||
| 20 | + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ miscd.o $(LIB) $(LIBS) | ||
| 21 | |||
| 22 | safe_finger: safe_finger.o $(SHLIB) | ||
| 23 | - $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS) | ||
| 24 | + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS) | ||
| 25 | |||
| 26 | TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o | ||
| 27 | |||
| 28 | tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB) | ||
| 29 | - $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS) | ||
| 30 | + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS) | ||
| 31 | |||
| 32 | try-from: try-from.o fakelog.o $(SHLIB) | ||
| 33 | - $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS) | ||
| 34 | + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS) | ||
| 35 | |||
| 36 | TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o | ||
| 37 | |||
| 38 | tcpdchk: $(TCPDCHK_OBJ) $(SHLIB) | ||
| 39 | - $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS) | ||
| 40 | + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS) | ||
| 41 | |||
| 42 | shar: $(KIT) | ||
| 43 | @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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3 | ||
| 2 | --- tcp_wrappers_7.6.orig/hosts_access.3 2004-04-25 00:10:48.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/hosts_access.3 2004-04-25 00:09:36.000000000 +0200 | ||
| 4 | @@ -14,6 +14,9 @@ | ||
| 5 | struct request_info *request_set(request, key, value, ..., 0) | ||
| 6 | struct request_info *request; | ||
| 7 | |||
| 8 | +void fromhost(request) | ||
| 9 | +struct request_info *request; | ||
| 10 | + | ||
| 11 | int hosts_access(request) | ||
| 12 | struct request_info *request; | ||
| 13 | |||
| 14 | @@ -60,6 +63,7 @@ | ||
| 15 | is available, host names and client user names are looked up on demand, | ||
| 16 | using the request structure as a cache. hosts_access() returns zero if | ||
| 17 | access should be denied. | ||
| 18 | +fromhost() must be called before hosts_access(). | ||
| 19 | .PP | ||
| 20 | hosts_ctl() is a wrapper around the request_init() and hosts_access() | ||
| 21 | 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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c | ||
| 2 | --- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:40:08.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:40:02.000000000 +0200 | ||
| 4 | @@ -92,6 +92,8 @@ | ||
| 5 | char *cp; | ||
| 6 | char *result = unknown; | ||
| 7 | FILE *fp; | ||
| 8 | + unsigned saved_timeout; | ||
| 9 | + struct sigaction nact, oact; | ||
| 10 | |||
| 11 | #ifdef INET6 | ||
| 12 | /* address family must be the same */ | ||
| 13 | @@ -134,7 +136,12 @@ | ||
| 14 | */ | ||
| 15 | |||
| 16 | if (setjmp(timebuf) == 0) { | ||
| 17 | - signal(SIGALRM, timeout); | ||
| 18 | + /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */ | ||
| 19 | + saved_timeout = alarm(0); | ||
| 20 | + nact.sa_handler = timeout; | ||
| 21 | + nact.sa_flags = 0; | ||
| 22 | + (void) sigemptyset(&nact.sa_mask); | ||
| 23 | + (void) sigaction(SIGALRM, &nact, &oact); | ||
| 24 | alarm(rfc931_timeout); | ||
| 25 | |||
| 26 | /* | ||
| 27 | @@ -223,6 +230,10 @@ | ||
| 28 | } | ||
| 29 | alarm(0); | ||
| 30 | } | ||
| 31 | + /* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */ | ||
| 32 | + (void) sigaction(SIGALRM, &oact, NULL); | ||
| 33 | + if (saved_timeout > 0) | ||
| 34 | + alarm(saved_timeout); | ||
| 35 | fclose(fp); | ||
| 36 | } | ||
| 37 | 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 @@ | |||
| 1 | diff -ruNp tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c | ||
| 2 | --- tcp_wrappers_7.6.orig/scaffold.c 2005-03-09 18:22:04.000000000 +0100 | ||
| 3 | +++ tcp_wrappers_7.6/scaffold.c 2005-03-09 18:20:47.000000000 +0100 | ||
| 4 | @@ -237,10 +237,17 @@ struct request_info *request; | ||
| 5 | |||
| 6 | /* ARGSUSED */ | ||
| 7 | |||
| 8 | -void rfc931(request) | ||
| 9 | -struct request_info *request; | ||
| 10 | +void rfc931(rmt_sin, our_sin, dest) | ||
| 11 | +#ifdef INET6 | ||
| 12 | +struct sockaddr *rmt_sin; | ||
| 13 | +struct sockaddr *our_sin; | ||
| 14 | +#else | ||
| 15 | +struct sockaddr_in *rmt_sin; | ||
| 16 | +struct sockaddr_in *our_sin; | ||
| 17 | +#endif | ||
| 18 | +char *dest; | ||
| 19 | { | ||
| 20 | - strcpy(request->user, unknown); | ||
| 21 | + strcpy(dest, unknown); | ||
| 22 | } | ||
| 23 | |||
| 24 | /* check_path - examine accessibility */ | ||
| 25 | diff -ruNp tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h | ||
| 26 | --- tcp_wrappers_7.6.orig/tcpd.h 2005-03-09 18:22:04.000000000 +0100 | ||
| 27 | +++ tcp_wrappers_7.6/tcpd.h 2005-03-09 18:21:23.000000000 +0100 | ||
| 28 | @@ -83,7 +83,11 @@ extern int hosts_access(struct request_i | ||
| 29 | extern void shell_cmd(char *); /* execute shell command */ | ||
| 30 | extern char *percent_x(char *, int, char *, struct request_info *); | ||
| 31 | /* do %<char> expansion */ | ||
| 32 | +#ifdef INET6 | ||
| 33 | extern void rfc931(struct sockaddr *, struct sockaddr *, char *); | ||
| 34 | +#else | ||
| 35 | +extern void rfc931(struct sockaddr_in *, struct sockaddr_in *, char *); | ||
| 36 | +#endif | ||
| 37 | /* client name from RFC 931 daemon */ | ||
| 38 | extern void clean_exit(struct request_info *); /* clean up and exit */ | ||
| 39 | 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 @@ | |||
| 1 | .TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual" | ||
| 2 | .SH NAME | ||
| 3 | safe_finger \- finger client wrapper that protects against nasty stuff | ||
| 4 | from finger servers | ||
| 5 | .SH SYNOPSIS | ||
| 6 | .B safe_finger [finger_options] | ||
| 7 | .SH DESCRIPTION | ||
| 8 | The | ||
| 9 | .B safe_finger | ||
| 10 | command protects against nasty stuff from finger servers. Use this | ||
| 11 | program for automatic reverse finger probes from the | ||
| 12 | .B tcp_wrapper | ||
| 13 | .B (tcpd) | ||
| 14 | , not the raw finger command. The | ||
| 15 | .B safe_finger | ||
| 16 | command makes sure that the finger client is not run with root | ||
| 17 | privileges. It also runs the finger client with a defined PATH | ||
| 18 | environment. | ||
| 19 | .B safe_finger | ||
| 20 | will also protect you from problems caused by the output of some | ||
| 21 | finger servers. The problem: some programs may react to stuff in | ||
| 22 | the first column. Other programs may get upset by thrash anywhere | ||
| 23 | on a line. File systems may fill up as the finger server keeps | ||
| 24 | sending data. Text editors may bomb out on extremely long lines. | ||
| 25 | The finger server may take forever because it is somehow wedged. | ||
| 26 | .B safe_finger | ||
| 27 | takes care of all this badness. | ||
| 28 | .SH SEE ALSO | ||
| 29 | .BR hosts_access (5), | ||
| 30 | .BR hosts_options (5), | ||
| 31 | .BR tcpd (8) | ||
| 32 | .SH AUTHOR | ||
| 33 | Wietse Venema, Eindhoven University of Technology, The Netherlands. | ||
| 34 | |||
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 @@ | |||
| 1 | --- tcp-wrappers-7.6-ipv6.1.orig/safe_finger.c | ||
| 2 | +++ tcp-wrappers-7.6-ipv6.1/safe_finger.c | ||
| 3 | @@ -26,21 +26,24 @@ | ||
| 4 | #include <stdio.h> | ||
| 5 | #include <ctype.h> | ||
| 6 | #include <pwd.h> | ||
| 7 | +#include <syslog.h> | ||
| 8 | |||
| 9 | extern void exit(); | ||
| 10 | |||
| 11 | /* Local stuff */ | ||
| 12 | |||
| 13 | -char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin"; | ||
| 14 | +char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin"; | ||
| 15 | |||
| 16 | #define TIME_LIMIT 60 /* Do not keep listinging forever */ | ||
| 17 | #define INPUT_LENGTH 100000 /* Do not keep listinging forever */ | ||
| 18 | #define LINE_LENGTH 128 /* Editors can choke on long lines */ | ||
| 19 | #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */ | ||
| 20 | #define UNPRIV_NAME "nobody" /* Preferred privilege level */ | ||
| 21 | -#define UNPRIV_UGID 32767 /* Default uid and gid */ | ||
| 22 | +#define UNPRIV_UGID 65534 /* Default uid and gid */ | ||
| 23 | |||
| 24 | int finger_pid; | ||
| 25 | +int allow_severity = SEVERITY; | ||
| 26 | +int deny_severity = LOG_WARNING; | ||
| 27 | |||
| 28 | void cleanup(sig) | ||
| 29 | 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 @@ | |||
| 1 | * Mon Feb 10 2003 Harald Hoyer <harald@redhat.de> 7.6-29 | ||
| 2 | - added security patch tcp_wrappers-7.6-sig.patch | ||
| 3 | |||
| 4 | --- tcp_wrappers_7.6/hosts_access.c.sig 2003-02-10 16:18:31.000000000 +0100 | ||
| 5 | +++ tcp_wrappers_7.6/hosts_access.c 2003-02-10 16:50:38.000000000 +0100 | ||
| 6 | @@ -66,6 +66,7 @@ | ||
| 7 | |||
| 8 | #define YES 1 | ||
| 9 | #define NO 0 | ||
| 10 | +#define ERR -1 | ||
| 11 | |||
| 12 | /* | ||
| 13 | * These variables are globally visible so that they can be redirected in | ||
| 14 | @@ -129,9 +129,9 @@ | ||
| 15 | return (verdict == AC_PERMIT); | ||
| 16 | if (table_match(hosts_allow_table, request)) | ||
| 17 | return (YES); | ||
| 18 | - if (table_match(hosts_deny_table, request)) | ||
| 19 | - return (NO); | ||
| 20 | - return (YES); | ||
| 21 | + if (table_match(hosts_deny_table, request) == NO) | ||
| 22 | + return (YES); | ||
| 23 | + return (NO); | ||
| 24 | } | ||
| 25 | |||
| 26 | /* table_match - match table entries with (daemon, client) pair */ | ||
| 27 | @@ -175,6 +175,7 @@ | ||
| 28 | (void) fclose(fp); | ||
| 29 | } else if (errno != ENOENT) { | ||
| 30 | tcpd_warn("cannot open %s: %m", table); | ||
| 31 | + match = ERR; | ||
| 32 | } | ||
| 33 | if (match) { | ||
| 34 | 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 @@ | |||
| 1 | diff -ruNp tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c | ||
| 2 | --- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:42:25.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:41:04.000000000 +0200 | ||
| 4 | @@ -33,7 +33,7 @@ static char sccsid[] = "@(#) rfc931.c 1. | ||
| 5 | |||
| 6 | int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */ | ||
| 7 | |||
| 8 | -static jmp_buf timebuf; | ||
| 9 | +static sigjmp_buf timebuf; | ||
| 10 | |||
| 11 | /* fsocket - open stdio stream on top of socket */ | ||
| 12 | |||
| 13 | @@ -62,7 +62,7 @@ int protocol; | ||
| 14 | static void timeout(sig) | ||
| 15 | int sig; | ||
| 16 | { | ||
| 17 | - longjmp(timebuf, sig); | ||
| 18 | + siglongjmp(timebuf, sig); | ||
| 19 | } | ||
| 20 | |||
| 21 | /* rfc931 - return remote user name, given socket structures */ | ||
| 22 | @@ -135,7 +135,7 @@ char *dest; | ||
| 23 | * Set up a timer so we won't get stuck while waiting for the server. | ||
| 24 | */ | ||
| 25 | |||
| 26 | - if (setjmp(timebuf) == 0) { | ||
| 27 | + if (sigsetjmp(timebuf, 0) == 0) { | ||
| 28 | /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */ | ||
| 29 | saved_timeout = alarm(0); | ||
| 30 | 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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/fix_options.c tcp_wrappers_7.6/fix_options.c | ||
| 2 | --- tcp_wrappers_7.6.orig/fix_options.c 2003-08-21 03:41:33.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/fix_options.c 2003-08-21 03:41:27.000000000 +0200 | ||
| 4 | @@ -38,7 +38,11 @@ | ||
| 5 | #ifdef IP_OPTIONS | ||
| 6 | unsigned char optbuf[BUFFER_SIZE / 3], *cp; | ||
| 7 | char lbuf[BUFFER_SIZE], *lp; | ||
| 8 | +#ifdef __GLIBC__ | ||
| 9 | + size_t optsize = sizeof(optbuf), ipproto; | ||
| 10 | +#else | ||
| 11 | int optsize = sizeof(optbuf), ipproto; | ||
| 12 | +#endif | ||
| 13 | struct protoent *ip; | ||
| 14 | int fd = request->fd; | ||
| 15 | unsigned int opt; | ||
| 16 | diff -ruN tcp_wrappers_7.6.orig/socket.c tcp_wrappers_7.6/socket.c | ||
| 17 | --- tcp_wrappers_7.6.orig/socket.c 2003-08-21 03:41:33.000000000 +0200 | ||
| 18 | +++ tcp_wrappers_7.6/socket.c 2003-08-21 03:40:51.000000000 +0200 | ||
| 19 | @@ -90,7 +90,11 @@ | ||
| 20 | static struct sockaddr_in client; | ||
| 21 | static struct sockaddr_in server; | ||
| 22 | #endif | ||
| 23 | +#ifdef __GLIBC__ | ||
| 24 | + size_t len; | ||
| 25 | +#else | ||
| 26 | int len; | ||
| 27 | +#endif | ||
| 28 | char buf[BUFSIZ]; | ||
| 29 | int fd = request->fd; | ||
| 30 | |||
| 31 | @@ -421,7 +425,11 @@ | ||
| 32 | #else | ||
| 33 | struct sockaddr_in sin; | ||
| 34 | #endif | ||
| 35 | +#ifdef __GLIBC__ | ||
| 36 | + size_t size = sizeof(sin); | ||
| 37 | +#else | ||
| 38 | int size = sizeof(sin); | ||
| 39 | +#endif | ||
| 40 | |||
| 41 | /* | ||
| 42 | * 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 @@ | |||
| 1 | diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c | ||
| 2 | --- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 02:50:37.000000000 +0200 | ||
| 3 | +++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 02:50:33.000000000 +0200 | ||
| 4 | @@ -53,6 +53,24 @@ | ||
| 5 | #include "inetcf.h" | ||
| 6 | #include "scaffold.h" | ||
| 7 | |||
| 8 | +/* list of programs which are known to be linked with libwrap in debian */ | ||
| 9 | +static const char *const libwrap_programs[] = { | ||
| 10 | + "portmap", "mountd", "statd", "ugidd", | ||
| 11 | + "redir", "rlinetd", | ||
| 12 | + "sshd", | ||
| 13 | + "atftpd", | ||
| 14 | + "diald", | ||
| 15 | + "esound", | ||
| 16 | + "gdm", "gnome-session", | ||
| 17 | + "icecast", "icecast_admin", "icecast_client", "icecast_source", | ||
| 18 | + "mysqld", | ||
| 19 | + "ntop", | ||
| 20 | + "pptpd", | ||
| 21 | + "rquotad", | ||
| 22 | + "sendmail", "smail", | ||
| 23 | + NULL | ||
| 24 | +}; | ||
| 25 | + | ||
| 26 | /* | ||
| 27 | * Stolen from hosts_access.c... | ||
| 28 | */ | ||
| 29 | @@ -147,8 +165,8 @@ | ||
| 30 | /* | ||
| 31 | * These are not run from inetd but may have built-in access control. | ||
| 32 | */ | ||
| 33 | - inet_set("portmap", WR_NOT); | ||
| 34 | - inet_set("rpcbind", WR_NOT); | ||
| 35 | + for (c = 0; libwrap_programs[c]; c++) | ||
| 36 | + inet_set(libwrap_programs[c], WR_YES); | ||
| 37 | |||
| 38 | /* | ||
| 39 | * 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 @@ | |||
| 1 | .TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual" | ||
| 2 | .SH NAME | ||
| 3 | try-from \- test program for the tcp_wrapper | ||
| 4 | .SH SYNOPSIS | ||
| 5 | .B try-from | ||
| 6 | .SH DESCRIPTION | ||
| 7 | The | ||
| 8 | .B try-from | ||
| 9 | command can be called via a remote shell command to find out | ||
| 10 | if the hostname and address are properly recognized | ||
| 11 | by the | ||
| 12 | .B tcp_wrapper | ||
| 13 | library, if username lookup works, and (SysV only) if the TLI | ||
| 14 | on top of IP heuristics work. Diagnostics are reported through | ||
| 15 | .BR syslog (3) | ||
| 16 | and redirected to stderr. | ||
| 17 | |||
| 18 | Example: | ||
| 19 | |||
| 20 | rsh host /some/where/try-from | ||
| 21 | |||
| 22 | .SH SEE ALSO | ||
| 23 | .BR hosts_access (5), | ||
| 24 | .BR hosts_options (5), | ||
| 25 | .BR tcpd (8) | ||
| 26 | .SH AUTHOR | ||
| 27 | Wietse Venema, Eindhoven University of Technology, The Netherlands. | ||
| 28 | |||
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 @@ | |||
| 1 | DESCRIPTION = "Tools for monitoring and filtering incoming requests for tcp \ | ||
| 2 | services." | ||
| 3 | PRIORITY = "optional" | ||
| 4 | SECTION = "console/network" | ||
| 5 | |||
| 6 | LICENSE = "tcp-wrappers" | ||
| 7 | LIC_FILES_CHKSUM = "file://DISCLAIMER;md5=071bd69cb78b18888ea5e3da5c3127fa" | ||
| 8 | PR ="r0" | ||
| 9 | |||
| 10 | |||
| 11 | PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev tcp-wrappers tcp-wrappers-doc" | ||
| 12 | FILES_libwrap = "${base_libdir}/lib*.so.*" | ||
| 13 | FILES_libwrap-doc = "${mandir}/man3 ${mandir}/man5" | ||
| 14 | FILES_libwrap-dev = "${libdir}/lib*.so ${libdir}/lib*.a ${includedir}" | ||
| 15 | FILES_tcp-wrappers = "${bindir}" | ||
| 16 | FILES_tcp-wrappers-doc = "${mandir}/man8" | ||
| 17 | |||
| 18 | SRC_URI = "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \ | ||
| 19 | file://00_man_quoting.diff \ | ||
| 20 | file://01_man_portability.patch \ | ||
| 21 | file://05_wildcard_matching.patch \ | ||
| 22 | file://06_fix_gethostbyname.patch \ | ||
| 23 | file://10_usagi-ipv6.patch \ | ||
| 24 | file://11_tcpd_blacklist.patch \ | ||
| 25 | file://11_usagi_fix.patch \ | ||
| 26 | file://12_makefile_config.patch \ | ||
| 27 | file://13_shlib_weaksym.patch \ | ||
| 28 | file://14_cidr_support.patch \ | ||
| 29 | file://15_match_clarify.patch \ | ||
| 30 | file://expand_remote_port.patch \ | ||
| 31 | file://have_strerror.patch \ | ||
| 32 | file://man_fromhost.patch \ | ||
| 33 | file://restore_sigalarm.patch \ | ||
| 34 | file://rfc931.diff \ | ||
| 35 | file://safe_finger.patch \ | ||
| 36 | file://sig_fix.patch \ | ||
| 37 | file://siglongjmp.patch \ | ||
| 38 | file://size_t.patch \ | ||
| 39 | file://tcpdchk_libwrapped.patch \ | ||
| 40 | file://ldflags.patch \ | ||
| 41 | \ | ||
| 42 | file://try-from.8 \ | ||
| 43 | file://safe_finger.8" | ||
| 44 | |||
| 45 | S = "${WORKDIR}/tcp_wrappers_${PV}" | ||
| 46 | |||
| 47 | PARALLEL_MAKE = "" | ||
| 48 | EXTRA_OEMAKE = "'CC=${CC}' \ | ||
| 49 | 'AR=${AR}' \ | ||
| 50 | 'RANLIB=${RANLIB}' \ | ||
| 51 | 'REAL_DAEMON_DIR=${sbindir}' \ | ||
| 52 | 'STYLE=-DPROCESS_OPTIONS' \ | ||
| 53 | 'FACILITY=LOG_DAEMON' \ | ||
| 54 | 'SEVERITY=LOG_INFO' \ | ||
| 55 | 'BUGS=' \ | ||
| 56 | 'VSYSLOG=' \ | ||
| 57 | 'RFC931_TIMEOUT=10' \ | ||
| 58 | 'ACCESS=-DHOSTS_ACCESS' \ | ||
| 59 | 'KILL_OPT=-DKILL_IP_OPTIONS' \ | ||
| 60 | 'UMASK=-DDAEMON_UMASK=022' \ | ||
| 61 | 'NETGROUP=${EXTRA_OEMAKE_NETGROUP}' \ | ||
| 62 | 'LIBS=-lnsl' \ | ||
| 63 | 'ARFLAGS=rv' \ | ||
| 64 | 'AUX_OBJ=weak_symbols.o' \ | ||
| 65 | 'TLI=' \ | ||
| 66 | 'COPTS=' \ | ||
| 67 | 'EXTRA_CFLAGS=${CFLAGS} -DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len'" | ||
| 68 | |||
| 69 | EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN" | ||
| 70 | EXTRA_OEMAKE_NETGROUP_linux-uclibc = "-DUSE_GETDOMAIN" | ||
| 71 | EXTRA_OEMAKE_NETGROUP_linux-uclibceabi = "-DUSE_GETDOMAIN" | ||
| 72 | |||
| 73 | do_compile () { | ||
| 74 | oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \ | ||
| 75 | all | ||
| 76 | } | ||
| 77 | |||
| 78 | BINS = "safe_finger tcpd tcpdchk try-from tcpdmatch" | ||
| 79 | MANS3 = "hosts_access" | ||
| 80 | MANS5 = "hosts_options" | ||
| 81 | MANS8 = "tcpd tcpdchk tcpdmatch" | ||
| 82 | do_install () { | ||
| 83 | oe_libinstall -a libwrap ${D}${libdir} | ||
| 84 | oe_libinstall -C shared -so libwrap ${D}${base_libdir} | ||
| 85 | |||
| 86 | rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'` | ||
| 87 | libname=`readlink ${D}${base_libdir}/libwrap.so | xargs basename` | ||
| 88 | ln -s ${rel_lib_prefix}${base_libdir}/${libname} ${D}${libdir}/libwrap.so | ||
| 89 | rm -f ${D}${base_libdir}/libwrap.so | ||
| 90 | |||
| 91 | install -d ${D}${sbindir} | ||
| 92 | for b in ${BINS}; do | ||
| 93 | install -m 0755 $b ${D}${sbindir}/ || exit 1 | ||
| 94 | done | ||
| 95 | |||
| 96 | install -d ${D}${mandir}/man3 | ||
| 97 | for m in ${MANS3}; do | ||
| 98 | install -m 0644 $m.3 ${D}${mandir}/man3/ || exit 1 | ||
| 99 | done | ||
| 100 | |||
| 101 | install -d ${D}${mandir}/man5 | ||
| 102 | for m in ${MANS5}; do | ||
| 103 | install -m 0644 $m.5 ${D}${mandir}/man5/ || exit 1 | ||
| 104 | done | ||
| 105 | |||
| 106 | install -d ${D}${mandir}/man8 | ||
| 107 | for m in ${MANS8}; do | ||
| 108 | install -m 0644 $m.8 ${D}${mandir}/man8/ || exit 1 | ||
| 109 | done | ||
| 110 | |||
| 111 | install -m 0644 ${WORKDIR}/try-from.8 ${D}${mandir}/man8/ | ||
| 112 | install -m 0644 ${WORKDIR}/safe_finger.8 ${D}${mandir}/man8/ | ||
| 113 | |||
| 114 | install -d ${D}${includedir} | ||
| 115 | install -m 0644 tcpd.h ${D}${includedir}/ | ||
| 116 | } | ||
| 117 | |||
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 @@ | |||
| 1 | DESCRIPTION = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect" | ||
| 2 | |||
| 3 | PR = "r0" | ||
| 4 | |||
| 5 | SRC_URI = "ftp://elsie.nci.nih.gov/pub/tzcode${PV}.tar.gz \ | ||
| 6 | ftp://elsie.nci.nih.gov/pub/tzdata2009s.tar.gz" | ||
| 7 | |||
| 8 | S = "${WORKDIR}" | ||
| 9 | |||
| 10 | inherit native | ||
| 11 | |||
| 12 | do_install () { | ||
| 13 | install -d ${D}${bindir}/ | ||
| 14 | install -m 755 zic ${D}${bindir}/ | ||
| 15 | install -m 755 zdump ${D}${bindir}/ | ||
| 16 | install -m 755 tzselect ${D}${bindir}/ | ||
| 17 | } | ||
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 @@ | |||
| 1 | DESCRIPTION = "Timezone data" | ||
| 2 | HOMEPAGE = "ftp://elsie.nci.nih.gov/pub/" | ||
| 3 | SECTION = "base" | ||
| 4 | PRIORITY = "optional" | ||
| 5 | LICENSE = "PD" | ||
| 6 | LIC_FILES_CHKSUM = "file://asia;beginline=2;endline=3;md5=06468c0e84ef4d4c97045a4a29b08234" | ||
| 7 | DEPENDS = "tzcode-native" | ||
| 8 | |||
| 9 | PR = "r0" | ||
| 10 | |||
| 11 | RCONFLICTS= "timezones timezone-africa timezone-america timezone-antarctica \ | ||
| 12 | timezone-arctic timezone-asia timezone-atlantic \ | ||
| 13 | timezone-australia timezone-europe timezone-indian \ | ||
| 14 | timezone-iso3166.tab timezone-pacific timezone-zone.tab" | ||
| 15 | |||
| 16 | SRC_URI = "ftp://elsie.nci.nih.gov/pub/tzdata${PV}.tar.gz" | ||
| 17 | |||
| 18 | S = "${WORKDIR}" | ||
| 19 | |||
| 20 | TZONES= "africa antarctica asia australasia europe northamerica southamerica \ | ||
| 21 | factory solar87 solar88 solar89 etcetera backward systemv \ | ||
| 22 | # pacificnew \ | ||
| 23 | " | ||
| 24 | |||
| 25 | do_compile () { | ||
| 26 | for zone in ${TZONES}; do \ | ||
| 27 | ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \ | ||
| 28 | -y ${S}/yearistype.sh ${S}/${zone} ; \ | ||
| 29 | ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \ | ||
| 30 | -y ${S}/yearistype.sh ${S}/${zone} ; \ | ||
| 31 | ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \ | ||
| 32 | -y ${S}/yearistype.sh ${S}/${zone} ; \ | ||
| 33 | done | ||
| 34 | } | ||
| 35 | |||
| 36 | do_install () { | ||
| 37 | install -d ${D}/usr ${D}${datadir}/zoneinfo | ||
| 38 | cp -pPR ${S}/usr ${D}/ | ||
| 39 | } | ||
| 40 | |||
| 41 | # Packages primarily organized by directory with a major city | ||
| 42 | # in most time zones in the base package | ||
| 43 | |||
| 44 | PACKAGES = "tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \ | ||
| 45 | tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \ | ||
| 46 | tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific" | ||
| 47 | |||
| 48 | FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*" | ||
| 49 | RPROVIDES_tzdata-africa = "tzdata-africa" | ||
| 50 | |||
| 51 | FILES_tzdata-americas += "${datadir}/zoneinfo/America/* \ | ||
| 52 | ${datadir}/zoneinfo/US/* \ | ||
| 53 | ${datadir}/zoneinfo/Brazil/* \ | ||
| 54 | ${datadir}/zoneinfo/Canada/* \ | ||
| 55 | ${datadir}/zoneinfo/Mexico/* \ | ||
| 56 | ${datadir}/zoneinfo/Chile/*" | ||
| 57 | RPROVIDES_tzdata-americas = "tzdata-americas" | ||
| 58 | |||
| 59 | FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*" | ||
| 60 | RPROVIDES_tzdata-antarctica = "tzdata-antarctica" | ||
| 61 | |||
| 62 | FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*" | ||
| 63 | RPROVIDES_tzdata-arctic = "tzdata-arctic" | ||
| 64 | |||
| 65 | FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/* \ | ||
| 66 | ${datadir}/zoneinfo/Indian/* \ | ||
| 67 | ${datadir}/zoneinfo/Mideast/*" | ||
| 68 | RPROVIDES_tzdata-asia = "tzdata-asia" | ||
| 69 | |||
| 70 | FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*" | ||
| 71 | RPROVIDES_tzdata-atlantic = "tzdata-atlantic" | ||
| 72 | |||
| 73 | FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*" | ||
| 74 | RPROVIDES_tzdata-australia = "tzdata-australia" | ||
| 75 | |||
| 76 | FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*" | ||
| 77 | RPROVIDES_tzdata-europe = "tzdata-europe" | ||
| 78 | |||
| 79 | FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*" | ||
| 80 | RPROVIDES_tzdata-pacific = "tzdata-pacific" | ||
| 81 | |||
| 82 | FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*" | ||
| 83 | RPROVIDES_tzdata-posix = "tzdata-posix" | ||
| 84 | |||
| 85 | FILES_tzdata-right += "${datadir}/zoneinfo/right/*" | ||
| 86 | RPROVIDES_tzdata-right = "tzdata-right" | ||
| 87 | |||
| 88 | |||
| 89 | FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba \ | ||
| 90 | ${datadir}/zoneinfo/Egypt \ | ||
| 91 | ${datadir}/zoneinfo/Eire \ | ||
| 92 | ${datadir}/zoneinfo/Factory \ | ||
| 93 | ${datadir}/zoneinfo/GB-Eire \ | ||
| 94 | ${datadir}/zoneinfo/Hongkong \ | ||
| 95 | ${datadir}/zoneinfo/Iceland \ | ||
| 96 | ${datadir}/zoneinfo/Iran \ | ||
| 97 | ${datadir}/zoneinfo/Israel \ | ||
| 98 | ${datadir}/zoneinfo/Jamaica \ | ||
| 99 | ${datadir}/zoneinfo/Japan \ | ||
| 100 | ${datadir}/zoneinfo/Kwajalein \ | ||
| 101 | ${datadir}/zoneinfo/Libya \ | ||
| 102 | ${datadir}/zoneinfo/Navajo \ | ||
| 103 | ${datadir}/zoneinfo/Poland \ | ||
| 104 | ${datadir}/zoneinfo/Portugal \ | ||
| 105 | ${datadir}/zoneinfo/Singapore \ | ||
| 106 | ${datadir}/zoneinfo/Turkey" | ||
| 107 | RPROVIDES_tzdata-misc = "tzdata-misc" | ||
| 108 | |||
| 109 | |||
| 110 | FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu \ | ||
| 111 | ${datadir}/zoneinfo/America/Anchorage \ | ||
| 112 | ${datadir}/zoneinfo/America/Los_Angeles \ | ||
| 113 | ${datadir}/zoneinfo/America/Denver \ | ||
| 114 | ${datadir}/zoneinfo/America/Chicago \ | ||
| 115 | ${datadir}/zoneinfo/America/New_York \ | ||
| 116 | ${datadir}/zoneinfo/America/Caracas \ | ||
| 117 | ${datadir}/zoneinfo/America/Sao_Paulo \ | ||
| 118 | ${datadir}/zoneinfo/Europe/London \ | ||
| 119 | ${datadir}/zoneinfo/Europe/Paris \ | ||
| 120 | ${datadir}/zoneinfo/Africa/Cairo \ | ||
| 121 | ${datadir}/zoneinfo/Europe/Moscow \ | ||
| 122 | ${datadir}/zoneinfo/Asia/Dubai \ | ||
| 123 | ${datadir}/zoneinfo/Asia/Karachi \ | ||
| 124 | ${datadir}/zoneinfo/Asia/Dhaka \ | ||
| 125 | ${datadir}/zoneinfo/Asia/Bankok \ | ||
| 126 | ${datadir}/zoneinfo/Asia/Hong_Kong \ | ||
| 127 | ${datadir}/zoneinfo/Asia/Tokyo \ | ||
| 128 | ${datadir}/zoneinfo/Australia/Darwin \ | ||
| 129 | ${datadir}/zoneinfo/Australia/Adelaide \ | ||
| 130 | ${datadir}/zoneinfo/Australia/Brisbane \ | ||
| 131 | ${datadir}/zoneinfo/Australia/Sydney \ | ||
| 132 | ${datadir}/zoneinfo/Pacific/Noumea \ | ||
| 133 | ${datadir}/zoneinfo/CET \ | ||
| 134 | ${datadir}/zoneinfo/CST6CDT \ | ||
| 135 | ${datadir}/zoneinfo/EET \ | ||
| 136 | ${datadir}/zoneinfo/EST \ | ||
| 137 | ${datadir}/zoneinfo/EST5EDT \ | ||
| 138 | ${datadir}/zoneinfo/GB \ | ||
| 139 | ${datadir}/zoneinfo/GMT \ | ||
| 140 | ${datadir}/zoneinfo/GMT+0 \ | ||
| 141 | ${datadir}/zoneinfo/GMT-0 \ | ||
| 142 | ${datadir}/zoneinfo/GMT0 \ | ||
| 143 | ${datadir}/zoneinfo/Greenwich \ | ||
| 144 | ${datadir}/zoneinfo/HST \ | ||
| 145 | ${datadir}/zoneinfo/MET \ | ||
| 146 | ${datadir}/zoneinfo/MST \ | ||
| 147 | ${datadir}/zoneinfo/MST7MDT \ | ||
| 148 | ${datadir}/zoneinfo/NZ \ | ||
| 149 | ${datadir}/zoneinfo/NZ-CHAT \ | ||
| 150 | ${datadir}/zoneinfo/PRC \ | ||
| 151 | ${datadir}/zoneinfo/PST8PDT \ | ||
| 152 | ${datadir}/zoneinfo/ROC \ | ||
| 153 | ${datadir}/zoneinfo/ROK \ | ||
| 154 | ${datadir}/zoneinfo/UCT \ | ||
| 155 | ${datadir}/zoneinfo/UTC \ | ||
| 156 | ${datadir}/zoneinfo/Universal \ | ||
| 157 | ${datadir}/zoneinfo/W-SU \ | ||
| 158 | ${datadir}/zoneinfo/WET \ | ||
| 159 | ${datadir}/zoneinfo/Zulu \ | ||
| 160 | ${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 @@ | |||
| 1 | DESCRIPTION = "A (de)compression library for the ZIP format" | ||
| 2 | HOMEPAGE = "http://www.info-zip.org" | ||
| 3 | SECTION = "console/utils" | ||
| 4 | LICENSE = "Info-ZIP" | ||
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=94caec5a51ef55ef711ee4e8b1c69e29" | ||
| 6 | PE = "1" | ||
| 7 | PR = "r0" | ||
| 8 | |||
| 9 | SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/unzip60.tgz" | ||
| 10 | S = "${WORKDIR}/unzip60" | ||
| 11 | |||
| 12 | export LD = "${CC}" | ||
| 13 | LD_virtclass-native = "${CC}" | ||
| 14 | |||
| 15 | do_compile() { | ||
| 16 | oe_runmake -f unix/Makefile generic | ||
| 17 | } | ||
| 18 | |||
| 19 | do_install() { | ||
| 20 | oe_runmake -f unix/Makefile install prefix=${D}${prefix} | ||
| 21 | install -d ${D}${mandir} | ||
| 22 | mv ${D}${prefix}/man/* ${D}${mandir} | ||
| 23 | } | ||
| 24 | |||
| 25 | 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 @@ | |||
| 1 | DESCRIPTION = "Watchdog is a daemon that checks if your system is still \ | ||
| 2 | working. If programs in user space are not longer executed \ | ||
| 3 | it will reboot the system." | ||
| 4 | HOMEPAGE = "http://watchdog.sourceforge.net/" | ||
| 5 | BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194" | ||
| 6 | |||
| 7 | LICENSE = "GPLv1+" | ||
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=8a7258c60a71a2f04b67fb01f495889c" | ||
| 9 | |||
| 10 | PR = "r0" | ||
| 11 | |||
| 12 | SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz" | ||
| 13 | |||
| 14 | inherit autotools | ||
| 15 | |||
| 16 | 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 @@ | |||
| 1 | Index: zile-2.0beta6/acinclude.m4 | ||
| 2 | =================================================================== | ||
| 3 | --- zile-2.0beta6.orig/acinclude.m4 2004-12-20 19:13:07.000000000 -0500 | ||
| 4 | +++ zile-2.0beta6/acinclude.m4 2005-01-21 20:38:28.982166344 -0500 | ||
| 5 | @@ -35,3 +35,29 @@ | ||
| 6 | t} | ||
| 7 | fi | ||
| 8 | AC_SUBST(EXEEXT_FOR_BUILD)])dnl | ||
| 9 | + | ||
| 10 | +dnl Get a default for CFLAGS_FOR_BUILD to put into Makefile. | ||
| 11 | +AC_DEFUN([BFD_CFLAGS_FOR_BUILD], | ||
| 12 | +[ac_test_CFLAGS=${CFLAGS+set} | ||
| 13 | +# Put a plausible default for CFLAGS_FOR_BUILD in Makefile. | ||
| 14 | +if test -z "$CFLAGS_FOR_BUILD"; then | ||
| 15 | + if test "x$cross_compiling" = "xyes"; then | ||
| 16 | + CFLAGS_FOR_BUILD="-O2" | ||
| 17 | + else | ||
| 18 | + CFLAGS_FOR_BUILD='$(CFLAGS)' | ||
| 19 | + fi | ||
| 20 | +fi | ||
| 21 | +AC_SUBST(CFLAGS_FOR_BUILD)])dnl | ||
| 22 | + | ||
| 23 | +dnl Get a default for LDFLAGS_FOR_BUILD to put into Makefile. | ||
| 24 | +AC_DEFUN([BFD_LDFLAGS_FOR_BUILD], | ||
| 25 | +[ac_test_LDFLAGS=${LDFLAGS+set} | ||
| 26 | +# Put a plausible default for LDFLAGS_FOR_BUILD in Makefile. | ||
| 27 | +if test -z "$LDFLAGS_FOR_BUILD"; then | ||
| 28 | + if test "x$cross_compiling" = "xyes"; then | ||
| 29 | + LDFLAGS_FOR_BUILD="" | ||
| 30 | + else | ||
| 31 | + LDFLAGS_FOR_BUILD='$(LDFLAGS)' | ||
| 32 | + fi | ||
| 33 | +fi | ||
| 34 | +AC_SUBST(LDFLAGS_FOR_BUILD)])dnl | ||
| 35 | Index: zile-2.0beta6/configure.ac | ||
| 36 | =================================================================== | ||
| 37 | --- zile-2.0beta6.orig/configure.ac 2005-01-12 07:56:19.000000000 -0500 | ||
| 38 | +++ zile-2.0beta6/configure.ac 2005-01-21 20:26:58.178184512 -0500 | ||
| 39 | @@ -19,6 +19,8 @@ | ||
| 40 | |||
| 41 | AC_PROG_CC | ||
| 42 | BFD_CC_FOR_BUILD | ||
| 43 | +BFD_CFLAGS_FOR_BUILD | ||
| 44 | +BFD_LDFLAGS_FOR_BUILD | ||
| 45 | AC_C_INLINE | ||
| 46 | AC_PROG_INSTALL | ||
| 47 | AC_PROG_RANLIB | ||
| 48 | Index: zile-2.0beta6/doc/Makefile.am | ||
| 49 | =================================================================== | ||
| 50 | --- zile-2.0beta6.orig/doc/Makefile.am 2005-01-03 06:11:32.000000000 -0500 | ||
| 51 | +++ zile-2.0beta6/doc/Makefile.am 2005-01-21 20:27:17.271281920 -0500 | ||
| 52 | @@ -27,10 +27,10 @@ | ||
| 53 | AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/src | ||
| 54 | |||
| 55 | mkdoc$(EXEEXT_FOR_BUILD): mkdoc.o config.h | ||
| 56 | - $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ mkdoc.o | ||
| 57 | + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ mkdoc.o | ||
| 58 | |||
| 59 | mkdoc.o: mkdoc.c | ||
| 60 | - $(CC_FOR_BUILD) -c -I$(top_srcdir)/doc -I$(top_srcdir) -I$(top_srcdir)/src $(CFLAGS) $(srcdir)/mkdoc.c | ||
| 61 | + $(CC_FOR_BUILD) -c -I$(top_srcdir)/doc -I$(top_srcdir) -I$(top_srcdir)/src $(CFLAGS_FOR_BUILD) $(srcdir)/mkdoc.c | ||
| 62 | |||
| 63 | AUTODOC: $(AUTODOCSRCS) mkdoc | ||
| 64 | ./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 @@ | |||
| 1 | DESCRIPTION = "Zile is a very small emacs-like editor." | ||
| 2 | HOMEPAGE = "http://zile.sourceforge.net/" | ||
| 3 | LICENSE = "GPL" | ||
| 4 | DEPENDS = "ncurses" | ||
| 5 | PRIORITY = "optional" | ||
| 6 | SECTION = "console/editors" | ||
| 7 | PR = "r1" | ||
| 8 | |||
| 9 | UV = "${@bb.data.getVar('PV', d, 1).split('+')[1]}" | ||
| 10 | |||
| 11 | SRC_URI = "${SOURCEFORGE_MIRROR}/zile/zile-${UV}.tar.gz \ | ||
| 12 | file://for_build.patch;patch=1" | ||
| 13 | S = "${WORKDIR}/zile-${UV}" | ||
| 14 | |||
| 15 | inherit autotools | ||
| 16 | |||
| 17 | export CC_FOR_BUILD = "${BUILD_CC}" | ||
| 18 | export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS} -DHAVE_VASPRINTF" | ||
| 19 | 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 @@ | |||
| 1 | DESCRIPTION = "Archiver for .zip files" | ||
| 2 | HOMEPAGE = "http://www.info-zip.org" | ||
| 3 | SECTION = "console/utils" | ||
| 4 | |||
| 5 | LICENSE = "Info-ZIP" | ||
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=04d43c5d70b496c032308106e26ae17d" | ||
| 7 | |||
| 8 | SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@bb.data.getVar('PV',d,1).replace('.', '')}.tgz" | ||
| 9 | |||
| 10 | EXTRA_OEMAKE = "'CC=${CC}' 'BIND=${CC}' 'AS=${CC} -c' 'CPP=${CPP}' \ | ||
| 11 | 'CFLAGS=-I. -DUNIX ${CFLAGS}' 'INSTALL=install' \ | ||
| 12 | 'BINFLAGS=0755' 'INSTALL_D=install -d'" | ||
| 13 | |||
| 14 | do_compile() { | ||
| 15 | oe_runmake -f unix/Makefile generic | ||
| 16 | } | ||
| 17 | |||
| 18 | do_install() { | ||
| 19 | oe_runmake -f unix/Makefile prefix=${D}${prefix} \ | ||
| 20 | BINDIR=${D}${bindir} MANDIR=${D}${mandir}/man1 \ | ||
| 21 | install | ||
| 22 | } | ||
| 23 | |||
| 24 | 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 @@ | |||
| 1 | require zip.inc | ||
| 2 | |||
| 3 | PR="r0" | ||
| 4 | |||
| 5 | # zip-2.32 still uses directory name of zip-2.30 | ||
| 6 | S = "${WORKDIR}/zip30" | ||
