summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroniko94 <onikolaiev94@outlook.com>2025-03-25 01:38:05 +0200
committeroniko94 <onikolaiev94@outlook.com>2025-03-25 14:15:45 +0200
commit0646013a7c150472a3d3e3327e40cec8799903cd (patch)
tree843a06cb3114ef12babb4fb28812f5ea4cb6e8a3
parentfeb144cdd771c4f3ec4eff8801bf3e98cbfd052f (diff)
downloadvyos-build-0646013a7c150472a3d3e3327e40cec8799903cd.tar.gz
vyos-build-0646013a7c150472a3d3e3327e40cec8799903cd.zip
T7278: Fix missing cracklib database files on image update
-rwxr-xr-xdata/live-build-config/hooks/live/40-init-cracklib-db.chroot13
-rw-r--r--data/live-build-config/rootfs/excludes3
2 files changed, 15 insertions, 1 deletions
diff --git a/data/live-build-config/hooks/live/40-init-cracklib-db.chroot b/data/live-build-config/hooks/live/40-init-cracklib-db.chroot
new file mode 100755
index 00000000..4d94b08e
--- /dev/null
+++ b/data/live-build-config/hooks/live/40-init-cracklib-db.chroot
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+CRACKLIB_DIR=/var/cache/cracklib
+CRACKLIB_DB=cracklib_dict
+
+if [ ! -f "${CRACKLIB_DIR}/${CRACKLIB_DB}.pwd" ]; then
+ echo "I: Creating the cracklib database ${CRACKLIB_DIR}/${CRACKLIB_DB}"
+ mkdir -p $CRACKLIB_DIR
+
+ /usr/sbin/create-cracklib-dict -o $CRACKLIB_DIR/$CRACKLIB_DB \
+ /usr/share/dict/cracklib-small
+fi
+
diff --git a/data/live-build-config/rootfs/excludes b/data/live-build-config/rootfs/excludes
index a5fe41e5..558e637b 100644
--- a/data/live-build-config/rootfs/excludes
+++ b/data/live-build-config/rootfs/excludes
@@ -44,7 +44,8 @@ usr/games/*
usr/local/games/*
# T5511: We do not need any caches on the system (will be recreated when needed).
-var/cache/*
+# T7278: We need directory created by python3-cracklib for password checks
+var/cache/!(cracklib)
# T5511: We do not need any log-files on the system (will be recreated when needed).
var/log/*.log