summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-12-04 19:07:09 +0000
committerMike Frysinger <vapier@gentoo.org>2005-12-04 19:07:09 +0000
commit2731d4367da4ce0e8c5caeec1934ed8fbcbaa7ec (patch)
tree15fc3f3e41ecc506df5334ea24c91ba4ea6f865f /sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch
parentVersion bump (bug #113585) (diff)
downloadgentoo-2-2731d4367da4ce0e8c5caeec1934ed8fbcbaa7ec.tar.gz
gentoo-2-2731d4367da4ce0e8c5caeec1934ed8fbcbaa7ec.tar.bz2
gentoo-2-2731d4367da4ce0e8c5caeec1934ed8fbcbaa7ec.zip
Fall back to cracklib-words if the words dict doesnt exist #114416.
(Portage version: 2.0.53)
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 000000000000..30bc7e0be12a
--- /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 |