mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-23 01:21:46 +01:00
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.
40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
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
|