passwdqc: align with usermngr (move PAM setup to usermngr)

This commit is contained in:
Mohd Husaam Mehdi 2025-07-23 13:11:51 +05:30
parent 1151478d13
commit 511e0af668
2 changed files with 0 additions and 22 deletions

View file

@ -39,9 +39,6 @@ define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/security
$(INSTALL_BIN) $(PKG_BUILD_DIR)/pam_passwdqc.so $(1)/usr/lib/security/
$(INSTALL_DIR) $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/passwdqc.uci_default $(1)/etc/uci-defaults/99-add_passwdqc_pam
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View file

@ -1,19 +0,0 @@
#!/bin/sh
CONFIG_FILE="/etc/pam.d/common-password"
# for some reason setting to 8 makes passwdqc accept minimum 12 letter password with this configuration
# if we set it to 12 then we need atleast 16 characters and so on
# passphrase = 0 means no space separated words
# rest can be figured out from passwdqc man page
MODULE_LINE="password requisite pam_passwdqc.so min=disabled,disabled,disabled,disabled,8 max=20 passphrase=0 retry=3 enforce=everyone"
# Ensure the file exists before modifying
[ -f "$CONFIG_FILE" ] || exit 0
# Check if pam_passwdqc is already in the file
if ! grep -q "pam_passwdqc.so" "$CONFIG_FILE"; then
# Insert before pam_unix.so
sed -i "/pam_unix.so/ i\\$MODULE_LINE" "$CONFIG_FILE"
fi
exit 0