summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/adelie-base/APKBUILD6
-rw-r--r--system/console-setup/APKBUILD49
-rw-r--r--system/console-setup/console-setup.initd32
-rw-r--r--system/execline/APKBUILD4
-rw-r--r--system/kbd/APKBUILD32
-rw-r--r--system/kbd/consolefont.confd20
-rw-r--r--system/kbd/consolefont.initd70
-rw-r--r--system/kbd/keymaps.confd24
-rw-r--r--system/kbd/keymaps.initd77
-rw-r--r--system/man-db/APKBUILD44
-rw-r--r--system/man-db/man-db-2.8.5-iconv.patch65
-rw-r--r--system/man-db/man-db.trigger3
-rw-r--r--system/mandoc/APKBUILD94
-rw-r--r--system/mandoc/cgi-adelie.patch60
-rw-r--r--system/mandoc/cgi-gz.patch77
-rw-r--r--system/mandoc/cgi-search.patch48
-rw-r--r--system/mandoc/configure.patch21
-rw-r--r--system/mandoc/doc.patch132
-rw-r--r--system/mandoc/empty-tbl-null-deref.patch62
-rw-r--r--system/mandoc/less.patch58
-rw-r--r--system/mandoc/mandoc.post-deinstall3
-rw-r--r--system/mandoc/mandoc.trigger3
-rw-r--r--system/mandoc/tbl-colwidth-oob.patch62
-rw-r--r--system/nvi/APKBUILD17
-rw-r--r--system/openrc/0007-make-consolefont-service-compatible-with-busyboxs-se.patch70
-rw-r--r--system/openrc/APKBUILD11
-rw-r--r--system/openrc/openrc.post-install2
-rw-r--r--system/skalibs/APKBUILD4
-rw-r--r--system/unzip/10-unzip-handle-pkware-verify.patch21
-rw-r--r--system/unzip/20-unzip-uidgid-fix.patch29
-rw-r--r--system/unzip/APKBUILD31
-rw-r--r--system/unzip/unzip-6.0-heap-overflow-infloop.patch104
32 files changed, 890 insertions, 445 deletions
diff --git a/system/adelie-base/APKBUILD b/system/adelie-base/APKBUILD
index 04b100e69..7cd92003d 100644
--- a/system/adelie-base/APKBUILD
+++ b/system/adelie-base/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=adelie-base
pkgver=0.9.4
-pkgrel=0
+pkgrel=2
pkgdesc="The Adélie Linux Base System"
url="https://www.adelielinux.org/"
arch="noarch"
@@ -13,8 +13,8 @@ _core_depends="apk-tools adelie-keys musl-utils shadow
coreutils diffutils findutils
util-linux net-tools
nvi sed psmisc less tzdata"
-depends="adelie-core binutils console-setup debianutils file gettys-openrc
- libarchive-tools man-db patch sed sharutils sysklogd zsh"
+depends="adelie-core binutils debianutils file gettys-openrc
+ kbd libarchive-tools mandoc patch sed sharutils sysklogd zsh"
makedepends=""
makedepends_host="$depends"
subpackages="adelie-core:core $pkgname-doc $pkgname-posix $pkgname-lsb dev
diff --git a/system/console-setup/APKBUILD b/system/console-setup/APKBUILD
deleted file mode 100644
index b1e1b4c76..000000000
--- a/system/console-setup/APKBUILD
+++ /dev/null
@@ -1,49 +0,0 @@
-# Contributor: A. Wilcox <awilfox@adelielinux.org>
-# Maintainer: A. Wilcox <awilfox@adelielinux.org>
-pkgname=console-setup
-pkgver=1.195
-pkgrel=0
-pkgdesc="Tools for configuring the console using X Window System key maps"
-url="https://salsa.debian.org/installer-team/console-setup"
-arch="noarch"
-options="!check" # No test suite.
-license="MIT AND GPL-2.0+ AND BSD-3-Clause"
-depends="ckbcomp kbd"
-makedepends="perl"
-subpackages="$pkgname-doc console-fonts:fonts console-keymaps:keymaps
- $pkgname-openrc ckbcomp"
-source="http://ftp.de.debian.org/debian/pool/main/c/$pkgname/${pkgname}_$pkgver.tar.xz
- console-setup.initd
- "
-builddir="$srcdir/$pkgname"
-
-build() {
- make build-linux
-}
-
-package() {
- make prefix="$pkgdir/usr" etcdir="$pkgdir/etc" xkbdir= install-linux
- install -D -m755 "$srcdir"/console-setup.initd "$pkgdir"/etc/init.d/console-setup
-}
-
-fonts() {
- pkgdesc="Console fonts for use with $pkgname"
- mkdir -p "$subpkgdir"/usr/share
- mv "$pkgdir"/usr/share/consolefonts "$subpkgdir"/usr/share/
-}
-
-keymaps() {
- pkgdesc="Keyboard layouts for use with $pkgname"
- mkdir -p "$subpkgdir"/etc/console-setup
- mv "$pkgdir"/etc/console-setup/ckb "$subpkgdir"/etc/console-setup/
-}
-
-ckbcomp() {
- pkgdesc="XKB keyboard layout translation utility"
- depends="perl"
- mkdir -p "$subpkgdir"/usr/bin
- mv "$pkgdir"/usr/bin/ckbcomp "$subpkgdir"/usr/bin/
-}
-
-sha512sums="f9ee8df45cfb78dea12b1ba3020e32f245dd940bc1d22801849f673f4448853c0ebadb6944a92b462e3e56c59ee13fd6d2130c260a1a406e1bb1c72e9902c04d console-setup_1.195.tar.xz
-3b8e2c9d8551f9a51bcd33e58771a4f55ff2840f8fe392e0070bd2b6a3911cd9ed9377873538f6904fd99836ac4e0280c712be69d275aae9183dd12ff7efddae console-setup.initd"
diff --git a/system/console-setup/console-setup.initd b/system/console-setup/console-setup.initd
deleted file mode 100644
index bf3479566..000000000
--- a/system/console-setup/console-setup.initd
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/sbin/openrc-run
-# Copyright (c) 2007-2015 The OpenRC Authors.
-# See the Authors file at the top-level directory of this distribution and
-# https://github.com/OpenRC/openrc/blob/master/AUTHORS
-#
-# This file is part of OpenRC. It is subject to the license terms in
-# the LICENSE file found in the top-level directory of this
-# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
-# This file may not be copied, modified, propagated, or distributed
-# except according to the terms contained in the LICENSE file.
-
-description="Applies a keymap and font for the consoles."
-
-depend()
-{
- provide keymaps
- need localmount termencoding
- after bootmisc
- keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
-}
-
-start()
-{
- # Force linux keycodes for PPC.
- if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ]; then
- echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
- fi
-
- ebegin "Loading default key mappings / font"
- setupcon
- eend $? "Error loading key mappings / font" || return $?
-}
diff --git a/system/execline/APKBUILD b/system/execline/APKBUILD
index 252daeb63..bc7328ea3 100644
--- a/system/execline/APKBUILD
+++ b/system/execline/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Laurent Bercot <ska-adelie@skarnet.org>
# Maintainer: Laurent Bercot <ska-adelie@skarnet.org>
pkgname=execline
-pkgver=2.6.0.0
+pkgver=2.6.0.2
pkgrel=0
pkgdesc="A small scripting language for non-interactive scripts"
url="https://skarnet.org/software/$pkgname/"
@@ -62,4 +62,4 @@ doc() {
cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
}
-sha512sums="890a533a6ffad98b066adda34ae4a7e69daa98950974fcdb4635cff4c8957851b7fc6beaf25802c7ed5085285fc9b2aa9d9806afdb1aaa6884745a978b969f7a execline-2.6.0.0.tar.gz"
+sha512sums="915823af0d557fc7a181e088ce319568e62ea4bf743704e498786422c97b991e6b09447c7cff7d7dda520d391773ef4b2fea68e44479c02766966256719bb4c0 execline-2.6.0.2.tar.gz"
diff --git a/system/kbd/APKBUILD b/system/kbd/APKBUILD
index d54e7f29c..deb7fb205 100644
--- a/system/kbd/APKBUILD
+++ b/system/kbd/APKBUILD
@@ -2,9 +2,9 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=kbd
pkgver=2.2.0_git20190823
-pkgrel=0
+pkgrel=1
pkgdesc="Console keyboard and font management utilities"
-url=" "
+url="https://kbd-project.org/"
arch="all"
options="!check" # padding error on at least ppc64
license="GPL-2.0+"
@@ -12,8 +12,13 @@ depends=""
checkdepends="check-dev"
makedepends="linux-headers linux-pam-dev autoconf automake libtool"
subpackages="$pkgname-doc $pkgname-fonts::noarch $pkgname-keymaps::noarch
- $pkgname-lang"
-source="https://dev.sick.bike/dist/$pkgname-$pkgver.tar.xz"
+ $pkgname-lang $pkgname-openrc"
+source="https://dev.sick.bike/dist/$pkgname-$pkgver.tar.xz
+ consolefont.confd
+ consolefont.initd
+ keymaps.confd
+ keymaps.initd
+ "
prepare() {
default_prepare
@@ -37,6 +42,19 @@ check() {
package() {
make DESTDIR="$pkgdir" install
+
+ for i in consolefont keymaps; do
+ install -Dm644 "$srcdir"/$i.confd \
+ "$pkgdir"/etc/conf.d/$i
+ install -Dm755 "$srcdir"/$i.initd \
+ "$pkgdir"/etc/init.d/$i
+ done
+}
+
+openrc() {
+ default_openrc
+ license="BSD-2-Clause"
+ replaces="openrc<0.24.1-r10"
}
fonts() {
@@ -52,4 +70,8 @@ keymaps() {
mv "$pkgdir"/usr/share/unimaps "$subpkgdir"/usr/share/
}
-sha512sums="7f6202aeb17d6224095447a92d999478220457e1e7cadb90a7c40ca7f3b0c5b1f672db1995fb69652ca37558a75df582bfb5fea5772f3b1e040fe39f8f54504e kbd-2.2.0_git20190823.tar.xz"
+sha512sums="7f6202aeb17d6224095447a92d999478220457e1e7cadb90a7c40ca7f3b0c5b1f672db1995fb69652ca37558a75df582bfb5fea5772f3b1e040fe39f8f54504e kbd-2.2.0_git20190823.tar.xz
+19761fdd2b32c1bbcc9254b89b7893741e144b917a75410af3f274553fe61e2f56cbbd17ff77ac929e9377604663cbbfd9e53c73e7d41e71de6de573730950c7 consolefont.confd
+1e67f75f27ec5de8f71489c83f78e53e8fd0925ae2d82dabf516f98905c5aff206a8e943e92b6af413eae5f0ecb9c2240526dfc3c56811a8dc1d19ced561bba3 consolefont.initd
+af7d37fc6be1382414ca8245ca6f8d2ee8b82650b8a08eebbd980cf6dd2b92524fce2851ce0b2cd67e915488c12044ab50c5ab1f01c3072af87eed3e058ac268 keymaps.confd
+510d7eb582a914fa7cfb868d0c3d55a21ee1519033117d0943a153528b5810d09f6421ddc02d93906c1a66fb7e07e86240f38dad0d38cfb5a8c7e9a6335a937f keymaps.initd"
diff --git a/system/kbd/consolefont.confd b/system/kbd/consolefont.confd
new file mode 100644
index 000000000..4c41d0633
--- /dev/null
+++ b/system/kbd/consolefont.confd
@@ -0,0 +1,20 @@
+# The consolefont service is not activated by default. If you need to
+# use it, you should run "rc-update add consolefont boot" as root.
+#
+# consolefont specifies the default font that you'd like Linux to use on the
+# console. You will have to install a package such as kbd-fonts or
+# terminus-font to have a selection; they will be installed in
+# /usr/share/consolefonts.
+#
+# The following (from terminus-font) is a good font for HiDPI screens.
+#consolefont="ter-i32n"
+
+# consoletranslation is the charset map file to use. Leave commented to use
+# the default one. Have a look in /usr/share/consoletrans for a selection of
+# map files you can use.
+#consoletranslation="8859-1_to_uni"
+
+# unicodemap is the unicode map file to use. Leave commented to use the
+# default one. Have a look in /usr/share/unimaps (from the kbd-keymaps
+# package) for a selection of map files you can use.
+#unicodemap="iso01"
diff --git a/system/kbd/consolefont.initd b/system/kbd/consolefont.initd
new file mode 100644
index 000000000..63d8601c5
--- /dev/null
+++ b/system/kbd/consolefont.initd
@@ -0,0 +1,70 @@
+#!/sbin/openrc-run
+# Copyright (c) 2007-2015 The OpenRC Authors.
+# See the Authors file at the top-level directory of this distribution and
+# https://github.com/OpenRC/openrc/blob/master/AUTHORS
+#
+# This file is part of OpenRC. It is subject to the license terms in
+# the LICENSE file found in the top-level directory of this
+# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
+# This file may not be copied, modified, propagated, or distributed
+# except according to the terms contained in the LICENSE file.
+
+description="Sets a font for the consoles."
+
+depend()
+{
+ need localmount termencoding
+ after hotplug bootmisc modules
+ keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
+}
+
+start()
+{
+ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
+ consolefont=${consolefont:-${CONSOLEFONT}}
+ unicodemap=${unicodemap:-${UNICODEMAP}}
+ consoletranslation=${consoletranslation:-${CONSOLETRANSLATION}}
+
+ if [ -z "$consolefont" ]; then
+ ebegin "Using the default console font"
+ eend 0
+ return 0
+ fi
+
+ if [ "$ttyn" = 0 ]; then
+ ebegin "Skipping font setup (rc_tty_number == 0)"
+ eend 0
+ return 0
+ fi
+
+ local x= param= sf_param= retval=0 ttydev=/dev/tty
+
+ # Get additional parameters
+ if [ -n "$consoletranslation" ]; then
+ param="$param -m $consoletranslation"
+ fi
+ if [ -n "${unicodemap}" ]; then
+ param="$param -u $unicodemap"
+ fi
+
+ # Set the console font
+ ebegin "Setting console font [$consolefont]"
+ [ -d /dev/vc ] && ttydev=/dev/vc/
+ x=1
+ while [ $x -le $ttyn ]; do
+ if ! setfont $consolefont $param -C $ttydev$x >/dev/null; then
+ retval=1
+ break
+ fi
+ : $(( x += 1 ))
+ done
+ eend $retval
+
+ # Store the font so we can use it ASAP on boot
+ if [ $retval -eq 0 ] && checkpath -W "$RC_LIBEXECDIR"; then
+ mkdir -p "$RC_LIBEXECDIR"/console
+ setfont -O "$RC_LIBEXECDIR"/console/font
+ fi
+
+ return $retval
+}
diff --git a/system/kbd/keymaps.confd b/system/kbd/keymaps.confd
new file mode 100644
index 000000000..9a2863413
--- /dev/null
+++ b/system/kbd/keymaps.confd
@@ -0,0 +1,24 @@
+# Use keymap to specify the default console keymap. There is a complete tree
+# of keymaps in /usr/share/keymaps to choose from (from the kbd-keymaps
+# package).
+keymap="us"
+
+# Should we first load the 'windowkeys' console keymap? Most x86 users will
+# say "yes" here. Note that non-x86 users should leave it as "no".
+# Loading this keymap will enable VT switching (like ALT+Left/Right)
+# using the special windows keys on the linux console.
+windowkeys="NO"
+
+# The maps to load for extended keyboards. Most users will leave this as is.
+extended_keymaps=""
+#extended_keymaps="backspace keypad euro2"
+
+# Tell dumpkeys(1) to interpret character action codes to be
+# from the specified character set.
+# This only matters if you set unicode="yes" in /etc/rc.conf.
+# For a list of valid sets, run `dumpkeys --help`
+dumpkeys_charset=""
+
+# Some fonts map AltGr-E to the currency symbol instead of the Euro.
+# To fix this, set to "yes"
+fix_euro="NO"
diff --git a/system/kbd/keymaps.initd b/system/kbd/keymaps.initd
new file mode 100644
index 000000000..49e41b0e7
--- /dev/null
+++ b/system/kbd/keymaps.initd
@@ -0,0 +1,77 @@
+#!/sbin/openrc-run
+# Copyright (c) 2007-2015 The OpenRC Authors.
+# See the Authors file at the top-level directory of this distribution and
+# https://github.com/OpenRC/openrc/blob/master/AUTHORS
+#
+# This file is part of OpenRC. It is subject to the license terms in
+# the LICENSE file found in the top-level directory of this
+# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
+# This file may not be copied, modified, propagated, or distributed
+# except according to the terms contained in the LICENSE file.
+
+description="Applies a keymap for the consoles."
+
+depend()
+{
+ need localmount termencoding
+ after bootmisc
+ keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
+}
+
+start()
+{
+ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
+ : ${unicode:=$UNICODE}
+ : ${keymap:=$KEYMAP}
+ : ${extended_keymaps:=$EXTENDED_KEYMAPS}
+ : ${windowkeys:=$SET_WINDOWSKEYS}
+ : ${fix_euro:=$FIX_EURO}
+ : ${dumpkeys_charset:=${DUMPKEYS_CHARSET}}
+
+ if [ -z "$keymap" ]; then
+ eerror "You need to setup keymap in /etc/conf.d/keymaps first"
+ return 1
+ fi
+
+ local ttydev=/dev/tty n=
+ [ -d /dev/vc ] && ttydev=/dev/vc/
+
+ # Force linux keycodes for PPC.
+ if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ]; then
+ echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
+ fi
+
+ local wkeys= kmode="-a" msg="ASCII"
+ if yesno $unicode; then
+ kmode="-u"
+ msg="UTF-8"
+ fi
+ yesno $windowkeys && wkeys="windowkeys"
+
+ # Set terminal encoding to either ASCII or UNICODE.
+ # See utf-8(7) for more information.
+ ebegin "Setting keyboard mode [$msg]"
+ n=1
+ while [ $n -le $ttyn ]; do
+ kbd_mode $kmode -C $ttydev$n
+ : $(( n += 1 ))
+ done
+ eend 0
+
+ ebegin "Loading key mappings [$keymap]"
+ loadkeys -q $wkeys $keymap $extended_keymaps
+ eend $? "Error loading key mappings" || return $?
+
+ if yesno $fix_euro; then
+ ebegin "Fixing font for euro symbol"
+ # Fix some fonts displaying the Euro, #173528.
+ echo "altgr keycode 18 = U+20AC" | loadkeys -q -
+ eend $?
+ fi
+
+ # Save the keymapping for use immediately at boot
+ if checkpath -W "$RC_LIBEXECDIR"; then
+ mkdir -p "$RC_LIBEXECDIR"/console
+ dumpkeys >"$RC_LIBEXECDIR"/console/keymap
+ fi
+}
diff --git a/system/man-db/APKBUILD b/system/man-db/APKBUILD
deleted file mode 100644
index 136e0720d..000000000
--- a/system/man-db/APKBUILD
+++ /dev/null
@@ -1,44 +0,0 @@
-# Contributor: A. Wilcox <awilfox@adelielinux.org>
-# Maintainer: A. Wilcox <awilfox@adelielinux.org>
-pkgname=man-db
-pkgver=2.9.1
-pkgrel=0
-pkgdesc="The man command and related utilities for examining on-line help files"
-url="https://www.nongnu.org/man-db/"
-arch="all"
-options="!check" # requires //IGNORE in iconv
-license="GPL-2.0+"
-depends="groff gzip less"
-makedepends_host="db-dev libpipeline-dev zlib-dev"
-subpackages="$pkgname-doc $pkgname-lang"
-triggers="man-db.trigger=/usr/share/man"
-source="https://download.savannah.nongnu.org/releases/man-db/man-db-$pkgver.tar.xz
- man-db-2.8.5-iconv.patch
- "
-
-build() {
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --mandir=/usr/share/man \
- --localstatedir=/var \
- --disable-setuid \
- --with-sections="1 1p 1x 2 2x 3 3p 3x 4 4x 5 5x 6 6x 7 7x 8 8x 9 0p tcl n l p o" \
- --enable-nls \
- --with-db=db
- make
-}
-
-check() {
- make check
-}
-
-package() {
- make DESTDIR="$pkgdir" install
- rm -r "${pkgdir}"/usr/lib/tmpfiles.d # systemd
-}
-
-sha512sums="ae2d1e9f293795c63f5a9a1a765478a9a59cbe5fe6f759647be5057c1ae53f90baee8d5467921f3d0102300f2111a5026eeb25f78401bcb16ce45ad790634977 man-db-2.9.1.tar.xz
-0a68260fc48488408dc11855858aa2569efa3aeefd765c425b8fc988e7fee3e1d42e19eb299e518afc9b2ae54c5d37911176127124a43d5041f1137af0457097 man-db-2.8.5-iconv.patch"
diff --git a/system/man-db/man-db-2.8.5-iconv.patch b/system/man-db/man-db-2.8.5-iconv.patch
deleted file mode 100644
index c2232920d..000000000
--- a/system/man-db/man-db-2.8.5-iconv.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- man-db-2.8.5/src/man.c 2018-06-18 22:44:35.672743065 -0500
-+++ man-db-2.8.5/src/man.c 2018-06-18 22:46:35.032624890 -0500
-@@ -1516,15 +1516,13 @@
- {
- debug ("add_output_iconv: source %s, target %s\n", source, target);
- if (source && target && !STREQ (source, target)) {
-- char *target_translit = xasprintf ("%s//TRANSLIT", target);
- pipecmd *iconv_cmd;
- iconv_cmd = pipecmd_new_args
-- ("iconv", "-c", "-f", source, "-t", target_translit,
-+ ("iconv", "-c", "-f", source, "-t", target,
- (void *) 0);
- pipecmd_pre_exec (iconv_cmd, sandbox_load, sandbox_free,
- sandbox);
- pipeline_command (p, iconv_cmd);
-- free (target_translit);
- }
- }
-
---- man-db-2.8.5/src/manconv.c
-+++ man-db-2.8.5/src/manconv.c
-@@ -111,6 +111,5 @@ static int try_iconv (pipeline *p, const char *try_from_code, const char *to,
- iconv_t cd_utf8, cd = NULL;
-- bool to_utf8 = STREQ (try_to_code, "UTF-8") ||
-- STRNEQ (try_to_code, "UTF-8//", 7);
-- const char *utf8_target = last ? "UTF-8//IGNORE" : "UTF-8";
-- bool ignore_errors = (strstr (try_to_code, "//IGNORE") != NULL);
-+ bool to_utf8 = STREQ (try_to_code, "UTF-8");
-+ const char *utf8_target = "UTF-8";
-+ bool ignore_errors = 0;
- int ret = 0;
---- man-db-2.8.5/src/manconv_client.c
-+++ man-db-2.8.5/src/manconv_client.c
-@@ -102,7 +102,7 @@ void add_manconv (pipeline *p, const char *source, const char *target)
- codes->from[2] = NULL;
- name = appendstr (name, "UTF-8:", source, (void *) 0);
- }
-- codes->to = xasprintf ("%s//IGNORE", target);
-+ codes->to = xstrdup (target);
- /* informational only; no shell quoting concerns */
- name = appendstr (name, " -t ", codes->to, (void *) 0);
- if (quiet >= 2)
---- man-db-2.8.5/src/manconv_main.c
-+++ man-db-2.8.5/src/manconv_main.c
-@@ -106,9 +106,6 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
- return 0;
- case 't':
- to_code = xstrdup (arg);
-- if (!strstr (to_code, "//"))
-- to_code = appendstr (to_code, "//TRANSLIT",
-- (void *) 0);
- return 0;
- case 'd':
- debug_level = 1;
---- man-db-2.8.5/src/whatis.c
-+++ man-db-2.8.5/src/whatis.c
-@@ -945,7 +945,7 @@ int main (int argc, char *argv[])
- display_seen = hashtable_create (&null_hashtable_free);
-
- #ifdef HAVE_ICONV
-- locale_charset = xasprintf ("%s//IGNORE", get_locale_charset ());
-+ locale_charset = xstrdup (get_locale_charset ());
- conv_to_locale = iconv_open (locale_charset, "UTF-8");
- free (locale_charset);
- #endif /* HAVE_ICONV */
diff --git a/system/man-db/man-db.trigger b/system/man-db/man-db.trigger
deleted file mode 100644
index f9de5961c..000000000
--- a/system/man-db/man-db.trigger
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec /usr/bin/mandb /usr/share/man >/dev/null
diff --git a/system/mandoc/APKBUILD b/system/mandoc/APKBUILD
new file mode 100644
index 000000000..b3a4c018c
--- /dev/null
+++ b/system/mandoc/APKBUILD
@@ -0,0 +1,94 @@
+# Maintainer: Max Rees <maxcrees@me.com>
+pkgname=mandoc
+pkgver=1.14.5
+pkgrel=0
+pkgdesc="Manual page database, compiler, and viewer"
+url="https://mandoc.bsd.lv/"
+arch="all"
+license="ISC AND BSD-2-Clause AND BSD-3-Clause"
+replaces="man-db"
+depends="less"
+makedepends="zlib-dev"
+checkdepends="perl"
+subpackages="$pkgname-doc $pkgname-cgi"
+install="$pkgname.post-deinstall"
+triggers="$pkgname.trigger=/usr/share/man"
+source="https://mandoc.bsd.lv/snapshots/mandoc-$pkgver.tar.gz
+ configure.patch
+ empty-tbl-null-deref.patch
+ tbl-colwidth-oob.patch
+ less.patch
+ doc.patch
+ cgi-adelie.patch
+ cgi-gz.patch
+ cgi-search.patch
+ "
+
+prepare() {
+ default_prepare
+ cat >"configure.local" <<-EOF
+ PREFIX=/usr
+ MANDIR=/usr/share/man
+ WWWPREFIX=/var/lib/mandoc-cgi
+ # remove /usr/X11R6 from the following.
+ MANPATH_BASE=/usr/share/man
+ MANPATH_DEFAULT=/usr/share/man:/usr/local/share/man
+ # groff also provides a soelim.
+ BINM_SOELIM=mandoc-soelim
+
+ CFLAGS="$CFLAGS"
+ LDFLAGS="$LDFLAGS"
+ LN="ln -sf"
+ OSNAME="Adelie Linux"
+ UTF8_LOCALE=C.UTF-8
+
+ BUILD_CATMAN=1
+ BUILD_CGI=1
+ EOF
+
+ cat >"cgi.h" <<-EOF
+ #define SCRIPT_NAME ""
+ #define MAN_DIR "/var/lib/mandoc-cgi"
+ #define CSS_DIR ""
+ #define CUSTOMIZE_TITLE "Adelie Linux manual pages"
+ EOF
+}
+
+build() {
+ ./configure
+ make
+}
+
+check() {
+ make regress
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+ install -Dm644 -t "$pkgdir"/usr/share/man/man8 man.cgi.8
+
+ mkdir -p "$pkgdir"/etc
+ cat >"$pkgdir"/etc/man.conf <<-EOF
+ # See man.conf(5).
+ #manpath /usr/share/man
+ #manpath /usr/local/share/man
+ EOF
+}
+
+cgi() {
+ pkgdesc="$pkgdesc (web interface)"
+ depends="$pkgname=$pkgver-r$pkgrel"
+ mkdir -p "$subpkgdir"/var/lib
+ mv "$pkgdir"/var/lib/mandoc-cgi \
+ "$subpkgdir"/var/lib
+}
+
+sha512sums="848f290847f3095757f25647e6d73eb7044018b145bf6f9dc8b5db164b1421911efdc5b3b9022ec3a2c5af9687a84d5acedee810f2bd2f7caaa9242dadb2cc52 mandoc-1.14.5.tar.gz
+074dc73b45c71b5c178750db6c7a4a45e97d97b5388fa5d6028faa90600358dd2b954781280ca41d17da3c577ad5a1a7a13ddc4dbea72ac5e86f1652e03ecde7 configure.patch
+c4055371a92be958f0d385c83b4788dc4c18bc990b1f780137309c83e174b8d3e65cae077aba3c5286a97fcee1514d61f6b7507ca25bd5155b8d577a7e8acd3a empty-tbl-null-deref.patch
+9a8953f17e2db75bf3667e1d51c7db21ccc5e3042c59035ed6178094963eac919b7367f96708c9bcc81450ffc13842d12c23edd9bca3330be730149625db88e7 tbl-colwidth-oob.patch
+4b17b144b53ee30f9aae87c7824597151e16e6f5ad795e7b03e701f2d13ca47a62c696cb837689c75d5f34d3c190255c8f0583bc91a0f83f61afde7563a6fb2b less.patch
+f35268ed507d5c6431f8cafe5a311d1ffe990083c6e1d22f5db479e19745d486cd45a699b64c4fb6757d1c0ab588c3e8d0778bfd75e98e751d1a786e89e8b925 doc.patch
+0dfe9e39570a2b6764303708b98f29b2b57114e124a0f37e9c77d4d33f25d474a79d271df46babd700e4cc93e3385a02356f19caa44ebe4e9b056fa4be96b95b cgi-adelie.patch
+957bbaef888fb2ea15f9b795b15952332e65aed70d2e70f3142305a4fb9313ade455eae6dfc923af3ef008834e771b1a85d71389b86cd0ff9a1c31e84fef861c cgi-gz.patch
+37be119308814b060ed9d5517b54eb02b210d677ffb085385929b6aa0e8e8bef2c6c1ab2055713ed8c72f2bc85593bf8744d2d0f163dd1aff65ce439c474b640 cgi-search.patch"
diff --git a/system/mandoc/cgi-adelie.patch b/system/mandoc/cgi-adelie.patch
new file mode 100644
index 000000000..66ce6a9ba
--- /dev/null
+++ b/system/mandoc/cgi-adelie.patch
@@ -0,0 +1,60 @@
+Adjustments for Adélie manual sections and architecture names.
+
+--- mandoc-1.14.5/cgi.c 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/cgi.c 2020-06-05 15:54:05.681060852 -0500
+@@ -101,36 +101,28 @@ static const char *scriptname = SCRIPT_
+
+ static const int sec_prios[] = {1, 4, 5, 8, 6, 3, 7, 2, 9};
+ static const char *const sec_numbers[] = {
+- "0", "1", "2", "3", "3p", "4", "5", "6", "7", "8", "9"
++ "0", "0p", "1", "1p", "2", "3", "3p", "3pm", "4", "5", "6", "7", "8"
+ };
+ static const char *const sec_names[] = {
+ "All Sections",
++ "0p - POSIX C Headers",
+ "1 - General Commands",
++ "1p - POSIX Commands",
+ "2 - System Calls",
+ "3 - Library Functions",
+- "3p - Perl Library",
++ "3p - POSIX C Library Functions",
++ "3pm - Perl Library",
+ "4 - Device Drivers",
+- "5 - File Formats",
++ "5 - File formats and configuration files",
+ "6 - Games",
+- "7 - Miscellaneous Information",
+- "8 - System Manager\'s Manual",
+- "9 - Kernel Developer\'s Manual"
++ "7 - Overview, conventions, and miscellaneous",
++ "8 - System Administrator\'s Manual"
+ };
+ static const int sec_MAX = sizeof(sec_names) / sizeof(char *);
+
+ static const char *const arch_names[] = {
+- "amd64", "alpha", "armv7", "arm64",
+- "hppa", "i386", "landisk",
+- "loongson", "luna88k", "macppc", "mips64",
+- "octeon", "sgi", "socppc", "sparc64",
+- "amiga", "arc", "armish", "arm32",
+- "atari", "aviion", "beagle", "cats",
+- "hppa64", "hp300",
+- "ia64", "mac68k", "mvme68k", "mvme88k",
+- "mvmeppc", "palm", "pc532", "pegasos",
+- "pmax", "powerpc", "solbourne", "sparc",
+- "sun3", "vax", "wgrisc", "x68k",
+- "zaurus"
++ "aarch64", "armv7", "pmmx",
++ "ppc", "ppc64", "x86_64",
+ };
+ static const int arch_MAX = sizeof(arch_names) / sizeof(char *);
+
+@@ -655,7 +661,7 @@ pg_searchres(const struct req *req, stru
+ == NULL) ? 3 :
+ ((archend = strchr(arch + 1, '/'))
+ == NULL) ? 0 :
+- strncmp(arch, "amd64/",
++ strncmp(arch, "ppc64/",
+ archend - arch) ? 2 : 1;
+ if (archprio < archpriouse) {
+ archpriouse = archprio;
diff --git a/system/mandoc/cgi-gz.patch b/system/mandoc/cgi-gz.patch
new file mode 100644
index 000000000..ac506b797
--- /dev/null
+++ b/system/mandoc/cgi-gz.patch
@@ -0,0 +1,77 @@
+Handle the case where some of the entries in the manpath are gzipped by
+removing the .gz extension and allowing mparse_open to add it back and
+mark the page as gzipped. This is part of the documented contract for
+mparse_open, see mandoc(3).
+
+--- mandoc-1.14.5/cgi.c 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/cgi.c 2020-06-05 15:54:05.681060852 -0500
+@@ -93,7 +93,7 @@ static void resp_searchform(const stru
+ static void resp_show(const struct req *, const char *);
+ static void set_query_attr(char **, char **);
+ static int validate_arch(const char *);
+-static int validate_filename(const char *);
++static int validate_filename(char *);
+ static int validate_manpath(const struct req *, const char *);
+ static int validate_urifrag(const char *);
+
+@@ -517,8 +509,13 @@ validate_arch(const char *arch)
+ }
+
+ static int
+-validate_filename(const char *file)
++validate_filename(char *file)
+ {
++ char *cp;
++
++ cp = strrchr(file, '.');
++ if (cp != NULL && ! strcmp(cp + 1, "gz"))
++ *cp = '\0';
+
+ if ('.' == file[0] && '/' == file[1])
+ file += 2;
+@@ -854,14 +862,15 @@ resp_format(const struct req *req, const
+ int fd;
+ int usepath;
+
+- if (-1 == (fd = open(file, O_RDONLY, 0))) {
+- puts("<p>You specified an invalid manual file.</p>");
+- return;
+- }
+-
+ mchars_alloc();
+ mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1 |
+ MPARSE_VALIDATE, MANDOC_OS_OTHER, req->q.manpath);
++
++ if (-1 == (fd = mparse_open(mp, file))) {
++ puts("<p>You specified an invalid manual file.</p>");
++ goto out;
++ }
++
+ mparse_readfd(mp, fd, file);
+ close(fd);
+ meta = mparse_result(mp);
+@@ -882,10 +891,11 @@ resp_format(const struct req *req, const
+ html_man(vp, meta);
+
+ html_free(vp);
+- mparse_free(mp);
+- mchars_free();
+ free(conf.man);
+ free(conf.style);
++out:
++ mparse_free(mp);
++ mchars_free();
+ }
+
+ static void
+@@ -904,8 +914,8 @@ resp_show(const struct req *req, const c
+ static void
+ pg_show(struct req *req, const char *fullpath)
+ {
+- char *manpath;
+- const char *file;
++ char *manpath;
++ char *file;
+
+ if ((file = strchr(fullpath, '/')) == NULL) {
+ pg_error_badrequest(
diff --git a/system/mandoc/cgi-search.patch b/system/mandoc/cgi-search.patch
new file mode 100644
index 000000000..dd74be9ef
--- /dev/null
+++ b/system/mandoc/cgi-search.patch
@@ -0,0 +1,48 @@
+Don't exit immediately if mansearch returns some paths that man.cgi
+considers invalid, in particular translated manpages (e.g.
+./de/man1/chfn.1). Just mark them as invalid (section 10, see struct
+manpage in mansearch.h) and skip them later.
+
+--- mandoc-1.14.5/cgi.c 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/cgi.c 2020-06-05 15:54:05.681060852 -0500
+@@ -605,13 +602,20 @@ pg_searchres(const struct req *req, stru
+ size_t i, iuse;
+ int archprio, archpriouse;
+ int prio, priouse;
++ int results = 0;
+
+ for (i = 0; i < sz; i++) {
+- if (validate_filename(r[i].file))
++ if (validate_filename(r[i].file)) {
++ results = 1;
+ continue;
++ }
+ warnx("invalid filename %s in %s database",
+ r[i].file, req->q.manpath);
+- pg_error_internal();
++ r[i].sec = 10;
++ }
++
++ if (! results) {
++ pg_noresult(req, "No results found.");
+ return;
+ }
+
+@@ -642,6 +646,8 @@ pg_searchres(const struct req *req, stru
+ priouse = 20;
+ archpriouse = 3;
+ for (i = 0; i < sz; i++) {
++ if (r[i].sec == 10)
++ continue;
+ sec = r[i].file;
+ sec += strcspn(sec, "123456789");
+ if (sec[0] == '\0')
+@@ -681,6 +687,8 @@ pg_searchres(const struct req *req, stru
+ if (sz > 1) {
+ puts("<table class=\"results\">");
+ for (i = 0; i < sz; i++) {
++ if (r[i].sec == 10)
++ continue;
+ printf(" <tr>\n"
+ " <td>"
+ "<a class=\"Xr\" href=\"/");
diff --git a/system/mandoc/configure.patch b/system/mandoc/configure.patch
new file mode 100644
index 000000000..2fda25409
--- /dev/null
+++ b/system/mandoc/configure.patch
@@ -0,0 +1,21 @@
+--- mandoc-1.14.5/test-recvmsg.c 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/test-recvmsg.c 2020-06-04 20:08:33.420299034 -0500
+@@ -4,5 +4,6 @@
+ int
+ main(void)
+ {
+- return recvmsg(-1, NULL, 0) != -1;
++ struct msghdr buf;
++ return recvmsg(-1, &buf, 0) != -1;
+ }
+--- mandoc-1.14.5/configure 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/configure 2020-06-04 20:03:24.790295729 -0500
+@@ -41,7 +41,7 @@ OSENUM=
+ OSNAME=
+ UTF8_LOCALE=
+
+-CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -sf -`
++CC=cc
+ CFLAGS=
+ LDADD=
+ LDFLAGS=
diff --git a/system/mandoc/doc.patch b/system/mandoc/doc.patch
new file mode 100644
index 000000000..955a5f205
--- /dev/null
+++ b/system/mandoc/doc.patch
@@ -0,0 +1,132 @@
+--- mandoc-1.14.5/mandoc.1 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/mandoc.1 2020-06-05 02:12:50.320533119 -0500
+@@ -897,7 +897,7 @@ An
+ macro references a manual page that is not found in the base system.
+ The path to look for base system manuals is configurable at compile
+ time and defaults to
+-.Pa /usr/share/man : /usr/X11R6/man .
++.Pa /usr/share/man .
+ .El
+ .Ss Style suggestions
+ .Bl -ohang
+--- mandoc-1.14.5/mandoc.db.5 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/mandoc.db.5 2020-06-05 02:14:48.380534383 -0500
+@@ -189,10 +189,6 @@ followed by the number 0.
+ .Bl -tag -width /usr/share/man/mandoc.db -compact
+ .It Pa /usr/share/man/mandoc.db
+ The manual page database for the base system.
+-.It Pa /usr/X11R6/man/mandoc.db
+-The same for the
+-.Xr X 7
+-Window System.
+ .It Pa /usr/local/man/mandoc.db
+ The same for
+ .Xr packages 7 .
+--- mandoc-1.14.5/man.conf.5 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/man.conf.5 2020-06-05 02:11:34.650532308 -0500
+@@ -117,7 +117,6 @@ installing it is equivalent to not havin
+ file at all.
+ .Bd -literal -offset indent
+ manpath /usr/share/man
+-manpath /usr/X11R6/man
+ manpath /usr/local/man
+ .Ed
+ .Sh SEE ALSO
+
+--- mandoc-1.14.5/man.1 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/man.1 2020-06-05 02:51:15.910557811 -0500
+@@ -174,28 +174,32 @@ Only select manuals from the specified
+ The currently available sections are:
+ .Pp
+ .Bl -tag -width "localXXX" -offset indent -compact
++.It 0p
++POSIX C headers.
+ .It 1
+ General commands
+ .Pq tools and utilities .
++.It 1p
++POSIX commands.
+ .It 2
+ System calls and error numbers.
+ .It 3
+ Library functions.
+ .It 3p
++POSIX C library functions.
++.It 3pm
+ .Xr perl 1
+ programmer's reference guide.
+ .It 4
+ Device drivers.
+ .It 5
+-File formats.
++File formats and configuration files.
+ .It 6
+ Games.
+ .It 7
+-Miscellaneous information.
++Overview, conventions, and miscellaneous information.
+ .It 8
+ System maintenance and operation commands.
+-.It 9
+-Kernel internals.
+ .El
+ .Pp
+ If not specified and a match is found in more than one section,
+--- mandoc-1.14.5/man.cgi.8 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/man.cgi.8 2020-06-05 16:26:12.541081488 -0500
+@@ -342,7 +342,7 @@ page to acquire the named parameters it
+ .El
+ .Sh FILES
+ .Bl -tag -width Ds
+-.It Pa /var/www
++.It Pa /var/lib/mandoc-cgi
+ Default web server
+ .Xr chroot 2
+ directory.
+@@ -366,13 +366,7 @@ This is part of the web server configura
+ A style sheet for
+ .Xr mandoc 1
+ HTML styling, referenced from each generated HTML page.
+-.It Pa /man
+-Default
+-.Nm
+-data directory containing all the manual trees.
+-Can be overridden by
+-.Dv MAN_DIR .
+-.It Pa /man/manpath.conf
++.It Pa /manpath.conf
+ The list of available manpaths, one per line.
+ If any of the lines in this file contains a slash
+ .Pq Sq /
+@@ -380,13 +374,13 @@ or any character not contained in the
+ .Sx Restricted character set ,
+ .Nm
+ reports an internal server error and exits without doing anything.
+-.It Pa /man/header.html
++.It Pa /header.html
+ An optional file containing static HTML code to be inserted right
+ after opening the <BODY> element.
+-.It Pa /man/footer.html
++.It Pa /footer.html
+ An optional file containing static HTML code to be inserted right
+ before closing the <BODY> element.
+-.It Pa /man/OpenBSD-current/man1/mandoc.1
++.It Pa /OpenBSD-current/man1/mandoc.1
+ An example
+ .Xr mdoc 7
+ source file located below the
+--- mandoc-1.14.5/soelim.1 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/soelim.1 2020-06-05 16:38:40.101089494 -0500
+@@ -25,10 +25,10 @@
+ .\" SUCH DAMAGE.
+ .\"
+ .Dd $Mdocdate: July 4 2017 $
+-.Dt SOELIM 1
++.Dt MANDOC-SOELIM 1
+ .Os
+ .Sh NAME
+-.Nm soelim
++.Nm mandoc-soelim
+ .Nd interpret .so requests in manpages
+ .Sh SYNOPSIS
+ .Nm
diff --git a/system/mandoc/empty-tbl-null-deref.patch b/system/mandoc/empty-tbl-null-deref.patch
new file mode 100644
index 000000000..3e14ce32b
--- /dev/null
+++ b/system/mandoc/empty-tbl-null-deref.patch
@@ -0,0 +1,62 @@
+From mboxrd@z Thu Jan 1 00:00:00 1970
+Received: from localhost (fantadrom.bsd.lv [local])
+ by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 25e99424
+ for <source@mandoc.bsd.lv>;
+ Mon, 18 Mar 2019 03:01:04 -0500 (EST)
+Date: Mon, 18 Mar 2019 03:01:04 -0500 (EST)
+X-Mailinglist: mandoc-source
+Reply-To: source@mandoc.bsd.lv
+MIME-Version: 1.0
+From: schwarze@mandoc.bsd.lv
+To: source@mandoc.bsd.lv
+Subject: mandoc: fix a NULL pointer access on empty tbl(7) data cells that
+X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/
+Content-Type: text/plain; charset=utf-8
+Message-ID: <e3f22222366ad31d@fantadrom.bsd.lv>
+Archived-At: <http://inbox.vuxu.org/mandoc-source/e3f22222366ad31d@fantadrom.bsd.lv/>
+List-Archive: <http://inbox.vuxu.org/mandoc-source/>
+List-Post: <mailto:source@mandoc.bsd.lv>
+
+Log Message:
+-----------
+fix a NULL pointer access on empty tbl(7) data cells
+that bentley@ found in syncthing-bep(7)
+
+Modified Files:
+--------------
+ mandoc:
+ tbl_term.c
+
+Revision Data
+-------------
+Index: tbl_term.c
+===================================================================
+RCS file: /home/cvs/mandoc/mandoc/tbl_term.c,v
+retrieving revision 1.69
+retrieving revision 1.70
+diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.69 -r1.70
+--- a/tbl_term.c
++++ b/tbl_term.c
+@@ -629,7 +629,8 @@ tbl_hrule(struct termp *tp, const struct
+
+ lw = cpp == NULL || cpn == NULL ||
+ (cpn->pos != TBL_CELL_DOWN &&
+- (dpn == NULL || strcmp(dpn->string, "\\^") != 0))
++ (dpn == NULL || dpn->string == NULL ||
++ strcmp(dpn->string, "\\^") != 0))
+ ? hw : 0;
+ tbl_direct_border(tp, BHORIZ * lw,
+ col->width + col->spacing / 2);
+@@ -675,7 +676,8 @@ tbl_hrule(struct termp *tp, const struct
+
+ rw = cpp == NULL || cpn == NULL ||
+ (cpn->pos != TBL_CELL_DOWN &&
+- (dpn == NULL || strcmp(dpn->string, "\\^") != 0))
++ (dpn == NULL || dpn->string == NULL ||
++ strcmp(dpn->string, "\\^") != 0))
+ ? hw : 0;
+
+ /* The line crossing at the end of this column. */
+--
+ To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
+
diff --git a/system/mandoc/less.patch b/system/mandoc/less.patch
new file mode 100644
index 000000000..19d567365
--- /dev/null
+++ b/system/mandoc/less.patch
@@ -0,0 +1,58 @@
+Default to using less(1) instead of more(1) if MANPAGER and PAGER are
+unset, and also set a pretty prompt and smart case searching like man-db
+does if less is used as a pager.
+
+The name of the manpage is not available in the scope of the patched
+function - maybe add it at some point.
+
+--- mandoc-1.14.5/main.c 2019-03-10 04:56:43.000000000 -0500
++++ mandoc-1.14.5/main.c 2020-06-05 01:59:10.640524340 -0500
+@@ -1170,8 +1170,9 @@ spawn_pager(struct tag_files *tag_files)
+ pager = getenv("MANPAGER");
+ if (pager == NULL || *pager == '\0')
+ pager = getenv("PAGER");
+- if (pager == NULL || *pager == '\0')
+- pager = "more -s";
++ if (pager == NULL || *pager == '\0') {
++ pager = "less";
++ }
+ cp = mandoc_strdup(pager);
+
+ /*
+@@ -1195,10 +1196,24 @@ spawn_pager(struct tag_files *tag_files)
+ /* For less(1), use the tag file. */
+
+ use_ofn = 1;
+-#if HAVE_LESS_T
+ if ((cmdlen = strlen(argv[0])) >= 4) {
+ cp = argv[0] + cmdlen - 4;
+ if (strcmp(cp, "less") == 0) {
++ /*
++ * Set a few options like man-db does.
++ * -i: smart case search
++ * -mPm: set prompt to following string terminated by $
++ */
++ argv[argc++] = "-imPm" \
++ " Manual page" \
++ /*
++ * print " (END)" if EOF, else % in file followed by % sign.
++ * ?X if X:else not X.
++ */
++ "?e (END):?pB %pB\\%.. " \
++ "(press h for help or q to quit)" \
++ "$";
++#if HAVE_LESS_T
+ argv[argc++] = mandoc_strdup("-T");
+ argv[argc++] = tag_files->tfn;
+ if (tag_files->tagname != NULL) {
+@@ -1206,9 +1221,9 @@ spawn_pager(struct tag_files *tag_files)
+ argv[argc++] = tag_files->tagname;
+ use_ofn = 0;
+ }
++#endif
+ }
+ }
+-#endif
+ if (use_ofn)
+ argv[argc++] = tag_files->ofn;
+ argv[argc] = NULL;
diff --git a/system/mandoc/mandoc.post-deinstall b/system/mandoc/mandoc.post-deinstall
new file mode 100644
index 000000000..0a8d5b9df
--- /dev/null
+++ b/system/mandoc/mandoc.post-deinstall
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec rm -f /usr/share/man/mandoc.db 2>/dev/null
diff --git a/system/mandoc/mandoc.trigger b/system/mandoc/mandoc.trigger
new file mode 100644
index 000000000..34fc1decc
--- /dev/null
+++ b/system/mandoc/mandoc.trigger
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec makewhatis -a -T utf8 "$@"
diff --git a/system/mandoc/tbl-colwidth-oob.patch b/system/mandoc/tbl-colwidth-oob.patch
new file mode 100644
index 000000000..0b7b0acad
--- /dev/null
+++ b/system/mandoc/tbl-colwidth-oob.patch
@@ -0,0 +1,62 @@
+From mboxrd@z Thu Jan 1 00:00:00 1970
+Received: from localhost (fantadrom.bsd.lv [local])
+ by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 0ff00a97
+ for <source@mandoc.bsd.lv>;
+ Fri, 29 Mar 2019 16:27:36 -0500 (EST)
+Date: Fri, 29 Mar 2019 16:27:36 -0500 (EST)
+X-Mailinglist: mandoc-source
+Reply-To: source@mandoc.bsd.lv
+MIME-Version: 1.0
+From: schwarze@mandoc.bsd.lv
+To: source@mandoc.bsd.lv
+Subject: mandoc: Set the maximum column index in a tbl(7) to the maximum *right*
+X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/
+Content-Type: text/plain; charset=utf-8
+Message-ID: <e3fceff42218668d@fantadrom.bsd.lv>
+Archived-At: <http://inbox.vuxu.org/mandoc-source/e3fceff42218668d@fantadrom.bsd.lv/>
+List-Archive: <http://inbox.vuxu.org/mandoc-source/>
+List-Post: <mailto:source@mandoc.bsd.lv>
+
+Log Message:
+-----------
+Set the maximum column index in a tbl(7) to the maximum *right* edge
+of any cell span, not to the maximum *left* edge, which may be smaller
+if the last column of the table is only reached by horizontal spans,
+but not by any regular cell in any row of the table.
+Otherwise, the algorithm calculating column widths accessed memomy
+after the end of the colwidth[] array, while it was trying to handle
+the rightmost column(s).
+
+Crash reported by Jason Thorpe <thorpej at NetBSD>
+via https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54069
+and via Thomas Klausner (wiz@).
+Christos@ Zoulas sent a (correct, but slightly confusing) patch.
+The patch i'm committing here is easier to understand.
+
+Modified Files:
+--------------
+ mandoc:
+ out.c
+
+Revision Data
+-------------
+Index: out.c
+===================================================================
+RCS file: /home/cvs/mandoc/mandoc/out.c,v
+retrieving revision 1.77
+retrieving revision 1.78
+diff -Lout.c -Lout.c -u -p -r1.77 -r1.78
+--- a/out.c
++++ b/out.c
+@@ -149,7 +149,7 @@ tblcalc(struct rofftbl *tbl, const struc
+ gp = &first_group;
+ for (dp = sp->first; dp != NULL; dp = dp->next) {
+ icol = dp->layout->col;
+- while (icol > maxcol)
++ while (maxcol < icol + dp->hspans)
+ tbl->cols[++maxcol].spacing = SIZE_MAX;
+ col = tbl->cols + icol;
+ col->flags |= dp->layout->flags;
+--
+ To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
+
diff --git a/system/nvi/APKBUILD b/system/nvi/APKBUILD
index c0daf1a1e..a148971ea 100644
--- a/system/nvi/APKBUILD
+++ b/system/nvi/APKBUILD
@@ -2,7 +2,8 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=nvi
pkgver=1.81.6
-pkgrel=0
+_debver=15
+pkgrel=1
pkgdesc="Berkeley text editor"
url="https://sites.google.com/a/bostic.com/keithbostic/vi/"
arch="all"
@@ -11,12 +12,21 @@ license="BSD-4-Clause-UC"
depends=""
makedepends="db-dev ncurses-dev"
subpackages="$pkgname-doc"
-source="https://fossies.org/linux/privat/old/nvi-$pkgver.tar.gz
+source="http://deb.debian.org/debian/pool/main/n/nvi/nvi_$pkgver.orig.tar.gz
+ http://deb.debian.org/debian/pool/main/n/nvi/nvi_$pkgver-$_debver.debian.tar.xz
build-fix.patch
"
+# secfixes:
+# 1.81.6-r1:
+# - CVE-2001-1562
+
prepare() {
default_prepare
+ while read -r i; do
+ msg "$i"
+ patch -p1 -i "../debian/patches/$i"
+ done < ../debian/patches/series
cd "$builddir"/dist
chmod u+w config.sub
@@ -49,5 +59,6 @@ package() {
mv "$pkgdir"/usr/share/man/man1/view.1 "$pkgdir"/usr/share/man/man1/view.nvi.1
}
-sha512sums="1be798daf0cd05010ddaf0aa0510dc799708fd79d4b243e2700adff18e931ddd9d11621796fa8086088c3e93ba20f15ab86783732665169c52b73eaf587ff0b3 nvi-1.81.6.tar.gz
+sha512sums="1be798daf0cd05010ddaf0aa0510dc799708fd79d4b243e2700adff18e931ddd9d11621796fa8086088c3e93ba20f15ab86783732665169c52b73eaf587ff0b3 nvi_1.81.6.orig.tar.gz
+7756ca0ba9503516fcbf1a5fe51465bebf74bf107e040cea80de0dd501854fe0f25d67ddbd4142e58057ad015be12f8b711ef861fd6ad3f317bc619327579513 nvi_1.81.6-15.debian.tar.xz
b84cfb83ea5ed15f5c7d9e608771a2248531be388fa19340e90074d37e10f6f75c8b965a40f5288275973f23ed6fda54aa4ef990b43d4828d174b66fd3ced1e9 build-fix.patch"
diff --git a/system/openrc/0007-make-consolefont-service-compatible-with-busyboxs-se.patch b/system/openrc/0007-make-consolefont-service-compatible-with-busyboxs-se.patch
deleted file mode 100644
index 6c23e2ab0..000000000
--- a/system/openrc/0007-make-consolefont-service-compatible-with-busyboxs-se.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 3d0d2b89745597ea973129eafa3f999cf19d761f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
-Date: Wed, 17 Aug 2016 17:52:58 +0200
-Subject: [PATCH 7/7] make consolefont service compatible with busyboxs setfont
- applet
-
-Compared to kdbs setfont program it doesn't support -O and -m.
----
- conf.d/consolefont | 11 ++---------
- init.d/consolefont.in | 7 ++-----
- 2 files changed, 4 insertions(+), 14 deletions(-)
-
-diff --git a/conf.d/consolefont b/conf.d/consolefont
-index e01ae842..75544b2f 100644
---- a/conf.d/consolefont
-+++ b/conf.d/consolefont
-@@ -3,16 +3,9 @@
- #
- # consolefont specifies the default font that you'd like Linux to use on the
- # console. You can find a good selection of fonts in /usr/share/consolefonts;
--# you shouldn't specify the trailing ".psf.gz", just the font name below.
--# To use the default console font, comment out the CONSOLEFONT setting below.
--consolefont="default8x16"
-+consolefont="default8x16.psf.gz"
-
- # consoletranslation is the charset map file to use. Leave commented to use
- # the default one. Have a look in /usr/share/consoletrans for a selection of
- # map files you can use.
--#consoletranslation="8859-1_to_uni"
--
--# unicodemap is the unicode map file to use. Leave commented to use the
--# default one. Have a look in /usr/share/unimaps for a selection of map files
--# you can use.
--#unicodemap="iso01"
-+#consoletranslation="8859-1_to_uni.trans"
-diff --git a/init.d/consolefont.in b/init.d/consolefont.in
-index 9fe95afa..173ed426 100644
---- a/init.d/consolefont.in
-+++ b/init.d/consolefont.in
-@@ -22,7 +22,6 @@ start()
- {
- ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
- consolefont=${consolefont:-${CONSOLEFONT}}
-- unicodemap=${unicodemap:-${UNICODEMAP}}
- consoletranslation=${consoletranslation:-${CONSOLETRANSLATION}}
-
- if [ -z "$consolefont" ]; then
-@@ -43,9 +42,6 @@ start()
- if [ -n "$consoletranslation" ]; then
- param="$param -m $consoletranslation"
- fi
-- if [ -n "${unicodemap}" ]; then
-- param="$param -u $unicodemap"
-- fi
-
- # Set the console font
- ebegin "Setting console font [$consolefont]"
-@@ -63,7 +59,8 @@ start()
- # Store the font so we can use it ASAP on boot
- if [ $retval -eq 0 ] && checkpath -W "$RC_LIBEXECDIR"; then
- mkdir -p "$RC_LIBEXECDIR"/console
-- setfont -O "$RC_LIBEXECDIR"/console/font
-+ zcat "/usr/share/consolefonts/$consolefont" \
-+ > "$RC_LIBEXECDIR"/console/font
- fi
-
- return $retval
---
-2.11.0
-
diff --git a/system/openrc/APKBUILD b/system/openrc/APKBUILD
index 2b1c5f520..c2cb32220 100644
--- a/system/openrc/APKBUILD
+++ b/system/openrc/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer:
pkgname=openrc
pkgver=0.24.1
-pkgrel=8
+pkgrel=10
pkgdesc="OpenRC manages the services, startup and shutdown of a host"
url="https://github.com/OpenRC/openrc"
arch="all"
@@ -19,7 +19,6 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/OpenRC/openrc/archive/$pkgve
0004-hide-error-when-migrating-var-run-to-run.patch
0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
0006-mount-efivars-read-only.patch
- 0007-make-consolefont-service-compatible-with-busyboxs-se.patch
openrc-configuration.patch
@@ -69,8 +68,11 @@ package() {
rm "$pkgdir"/etc/conf.d/network
rm "$pkgdir"/etc/init.d/network
- # we use console-setup for keymaps
- rm "$pkgdir"/etc/init.d/keymaps
+ # we ship these in system/kbd
+ for i in consolefont keymaps; do
+ rm "$pkgdir"/etc/conf.d/$i
+ rm "$pkgdir"/etc/init.d/$i
+ done
# we use gettys-openrc for TTY
rm "$pkgdir"/etc/init.d/agetty
@@ -86,7 +88,6 @@ aedf77f9159fefb4bd5f30a29a33b6aedbc986c9a0f993aa928cc79fbe24aac76bd9e5974dcce52e
d54630d40a2d6b10a325cb012d4efcda997a60c008ca953ce5d60059d3f267308a59dabddf93a5fc0d301aa91967137d144effbe5f574394af768ce4ebc48738 0004-hide-error-when-migrating-var-run-to-run.patch
39a35c54ec9112fe84c901ed155a711cec8e194af02d5483ee60b80743dab12391e6fdc7b3da2f86844dd4edcf53e681ff95bd4d6fa1101a89ce54dce2ddbb7c 0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch
7221dd2daccd8844f6f9481b7b5921abc2711c8abd1a4bb72f04db8fd8e734b817f5d0d571daea0e2e05d3bc687f75ee1d8025249996bdee0b3328e18d9da7d3 0006-mount-efivars-read-only.patch
-234c4f3cf39df3350dbea25c00b8d584794b28194f44c726767a6a16d91a26fee1b5d2dd16635f19803fc015b4e9d99c52b23128e6b815938b88365feba8cf59 0007-make-consolefont-service-compatible-with-busyboxs-se.patch
2dde266f3176456724e4b0c40476e7061e31986b67744b4a53c71ba0d3896860b4569e3af2ea4777a9d8fe3b6282ff869666570f1daa86cdc410c0e09805c990 openrc-configuration.patch
12bb6354e808fbf47bbab963de55ee7901738b4a912659982c57ef2777fff9a670e867fcb8ec316a76b151032c92dc89a950d7d1d835ef53f753a8f3b41d2cec openrc.logrotate
99b542c0903ad6874b8c308b2e0660a4fe2ff9db962dfec65325cd12c368873a2ae800d5e6d42dc4deff775e1d5c0068869eb72581f7ab16e88d5738afe1d3dd hostname.initd
diff --git a/system/openrc/openrc.post-install b/system/openrc/openrc.post-install
index 0f6572ef7..9632de2ee 100644
--- a/system/openrc/openrc.post-install
+++ b/system/openrc/openrc.post-install
@@ -1,6 +1,6 @@
#!/bin/sh
-if [ -d /etc/runlevels ]; then
+if [ -d /etc/runlevels/sysinit ]; then
exit 0
fi
diff --git a/system/skalibs/APKBUILD b/system/skalibs/APKBUILD
index ada2b303c..129fa7e79 100644
--- a/system/skalibs/APKBUILD
+++ b/system/skalibs/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Laurent Bercot <ska-adelie@skarnet.org>
# Maintainer: Laurent Bercot <ska-adelie@skarnet.org>
pkgname=skalibs
-pkgver=2.9.2.0
+pkgver=2.9.2.1
pkgrel=0
pkgdesc="A set of general-purpose C programming libraries for skarnet.org software"
url="https://skarnet.org/software/skalibs/"
@@ -57,4 +57,4 @@ doc() {
cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
}
-sha512sums="a351cb8d048cefa495cc35fd2758579879d5ac11d2a1fc00c694d5655aa9e430228517c01fc91bdbc70c3992f73429a68a5365cb46039a7b7bb11358f0f4506d skalibs-2.9.2.0.tar.gz"
+sha512sums="bd507faf30f0564fb8d3e5f86de04ab4b39961dab2497ba9f4a81980a57f7ff68cad366b9847b25d555b5b9263460d13f096e1774d080d1d286979f2e7324c54 skalibs-2.9.2.1.tar.gz"
diff --git a/system/unzip/10-unzip-handle-pkware-verify.patch b/system/unzip/10-unzip-handle-pkware-verify.patch
deleted file mode 100644
index b373ce07d..000000000
--- a/system/unzip/10-unzip-handle-pkware-verify.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Steven Schweda
-Subject: Handle the PKWare verification bit of internal attributes
-Bug-Debian: http://bugs.debian.org/630078
-X-Debian-version: 6.0-5
-
---- a/process.c
-+++ b/process.c
-@@ -1729,6 +1729,13 @@
- else if (uO.L_flag > 1) /* let -LL force lower case for all names */
- G.pInfo->lcflag = 1;
-
-+ /* Handle the PKWare verification bit, bit 2 (0x0004) of internal
-+ attributes. If this is set, then a verification checksum is in the
-+ first 3 bytes of the external attributes. In this case all we can use
-+ for setting file attributes is the last external attributes byte. */
-+ if (G.crec.internal_file_attributes & 0x0004)
-+ G.crec.external_file_attributes &= (ulg)0xff;
-+
- /* do Amigas (AMIGA_) also have volume labels? */
- if (IS_VOLID(G.crec.external_file_attributes) &&
- (G.pInfo->hostnum == FS_FAT_ || G.pInfo->hostnum == FS_HPFS_ ||
diff --git a/system/unzip/20-unzip-uidgid-fix.patch b/system/unzip/20-unzip-uidgid-fix.patch
deleted file mode 100644
index 3a308990e..000000000
--- a/system/unzip/20-unzip-uidgid-fix.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From: sms
-Subject: Restore uid and gid information when requested
-Bug-Debian: http://bugs.debian.org/689212
-X-Debian-version: 6.0-8
-
---- a/process.c
-+++ b/process.c
-@@ -2904,7 +2904,7 @@
- #ifdef IZ_HAVE_UXUIDGID
- if (eb_len >= EB_UX3_MINLEN
- && z_uidgid != NULL
-- && (*((EB_HEADSIZE + 0) + ef_buf) == 1)
-+ && (*((EB_HEADSIZE + 0) + ef_buf) == 1))
- /* only know about version 1 */
- {
- uch uid_size;
-@@ -2916,10 +2916,10 @@
- flags &= ~0x0ff; /* ignore any previous UNIX field */
-
- if ( read_ux3_value((EB_HEADSIZE + 2) + ef_buf,
-- uid_size, z_uidgid[0])
-+ uid_size, &z_uidgid[0])
- &&
- read_ux3_value((EB_HEADSIZE + uid_size + 3) + ef_buf,
-- gid_size, z_uidgid[1]) )
-+ gid_size, &z_uidgid[1]) )
- {
- flags |= EB_UX2_VALID; /* signal success */
- }
diff --git a/system/unzip/APKBUILD b/system/unzip/APKBUILD
index e915966a0..ea8f7e6fa 100644
--- a/system/unzip/APKBUILD
+++ b/system/unzip/APKBUILD
@@ -4,7 +4,8 @@
pkgname=unzip
pkgver=6.0
_pkgver=$(printf '%s' "$pkgver" | tr -d .)
-pkgrel=3
+_debver=25
+pkgrel=4
pkgdesc="Extract PKZIP-compatible .zip files"
url="http://www.info-zip.org/UnZip.html"
arch="all"
@@ -12,12 +13,30 @@ license="Info-ZIP"
subpackages="$pkgname-doc"
# normally ftp://ftp.info-zip.org/pub/infozip/src/$pkgname$_pkgver.zip
source="$pkgname-$pkgver.tgz::https://distfiles.adelielinux.org/source/$pkgname$_pkgver.tgz
- 10-unzip-handle-pkware-verify.patch
- 20-unzip-uidgid-fix.patch
- unzip-6.0-heap-overflow-infloop.patch
+ http://deb.debian.org/debian/pool/main/u/unzip/unzip_$pkgver-$_debver.debian.tar.xz
"
builddir="$srcdir/$pkgname$_pkgver"
+# secfixes:
+# 6.0-r4:
+# - CVE-2014-8139
+# - CVE-2014-8140
+# - CVE-2014-8141
+# - CVE-2014-9636
+# - CVE-2014-9913
+# - CVE-2016-9844
+# - CVE-2018-18384
+# - CVE-2018-1000035
+# - CVE-2019-13232
+
+prepare() {
+ default_prepare
+ while read -r i; do
+ msg "$i"
+ patch -p1 -i "../debian/patches/$i"
+ done < ../debian/patches/series
+}
+
build() {
make -f unix/Makefile \
CC="${CHOST}-gcc" \
@@ -38,6 +57,4 @@ package() {
}
sha512sums="0694e403ebc57b37218e00ec1a406cae5cc9c5b52b6798e0d4590840b6cdbf9ddc0d9471f67af783e960f8fa2e620394d51384257dca23d06bcd90224a80ce5d unzip-6.0.tgz
-9d2914f22fb0075a2b6f72825c235f46eafd8d47b6fb6fcc8303fc69336e256b15923c002d2615bb6af733344c2315e4a8504d77bae301e10c11d4736faa2c81 10-unzip-handle-pkware-verify.patch
-57699582e9056af0817dcb67f8db67e6a1ff8208c137fbebcf559429e5f12b471b75d7e1ef938e5bbb5416074a51ac7342e4ce8057f4bbdcb0bf079b8d7832af 20-unzip-uidgid-fix.patch
-b1e3fac6a787828efaaef8ec7cc52e1573aea27a6f29830af37ec4ba8bcd2a6488c953ab10eee0561c78e82c7401833ef172bebee793405d93632ce788756301 unzip-6.0-heap-overflow-infloop.patch"
+13c16db420fa4a34be3090a9acdd79b01320da40ac5aa89a9dfca03e64b914b28eb72aff3882d02a8197457bcb8eeb9473c998cf6920e511883c9289a949fb21 unzip_6.0-25.debian.tar.xz"
diff --git a/system/unzip/unzip-6.0-heap-overflow-infloop.patch b/system/unzip/unzip-6.0-heap-overflow-infloop.patch
deleted file mode 100644
index 160c512f9..000000000
--- a/system/unzip/unzip-6.0-heap-overflow-infloop.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From bdd4a0cecd745cb4825e4508b5bdf2579731086a Mon Sep 17 00:00:00 2001
-From: Petr Stodulka <pstodulk@redhat.com>
-Date: Mon, 14 Sep 2015 18:23:17 +0200
-Subject: [PATCH 1/3] upstream fix for heap overflow
-
-https://bugzilla.redhat.com/attachment.cgi?id=1073002
----
- crypt.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/crypt.c b/crypt.c
-index 784e411..a8975f2 100644
---- a/crypt.c
-+++ b/crypt.c
-@@ -465,7 +465,17 @@ int decrypt(__G__ passwrd)
- GLOBAL(pInfo->encrypted) = FALSE;
- defer_leftover_input(__G);
- for (n = 0; n < RAND_HEAD_LEN; n++) {
-- b = NEXTBYTE;
-+ /* 2012-11-23 SMS. (OUSPG report.)
-+ * Quit early if compressed size < HEAD_LEN. The resulting
-+ * error message ("unable to get password") could be improved,
-+ * but it's better than trying to read nonexistent data, and
-+ * then continuing with a negative G.csize. (See
-+ * fileio.c:readbyte()).
-+ */
-+ if ((b = NEXTBYTE) == (ush)EOF)
-+ {
-+ return PK_ERR;
-+ }
- h[n] = (uch)b;
- Trace((stdout, " (%02x)", h[n]));
- }
---
-2.4.6
-
-
-From 4b48844661ff9569f2ecf582a387d46a5775b5d8 Mon Sep 17 00:00:00 2001
-From: Kamil Dudka <kdudka@redhat.com>
-Date: Mon, 14 Sep 2015 18:24:56 +0200
-Subject: [PATCH 2/3] fix infinite loop when extracting empty bzip2 data
-
-Bug: https://sourceforge.net/p/infozip/patches/23/
----
- extract.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/extract.c b/extract.c
-index 7134bfe..29db027 100644
---- a/extract.c
-+++ b/extract.c
-@@ -2733,6 +2733,12 @@ __GDEF
- int repeated_buf_err;
- bz_stream bstrm;
-
-+ if (G.incnt <= 0 && G.csize <= 0L) {
-+ /* avoid an infinite loop */
-+ Trace((stderr, "UZbunzip2() got empty input\n"));
-+ return 2;
-+ }
-+
- #if (defined(DLL) && !defined(NO_SLIDE_REDIR))
- if (G.redirect_slide)
- wsize = G.redirect_size, redirSlide = G.redirect_buffer;
---
-2.4.6
-
-
-From bd150334fb4084f5555a6be26b015a0671cb5b74 Mon Sep 17 00:00:00 2001
-From: Kamil Dudka <kdudka@redhat.com>
-Date: Tue, 22 Sep 2015 18:52:23 +0200
-Subject: [PATCH 3/3] extract: prevent unsigned overflow on invalid input
-
-Suggested-by: Stefan Cornelius
----
- extract.c | 11 ++++++++++-
- 1 file changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/extract.c b/extract.c
-index 29db027..b9ae667 100644
---- a/extract.c
-+++ b/extract.c
-@@ -1257,8 +1257,17 @@ static int extract_or_test_entrylist(__G__ numchunk,
- if (G.lrec.compression_method == STORED) {
- zusz_t csiz_decrypted = G.lrec.csize;
-
-- if (G.pInfo->encrypted)
-+ if (G.pInfo->encrypted) {
-+ if (csiz_decrypted <= 12) {
-+ /* handle the error now to prevent unsigned overflow */
-+ Info(slide, 0x401, ((char *)slide,
-+ LoadFarStringSmall(ErrUnzipNoFile),
-+ LoadFarString(InvalidComprData),
-+ LoadFarStringSmall2(Inflate)));
-+ return PK_ERR;
-+ }
- csiz_decrypted -= 12;
-+ }
- if (G.lrec.ucsize != csiz_decrypted) {
- Info(slide, 0x401, ((char *)slide,
- LoadFarStringSmall2(WrnStorUCSizCSizDiff),
---
-2.5.2
-