summaryrefslogtreecommitdiffstats
path: root/sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch')
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch b/sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch
new file mode 100644
index 0000000..30bc7e0
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch
@@ -0,0 +1,19 @@
+--- misc-utils/look.c
++++ misc-utils/look.c
+@@ -137,7 +137,15 @@
+ *++p = '\0';
+
+ if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb))
+- err("%s: %s", file, strerror(errno));
++ {
++ /* if opening the primary file failed, fall back to cracklib word files */
++ file = "/usr/share/dict/cracklib-words";
++ if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb)) {
++ file = "/usr/share/dict/cracklib-small";
++ if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb))
++ err("%s: %s\n\tplease emerge sys-apps/cracklib-words or sys-apps/miscfiles", file, strerror(errno));
++ }
++ }
+ front = mmap(NULL, (size_t) sb.st_size, PROT_READ,
+ #ifdef MAP_FILE
+ MAP_FILE |