--- libedit-2.11~20080614.orig/debian/control +++ libedit-2.11~20080614/debian/control @@ -0,0 +1,30 @@ +Source: libedit +Section: libs +Priority: standard +Maintainer: Anibal Monsalve Salazar +Build-Depends: debhelper (>= 7), quilt, pmake (>= 1.45-8), groff-base, libncurses5-dev, bsdmainutils +Standards-Version: 3.8.1 +Vcs-Browser: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/ +Homepage: http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-5-0/src/lib/libedit/ + +Package: libedit2 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: libbsd0 +Description: BSD editline and history libraries + The editline library provides generic line editing and + history functions. + . + It slightly resembles GNU readline + +Package: libedit-dev +Section: libdevel +Priority: optional +Architecture: any +Depends: libedit2 (= ${binary:Version}), libncurses5-dev +Description: BSD editline and history libraries (development files) + The editline library provides generic line editing and + history functions. + . + It slightly resembles GNU readline --- libedit-2.11~20080614.orig/debian/libedit2.files +++ libedit-2.11~20080614/debian/libedit2.files @@ -0,0 +1,2 @@ +usr/lib/libedit.so.2.11 +usr/lib/libedit.so.2 --- libedit-2.11~20080614.orig/debian/libedit-dev.files +++ libedit-2.11~20080614/debian/libedit-dev.files @@ -0,0 +1,8 @@ +usr/include/libedit/vis.h +usr/include/editline/readline.h +usr/include/histedit.h +usr/lib/libedit.a +usr/lib/libedit.so +usr/share/man/man3/editline.3el +usr/share/man/man5/editrc.5el +usr/lib/pkgconfig/libedit.pc --- libedit-2.11~20080614.orig/debian/compat +++ libedit-2.11~20080614/debian/compat @@ -0,0 +1 @@ +7 --- libedit-2.11~20080614.orig/debian/libedit.pc +++ libedit-2.11~20080614/debian/libedit.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libedit +Description: Not just a replacement library for libreadline and libhistory. +Version: 2.11 +Requires: +Libs: -L${libdir} -ledit -lcurses +Libs.private: +Cflags: -I${includedir} --- libedit-2.11~20080614.orig/debian/rules +++ libedit-2.11~20080614/debian/rules @@ -0,0 +1,111 @@ +#! /usr/bin/make -f +## debian/rules for libedit, mostly a pmake workaround.. +## hacked together by Gergely Nagy +## $MadHouse: Debian/libedit/debian/rules,v 1.3 2001/11/04 01:57:26 algernon Exp $ + +# This is the debhelper compatability version to use. + +PACKAGE = libedit +PKGDIR = ${CURDIR}/debian/tmp +PMAKE_ARGS = MKPROFILE=no MKCATPAGES=no MLINKS= MANPAGES= \ + SHLIB_SHFLAGS="-Wl,-soname,libedit.so.${major}" \ + LDADD="*.so -lcurses" +EDITLINE_3_LINKS = el_init el_end el_reset el_gets el_getc el_push \ + el_parse el_set el_get el_source el_resize el_line \ + el_insertstr el_deletestr history_init history_end history + +version = 2.11 +major = 2 +## For automatic update from CVS +CVSROOT = :pserver:anoncvs@anoncvs.netbsd.org:/cvsroot +DATE = $(shell date +%Y%m%d) +ROOT = basesrc +MISC_STUFF = lib/libc/include/namespace.h lib/libc/string/strlcat.c \ + lib/libc/string/strlcpy.c lib/libc/gen/vis.c \ + lib/libc/gen/unvis.c include/vis.h + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) +CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc LD=$(DEB_HOST_GNU_TYPE)-ld +endif + +# Workaround for pmake fussiness +ifeq (mips-linux,$(DEB_HOST_GNU_TYPE)) +PMAKE_ARGS += MACHINE_ARCH=mipseb +endif + +include /usr/share/quilt/quilt.make + +build: patch build-stamp +build-stamp: + dh_testdir + chmod 755 libedit/makelist # workaround a bug in upstream source + cd libedit && $(CROSS) pmake ${PMAKE_ARGS} + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + dh_clean build-stamp + -cd libedit && pmake distclean + +install: build + dh_testdir + dh_testroot + dh_clean + install -d ${PKGDIR}/usr/lib + install -d ${PKGDIR}/usr/include/readline + install -d ${PKGDIR}/usr/include/libedit + install -d ${PKGDIR}/usr/share/man/man3 + install -d ${PKGDIR}/usr/share/man/man5 + install -d ${PKGDIR}/usr/lib/pkgconfig + install -m 644 $(CURDIR)/glibc-compat/vis.h ${PKGDIR}/usr/include/libedit + install -m 644 $(CURDIR)/debian/libedit.pc ${PKGDIR}/usr/lib/pkgconfig + cd libedit && \ + pmake install incinstall DESTDIR=${PKGDIR} ${PMAKE_ARGS} +## pmake workaround + cd libedit/readline && \ + pmake incinstall DESTDIR=${PKGDIR} ${PMAKE_ARGS} + mv ${PKGDIR}/usr/include/readline ${PKGDIR}/usr/include/editline + ln -sf libedit.so.${version} ${PKGDIR}/usr/lib/libedit.so.${major} + ln -sf libedit.so.${major} ${PKGDIR}/usr/lib/libedit.so + +binary-indep: build install +binary-arch: build install + dh_testdir + dh_testroot +## Install manpages + install -m 0644 libedit/editline.3 ${PKGDIR}/usr/share/man/man3/editline.3el + install -m 0644 libedit/editrc.5 ${PKGDIR}/usr/share/man/man5/editrc.5el +## End + dh_movefiles + @list="${EDITLINE_3_LINKS}"; for l in $$list; do \ + echo "ln -sf editline.3el ${CURDIR}/debian/libedit-dev/usr/share/man/man3/$$l.3el"; \ + ln -sf editline.3el ${CURDIR}/debian/libedit-dev/usr/share/man/man3/$$l.3el; \ + done + dh_installdocs + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch + +cvs-update: + install -d glibc-compat/tmp + cd glibc-compat/tmp && \ + cvs -d ${CVSROOT} export -D now $(patsubst %,${ROOT}/%,${MISC_STUFF}) + find glibc-compat/tmp -type f -exec mv {} glibc-compat/ \; + rm -rf glibc-compat/tmp + cvs -d ${CVSROOT} export -D now -d libedit-${DATE} ${ROOT}/lib/libedit + +.PHONY: build clean binary-indep binary-arch binary install cvs-update --- libedit-2.11~20080614.orig/debian/libedit-dev.links +++ libedit-2.11~20080614/debian/libedit-dev.links @@ -0,0 +1 @@ +usr/include/editline/readline.h usr/include/editline/history.h --- libedit-2.11~20080614.orig/debian/copyright +++ libedit-2.11~20080614/debian/copyright @@ -0,0 +1,40 @@ +This package was debianized by Gergely Nagy . + +It was checked out from NetBSD CVS on 2008-06-14. +(CVS_RSH=ssh CVSROOT=anoncvs@anoncvs.NetBSD.org:/cvsroot cvs checkout -P $path) + +Upstream Author: NetBSD Foundation + +Homepage: http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-5-0/src/lib/libedit/ + +Copyright: + + Copyright (c) 1992, 1993 + The Regents of the University of California. All rights reserved. + + This code is derived from software contributed to Berkeley by + Christos Zoulas of Cornell University. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. --- libedit-2.11~20080614.orig/debian/libedit2.shlibs +++ libedit-2.11~20080614/debian/libedit2.shlibs @@ -0,0 +1 @@ +libedit 2 libedit2 (>= 2.5.cvs.20010821-1) --- libedit-2.11~20080614.orig/debian/changelog +++ libedit-2.11~20080614/debian/changelog @@ -0,0 +1,241 @@ +libedit (2.11~20080614-2) unstable; urgency=low + + * Merge with Ubuntu + - debian/patches/20-fortify.patch: handle error conditions found + by -D_FORTIFY_SOURCE=2; closes: #488456 + * Suggests libbsd0; closes: #513027 + * Support crossbuilding; closes: #489846, #489847 + * Homepage is + http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-5-0/src/lib/libedit/ + * Standards version is 3.8.1 + * debhelper compatibility is 7 + + -- Anibal Monsalve Salazar Fri, 22 May 2009 10:29:58 +1000 + +libedit (2.11~20080614-1ubuntu1) intrepid; urgency=low + + * debian/patches/20-fortify.patch: handle error conditions found + by -D_FORTIFY_SOURCE=2. + + -- Kees Cook Sat, 28 Jun 2008 17:59:27 -0700 + +libedit (2.11~20080614-1) unstable; urgency=low + + * Update sources from CVS repo; closes: #478922 + * Depend on quilt and rename all patches + * Remove patch code from debian/rules; closes: #484401 + * Provide vis.h; closes: #357594 + * Update debian/coyright + * Let dh_makeshlibs create libedit2.postrm libedit2.postinst + * Priority of libedit2 is standard + * Standards version is 3.8.0 + * Patches: + Remove 09-export_completion_matches.diff + It won't compile with this patch: + rl_completion_matches defined twice + Add 10-define_SIZE_T_MAX.diff + Define SIZE_T_MAX as UINT_MAX in limits.h + Add 11-357594-vis.h.diff + Minor adaptation for Glibc by Robert Millan + Add 12-libedit-Makefile.diff + Without it I get the following message: + make: ${_MKTARGET_CREATE} expands to empty string + Add 13-symbol_not_found.diff by Anibal Monsalve Salazar + Without it I get the following messages: + symbol strlcpy/strlcat not found in none of the libraries + + -- Anibal Monsalve Salazar Sat, 14 Jun 2008 17:13:08 +1000 + +libedit (2.9.cvs.20050518-4) unstable; urgency=low + + * New pkgconfig file. Patch by Matthieu Gallien + Closes: #420813. + * Fix the following lintian issues: + W: libedit source: debian-rules-sets-DH_COMPAT line 7 + W: libedit source: package-uses-deprecated-debhelper-compat-version 2 + W: libedit source: substvar-source-version-is-deprecated libedit-dev + + -- Anibal Monsalve Salazar Tue, 07 Aug 2007 18:53:29 +1000 + +libedit (2.9.cvs.20050518-3) unstable; urgency=low + + * New maintainer. + * ACKed NMU. Closes: #318843. + * Standards-Version: 3.7.2. + * libedit2: added dependency on ${misc:Depends}. + + -- Anibal Monsalve Salazar Wed, 07 Feb 2007 10:20:20 +1100 + +libedit (2.9.cvs.20050518-2.2) unstable; urgency=low + + * NMU + * Unfortunately, rl_completion_matches have to be exported. + + -- Piotr Roszatycki Mon, 1 Aug 2005 19:05:13 +0200 + +libedit (2.9.cvs.20050518-2.1) unstable; urgency=low + + * NMU + * Export completion_matches function. Closes: #318843. + + -- Piotr Roszatycki Mon, 1 Aug 2005 16:59:48 +0200 + +libedit (2.9.cvs.20050518-2) unstable; urgency=low + + * Workaround for wrong permissions in source (closes: #309843) + + -- Pawel Wiecek Fri, 20 May 2005 12:15:12 +0200 + +libedit (2.9.cvs.20050518-1) unstable; urgency=low + + * Updated sources from CVS (closes: #286356) + + -- Pawel Wiecek Wed, 18 May 2005 23:36:58 +0200 + +libedit (2.9.cvs.20040827-1) unstable; urgency=low + + * Updated sources from CVS (closes: #254031, #263421) + + -- Pawel Wiecek Tue, 31 Aug 2004 00:06:38 +0200 + +libedit (2.6.cvs.20020109-7) unstable; urgency=low + + * Applied patch from Robert Millan to fix some issues on + GNU/k*BSD ports (closes: #227123) + + -- Pawel Wiecek Fri, 16 Jan 2004 16:45:42 +0100 + +libedit (2.6.cvs.20020109-6) unstable; urgency=low + + * Finally applied the right way to workaround mips building problems (thanks + to Colin Watson and Steve Langasek) (closes: #213100) + * Updated standards version (no changes needed) + + -- Pawel Wiecek Thu, 2 Oct 2003 21:32:09 +0200 + +libedit (2.6.cvs.20020109-5) unstable; urgency=low + + * Made patches from 2.6.cvs.20020109-4 really work (closes: #207448) + + -- Pawel Wiecek Wed, 27 Aug 2003 19:45:28 +0200 + +libedit (2.6.cvs.20020109-4) unstable; urgency=low + + * Applied patch from Ben Burton to fix the problem with + typing tab characters (closes: #169804, #169813, #196326) + * Updated standards version + * Updated package sections (moved libedit2-dev to libdevel) + * Fixed 05-readline-Makefile-mipseb.dpatch (closes: #188669) + + -- Pawel Wiecek Wed, 18 Jun 2003 13:13:54 +0200 + +libedit (2.6.cvs.20020109-3) unstable; urgency=low + + * Finally a maintainer release (closes: #166125) + * Updated the copyright file (closes: #188404) + * Updated standards version + + -- Pawel Wiecek Fri, 25 Apr 2003 15:38:01 +0200 + +libedit (2.6.cvs.20020109-2.1) unstable; urgency=low + + * NMU + * Patched fgetln() to behave correctly on error, thus fixing a + read_history() bug that caused infinite memory consumption + (closes: #166125) + + -- Ben Burton Fri, 31 Jan 2003 01:43:29 +1100 + +libedit (2.6.cvs.20020109-2) unstable; urgency=low + + * Added patch to correctly build on mips (closes: #135333) + + -- Pawel Wiecek Wed, 27 Feb 2002 14:42:46 +0100 + +libedit (2.6.cvs.20020109-1) unstable; urgency=low + + * Updated sources from CVS (closes: #122636) + + -- Pawel Wiecek Wed, 9 Jan 2002 10:58:25 +0100 + +libedit (2.6.cvs.20011104-2) unstable; urgency=low + + * New maintainer (closes: #120652) + + -- Pawel Wiecek Fri, 23 Nov 2001 13:49:44 +0100 + +libedit (2.6.cvs.20011104-1) unstable; urgency=low + + * New upstream version + * debian/patches/03-el.c-MAXPATHLEN.dpatch: ported to new snapshot + * debian/patches/02-el.c-issetugid.dpatch: likewise + * debian/rules: bumped version + * debian/libedit2.files: moved from 2.5 to 2.6 + + -- Gergely Nagy Sun, 4 Nov 2001 02:44:43 +0100 + +libedit (2.5.cvs.20010821-7) unstable; urgency=low + + * The `Someone teach me C' release + * debian/patches/03-el.c-MAXPATHLEN.dpatch: Fixed the patch, so the + MAXPATHLEN and non-MAXPATHLEN cases don't mix (what a silly typo!). + This way, there won't be any segfault. (Closes: #111819) + * debian/rules (PMAKE_ARGS): added -lcurses to LDADD (Closes: #111821) + * debian/patches/04-readline.h-stdio.dpatch: new patch, which adds an + #include to readline.h + * debian/patches/00list: added the new patch (Closes: #111820) + + -- Gergely Nagy Tue, 11 Sep 2001 13:57:36 +0200 + +libedit (2.5.cvs.20010821-6) unstable; urgency=low + + * debian/rules (cvs-update): okay, this time it actually works + * debian/control: versioned dependency on fixed pmake, thanks Steve! + * debian/scripts/ld-hack.sh: removed, since new pmake solves some + of our problems + * debian/rules: removed some of the pmake workarounds, added others + + -- Gergely Nagy Sun, 9 Sep 2001 04:03:47 +0200 + +libedit (2.5.cvs.20010821-5) unstable; urgency=low + + * debian/control: priority set to optional, as per the request of + Ben Burton . + * debian/scripts/ld-hack.sh: wrapper around gcc to fool pmake + * debian/rules: use ld-hack.sh and an appropriate SHLIB_SHFLAGS + to work around pmake, which tries to link with ld instead of gcc. + This fixes the build problem on at least hppa. + + -- Gergely Nagy Wed, 5 Sep 2001 15:08:59 +0200 + +libedit (2.5.cvs.20010821-4) unstable; urgency=low + + * Added bsdmainutils to the build-depends (Closes: #111041) + + -- Gergely Nagy Mon, 3 Sep 2001 18:53:44 +0200 + +libedit (2.5.cvs.20010821-3) unstable; urgency=low + + * debian/rules (unpatch): use sort -r instead of tac + (glibc-compat, libedit-${DATE}): superceded by new cvs-update + (cvs-update): completely rewrote, more robust and elegant + * debian/patches/03-el.c-MAXPATHLEN.dpatch: on systems without + MAXPATHLEN, allocate memory dynamicaly. This fixes the build on + the Hurd. + * glibc-bsd-compat/bsd-compat.h: Added #include + to eliminate XTABS redefinition in libedit-20010821/tty.h + + -- Gergely Nagy Mon, 3 Sep 2001 12:34:55 +0200 + +libedit (2.5.cvs.20010821-2) unstable; urgency=low + + * Added missing build-dependency on libncurses5-dev (Closes: #110579) + * While there, added a dependency on that one to libedit-dev + + -- Gergely Nagy Thu, 30 Aug 2001 11:27:02 +0200 + +libedit (2.5.cvs.20010821-1) unstable; urgency=low + + * Initial release (Closes: #109398) + + -- Gergely Nagy Sat, 25 Aug 2001 11:59:34 +0200 --- libedit-2.11~20080614.orig/debian/patches/11-357594-vis.h.diff +++ libedit-2.11~20080614/debian/patches/11-357594-vis.h.diff @@ -0,0 +1,34 @@ + 11-357594-vis.h.diff by Robert Millan + minor adaptation for Glibc + http://bugs.debian.org/357594 + +--- a/glibc-compat/vis.h 2005-09-13 11:44:32.000000000 +1000 ++++ a/glibc-compat/vis.h 2008-06-15 12:51:31.000000000 +1000 +@@ -40,7 +40,7 @@ + * to select alternate encoding format + */ + #define VIS_OCTAL 0x01 /* use octal \ddd format */ +-#define VIS_CSTYLE 0x02 /* use \[nrft0..] where appropiate */ ++#define VIS_CSTYLE 0x02 /* use \[nrft0..] where appropriate */ + + /* + * to alter set of characters encoded (default is to encode all +@@ -57,6 +57,7 @@ + */ + #define VIS_NOSLASH 0x40 /* inhibit printing '\' */ + #define VIS_HTTPSTYLE 0x80 /* http-style escape % HEX HEX */ ++#define VIS_GLOB 0x100 /* encode glob(3) magics */ + + /* + * unvis return codes +@@ -83,9 +84,7 @@ + int strsvisx(char *, const char *, size_t, int, const char *); + int strunvis(char *, const char *); + int strunvisx(char *, const char *, int); +-#ifndef __LIBC12_SOURCE__ +-int unvis(char *, int, int *, int) __RENAME(__unvis13); +-#endif ++int unvis(char *, int, int *, int); + __END_DECLS + + #endif /* !_VIS_H_ */ --- libedit-2.11~20080614.orig/debian/patches/20-fortify.patch +++ libedit-2.11~20080614/debian/patches/20-fortify.patch @@ -0,0 +1,23 @@ +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=488456 + +Patch by Kees Cook + +Index: libedit-2.11~20080614/libedit/vi.c +=================================================================== +--- libedit-2.11~20080614/libedit/vi.c 2008-06-28 17:57:32.000000000 -0700 ++++ libedit-2.11~20080614/libedit/vi.c 2008-06-28 17:59:14.000000000 -0700 +@@ -1012,8 +1012,12 @@ + if (fd < 0) + return CC_ERROR; + cp = el->el_line.buffer; +- write(fd, cp, el->el_line.lastchar - cp +0u); +- write(fd, "\n", 1); ++ if (write(fd, cp, el->el_line.lastchar - cp +0u)<0 || ++ write(fd, "\n", 1)<0) { ++ close(fd); ++ unlink(tempfile); ++ return CC_ERROR; ++ } + pid = fork(); + switch (pid) { + case -1: --- libedit-2.11~20080614.orig/debian/patches/08-readline-history.h.diff +++ libedit-2.11~20080614/debian/patches/08-readline-history.h.diff @@ -0,0 +1,18 @@ + 08-readline-history.h.diff by Pawel Wiecek + (compatibility with older versions) + + Setting the global variable rl_inhibit_completion to 1 did indeed + disable completion, but the invoking key (e.g., ) was not + inserted directly into the input line as it should be. + This patch fixes this problem, and also declares rl_inhibit_completion + in readline.h for better readline compatibility. + +--- a/libedit/readline/Makefile ++++ a/libedit/readline/Makefile +@@ -10,4 +10,6 @@ + INCSDIR= /usr/include/readline + INCSYMLINKS= readline.h ${INCSDIR}/history.h + ++incinstall:: linksinstall ++ + .include --- libedit-2.11~20080614.orig/debian/patches/04-readline.h-stdio.diff +++ libedit-2.11~20080614/debian/patches/04-readline.h-stdio.diff @@ -0,0 +1,15 @@ + 04-readline.h-stdio.diff by Gergely Nagy + + since readline.h uses types defined in stdio.h, that header should + be included + +--- a/libedit/readline/readline.h ++++ a/libedit/readline/readline.h +@@ -38,6 +38,7 @@ + #ifndef _READLINE_H_ + #define _READLINE_H_ + ++#include + #include + + /* list of readline stuff supported by editline library's readline wrapper */ --- libedit-2.11~20080614.orig/debian/patches/10-define_SIZE_T_MAX.diff +++ libedit-2.11~20080614/debian/patches/10-define_SIZE_T_MAX.diff @@ -0,0 +1,16 @@ + 10-define_SIZE_T_MAX.diff by Anibal Monsalve Salazar + define SIZE_T_MAX as UINT_MAX in limits.h + +--- a/libedit/readline.c 2008-04-29 16:53:01.000000000 +1000 ++++ a/libedit/readline.c 2008-06-14 23:54:16.000000000 +1000 +@@ -61,6 +61,10 @@ __RCSID("$NetBSD: readline.c,v 1.75 2008 + #include "readline/readline.h" + #include "filecomplete.h" + ++#ifndef SIZE_T_MAX ++#define SIZE_T_MAX UINT_MAX ++#endif ++ + void rl_prep_terminal(int); + void rl_deprep_terminal(void); + --- libedit-2.11~20080614.orig/debian/patches/series +++ libedit-2.11~20080614/debian/patches/series @@ -0,0 +1,11 @@ +01-Makefile.diff +02-el.c-issetugid.diff +03-el.c-MAXPATHLEN.diff +04-readline.h-stdio.diff +06-fgetln.c-error.diff +08-readline-history.h.diff +10-define_SIZE_T_MAX.diff +11-357594-vis.h.diff +12-libedit-Makefile.diff +13-symbol_not_found.diff +20-fortify.patch --- libedit-2.11~20080614.orig/debian/patches/12-libedit-Makefile.diff +++ libedit-2.11~20080614/debian/patches/12-libedit-Makefile.diff @@ -0,0 +1,52 @@ + 12-libedit-Makefile.diff by Anibal Monsalve Salazar + without this patch I get the following message: + make: ${_MKTARGET_CREATE} expands to empty string + +--- a/libedit/Makefile 2007-05-28 22:06:18.000000000 +1000 ++++ a/libedit/Makefile 2008-06-15 13:53:50.000000000 +1000 +@@ -52,45 +52,37 @@ CLEANFILES+= ${AHDR} fcns.h help.h fcns. + SUBDIR= readline + + vi.h: vi.c makelist Makefile +- ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + + emacs.h: emacs.c makelist Makefile +- ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/emacs.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + + common.h: common.c makelist Makefile +- ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/common.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + + fcns.h: ${AHDR} makelist Makefile +- ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -fh ${AHDR} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + + fcns.c: ${AHDR} fcns.h help.h makelist Makefile +- ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -fc ${AHDR} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + + help.c: ${ASRC} makelist Makefile +- ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -bc ${ASRC} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + + help.h: ${ASRC} makelist Makefile +- ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -bh ${ASRC} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + + editline.c: ${OSRCS} makelist Makefile +- ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -e ${OSRCS:T} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + --- libedit-2.11~20080614.orig/debian/patches/01-Makefile.diff +++ libedit-2.11~20080614/debian/patches/01-Makefile.diff @@ -0,0 +1,36 @@ + 01-Makefile.diff by Neal H Walfield and + Gergely Nagy + + Add the necessary includes and other things to the libedit + Makefile, so it will compile on GNU systems, with our supplied + glue code + +--- a/libedit/Makefile 2007-05-28 22:06:18.000000000 +1000 ++++ a/libedit/Makefile 2008-06-14 18:43:26.000000000 +1000 +@@ -1,6 +1,15 @@ + # $NetBSD: Makefile,v 1.36 2007/05/28 12:06:18 tls Exp $ + # @(#)Makefile 8.1 (Berkeley) 6/4/93 + ++OS!= sh -c "case `uname -s` in GNU|GNU/*) echo GNU ;; *) uname -s ;; esac" ++ ++.if ${OS} == GNU || ${OS} == Linux ++CPPFLAGS+=-I../glibc-compat -I../glibc-bsd-glue ++CFLAGS += -include ../glibc-bsd-glue/bsdcompat.h ++.PATH: ${.CURDIR}/../glibc-bsd-glue ${.CURDIR}/../glibc-compat ++MKLINT=no ++.endif ++ + USE_SHLIBDIR= yes + + WARNS= 3 +@@ -12,6 +21,10 @@ OSRCS= chared.c common.c el.c emacs.c fc + key.c map.c \ + parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c + ++.if ${OS} == GNU || ${OS} == Linux ++OSRCS+= fgetln.c vis.c unvis.c strlcat.c strlcpy.c ++.endif ++ + MAN= editline.3 editrc.5 + + MLINKS= editline.3 el_init.3 editline.3 el_end.3 editline.3 el_reset.3 \ --- libedit-2.11~20080614.orig/debian/patches/02-el.c-issetugid.diff +++ libedit-2.11~20080614/debian/patches/02-el.c-issetugid.diff @@ -0,0 +1,22 @@ + 02-el.c-issetugid.diff by Gergely Nagy + + issetugid(2) is not implemented on GNU systems, so #ifdef it out + +--- a/libedit/el.c ++++ a/libedit/el.c +@@ -435,12 +435,14 @@ + + fp = NULL; + if (fname == NULL) { +-#ifdef HAVE_ISSETUGID ++#if 1 + static const char elpath[] = "/.editrc"; + char path[MAXPATHLEN]; + ++#ifndef __GLIBC__ + if (issetugid()) + return (-1); ++#endif + if ((ptr = getenv("HOME")) == NULL) + return (-1); + if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path)) --- libedit-2.11~20080614.orig/debian/patches/06-fgetln.c-error.diff +++ libedit-2.11~20080614/debian/patches/06-fgetln.c-error.diff @@ -0,0 +1,24 @@ + 06-fgetln.c-error.diff by Ben Burton + + Routine fgetln() was behaving incorrectly on error (such as when + EOF was reached), which in turn caused infinite memory consumption + during read_history(). + +--- a/glibc-bsd-glue/fgetln.c ++++ a/glibc-bsd-glue/fgetln.c +@@ -5,9 +5,10 @@ + { + char *line=NULL; + +- getline (&line, len, stream); +- +- (*len)--; /* get rid of the trailing \0, fgetln +- does not have it */ +- return line; ++ if (getline (&line, len, stream) >= 0) { ++ (*len)--; /* get rid of the trailing \0, fgetln ++ does not have it */ ++ return line; ++ } else ++ return NULL; + } --- libedit-2.11~20080614.orig/debian/patches/03-el.c-MAXPATHLEN.diff +++ libedit-2.11~20080614/debian/patches/03-el.c-MAXPATHLEN.diff @@ -0,0 +1,38 @@ + 03-el.c-MAXPATHLEN.diff by Gergely Nagy + + on systems without MAXPATHLEN, allocate memory dynamically + +--- a/libedit/el.c ++++ a/libedit/el.c +@@ -437,7 +437,11 @@ + if (fname == NULL) { + #if 1 + static const char elpath[] = "/.editrc"; ++#ifdef MAXPATHLEN + char path[MAXPATHLEN]; ++#else ++ char *path; ++#endif + + #ifndef __GLIBC__ + if (issetugid()) +@@ -421,10 +426,19 @@ + #endif + if ((ptr = getenv("HOME")) == NULL) + return (-1); ++#ifndef MAXPATHLEN ++ path = (char *)malloc(strlen(ptr) + strlen(elpath) + 10); ++ if (path == NULL) ++ return (-1); ++ /* Always succeeds, since we have enouh memory */ ++ strcpy(path, ptr); ++ strcat(path, elpath); ++#else + if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path)) + return (-1); + if (strlcat(path, elpath, sizeof(path)) >= sizeof(path)) + return (-1); ++#endif + fname = path; + } + if (fp == NULL) --- libedit-2.11~20080614.orig/debian/patches/13-symbol_not_found.diff +++ libedit-2.11~20080614/debian/patches/13-symbol_not_found.diff @@ -0,0 +1,100 @@ + 13-symbol_not_found.diff by Anibal Monsalve Salazar + Without this patch I get the following messages: + dpkg-shlibdeps: warning: symbol strlcpy used by debian/libedit2/usr/lib/libedit.so.2.11 found in none of the libraries. + dpkg-shlibdeps: warning: symbol strlcat used by debian/libedit2/usr/lib/libedit.so.2.11 found in none of the libraries. + +--- a/glibc-compat/namespace.h 2008-04-29 06:23:00.000000000 +1000 ++++ a/glibc-compat/namespace.h 2008-06-15 17:39:10.000000000 +1000 +@@ -52,8 +52,6 @@ + #define pipe _pipe + #define sbrk _sbrk + #define strerror_r _strerror_r +-#define strlcat _strlcat +-#define strlcpy _strlcpy + #define strtof _strtof + #define strtoimax _strtoimax + #define strtold _strtold +--- a/glibc-compat/strlcat.c 2007-06-05 04:19:27.000000000 +1000 ++++ a/glibc-compat/strlcat.c 2008-06-15 22:45:39.000000000 +1000 +@@ -17,34 +17,15 @@ + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +-#if !defined(_KERNEL) && !defined(_STANDALONE) +-#if HAVE_NBTOOL_CONFIG_H +-#include "nbtool_config.h" +-#endif +- + #include + #if defined(LIBC_SCCS) && !defined(lint) + __RCSID("$NetBSD: strlcat.c,v 1.3 2007/06/04 18:19:27 christos Exp $"); + #endif /* LIBC_SCCS and not lint */ + +-#ifdef _LIBC +-#include "namespace.h" +-#endif + #include + #include + #include + +-#ifdef _LIBC +-# ifdef __weak_alias +-__weak_alias(strlcat, _strlcat) +-# endif +-#endif +- +-#else +-#include +-#endif /* !_KERNEL && !_STANDALONE */ +- +-#if !HAVE_STRLCAT + /* + * Appends src to string dst of size siz (unlike strncat, siz is the + * full size of dst, not space left). At most siz-1 characters +@@ -82,4 +63,3 @@ + + return(dlen + (s - src)); /* count does not include NUL */ + } +-#endif +--- a/glibc-compat/strlcpy.c 2007-06-05 04:19:27.000000000 +1000 ++++ a/glibc-compat/strlcpy.c 2008-06-15 22:45:50.000000000 +1000 +@@ -17,34 +17,15 @@ + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +-#if !defined(_KERNEL) && !defined(_STANDALONE) +-#if HAVE_NBTOOL_CONFIG_H +-#include "nbtool_config.h" +-#endif +- + #include + #if defined(LIBC_SCCS) && !defined(lint) + __RCSID("$NetBSD: strlcpy.c,v 1.3 2007/06/04 18:19:27 christos Exp $"); + #endif /* LIBC_SCCS and not lint */ + +-#ifdef _LIBC +-#include "namespace.h" +-#endif + #include + #include + #include + +-#ifdef _LIBC +-# ifdef __weak_alias +-__weak_alias(strlcpy, _strlcpy) +-# endif +-#endif +-#else +-#include +-#endif /* !_KERNEL && !_STANDALONE */ +- +- +-#if !HAVE_STRLCPY + /* + * Copy src to string dst of size siz. At most siz-1 characters + * will be copied. Always NUL terminates (unless siz == 0). +@@ -78,4 +59,3 @@ + + return(s - src - 1); /* count does not include NUL */ + } +-#endif