aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDermot Bradley <dermot_bradley@yahoo.com>2020-09-13 03:02:36 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-09-20 21:41:03 +0000
commit9565f7995f06381bb0716a6d5d8cbe0705256438 (patch)
tree6cd620676fb22c72e442eb3841c46caad6b66ed3
parent5eb1be4a83191fe6bae6ca1c6d14e4abf223977f (diff)
downloadaports-9565f7995f06381bb0716a6d5d8cbe0705256438.tar.gz
aports-9565f7995f06381bb0716a6d5d8cbe0705256438.tar.bz2
aports-9565f7995f06381bb0716a6d5d8cbe0705256438.tar.xz
main/cracklib: prevent warning messages when trigger is run
As highlighted by #11931, when cracklib's trigger runs several messages are output to stderr. These warnings are due to issues with the supplied wordlist files. This fix filters out very long line and blank line entries from any word files used by cracklib so prevent warning messages whenever its trigger is activated.
-rw-r--r--main/cracklib/APKBUILD9
-rw-r--r--main/cracklib/fix-trigger-warning.patch39
2 files changed, 45 insertions, 3 deletions
diff --git a/main/cracklib/APKBUILD b/main/cracklib/APKBUILD
index 87bdd5f032..814eebe04b 100644
--- a/main/cracklib/APKBUILD
+++ b/main/cracklib/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=cracklib
pkgver=2.9.7
-pkgrel=3
+pkgrel=4
pkgdesc="A library used to enforce strong passwords"
url="https://github.com/cracklib/cracklib"
arch="all"
@@ -11,7 +11,9 @@ triggers="$pkgname.trigger=/usr/share/cracklib"
makedepends="zlib-dev"
subpackages="$pkgname-dev $pkgname-words::noarch"
source="https://github.com/cracklib/cracklib/releases/download/v$pkgver/cracklib-$pkgver.tar.bz2
- https://github.com/cracklib/cracklib/releases/download/v$pkgver/cracklib-words-$pkgver.gz"
+ https://github.com/cracklib/cracklib/releases/download/v$pkgver/cracklib-words-$pkgver.gz
+ fix-trigger-warning.patch
+ "
# secfixes:
# 2.9.7-r0:
@@ -53,4 +55,5 @@ words() {
}
sha512sums="f6bf65ac092ba46ff78ddbc115692260fb76dc71219cd679d2ea935ebfb9e709fbb30259a7406743ed00dbdc415335b3ac9d9fcba1d204ea36d5eb96bf1333a2 cracklib-2.9.7.tar.bz2
-1fa34b0a2e16d6906982b248f1757bf5bf8154d8d7e8bab94a4ac25080c41434d3828a2c8dd5065e9be586f36480ab70375f09e0bb64eb495d96a460619e2bae cracklib-words-2.9.7.gz"
+1fa34b0a2e16d6906982b248f1757bf5bf8154d8d7e8bab94a4ac25080c41434d3828a2c8dd5065e9be586f36480ab70375f09e0bb64eb495d96a460619e2bae cracklib-words-2.9.7.gz
+f9cececd7ba4636bc5d2b9b2acf7c40563a32c1725f6bdcc0f7604ecc4c8cb31656972bfb17a302427bb17b5b8be24c44fd3fd9e1a891745c02f3243e0087216 fix-trigger-warning.patch"
diff --git a/main/cracklib/fix-trigger-warning.patch b/main/cracklib/fix-trigger-warning.patch
new file mode 100644
index 0000000000..21ec638b27
--- /dev/null
+++ b/main/cracklib/fix-trigger-warning.patch
@@ -0,0 +1,39 @@
+From: Dermot Bradley <dermot_bradley@yahoo.com>
+Date: Sat, 12 Sep 2020 20:03 +0100
+Subject: [PATCH] cracklib: prevent "line out of order" warnings
+
+Workaround for handling excessively long lines in cracklib-words.gz file.
+Ensure that all lines read from any words files are truncated to 1023
+characters as the cracklib-packer utility (run by the Alpine package trigger)
+breaks up long lines on this boundary and processes them separately as if
+they were seperate lines and it can potentially generate "line out of order"
+warnings.
+
+It also ignores blank lines in word files, this prevents "skipping line"
+warnings when blank lines are encountered.
+
+Upstream PR 33 has been raised with this fix.
+
+---
+
+--- a/util/cracklib-format
++++ b/util/cracklib-format
+@@ -3,8 +3,17 @@
+ # This preprocesses a set of word lists into a suitable form for input
+ # into cracklib-packer
+ #
++# Truncates lines longer than 1022 characters long as cracklib-packer
++# does not handle them correctly.
++#
++# The last part of the pipeline uses 'grep -v' to remove any blank
++# lines (possibly introduced by earlier parts of the pipeline) as
++# cracklib-packer will generate "skipping line" warnings otherwise.
++#
+ gzip -cdf "$@" |
+- grep -v '^\(#\|$\)' |
++ grep -a -v '^#' |
+ tr '[A-Z]' '[a-z]' |
+ tr -cd '\012[a-z][0-9]' |
++ cut -c 1-1022 |
++ grep -v '^$' |
+ env LC_ALL=C sort -u