mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-09 07:51:59 -09:00
package/shadow: default to BR2_TARGET_GENERIC_PASSWD_ algo
Make shadow follow the the BR2_TARGET_GENERIC_PASSWD_* system configuration option when changing password rather than DES. Fixes: https://gitlab.com/buildroot.org/buildroot/-/issues/134 Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
committed by
Julien Olivain
parent
807b0bab37
commit
39e6184419
@@ -140,4 +140,19 @@ define SHADOW_PERMISSIONS
|
||||
$(SHADOW_SUBORDINATE_IDS_PERMISSIONS)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_TARGET_GENERIC_PASSWD_SHA256),y)
|
||||
SHADOW_ENCRYPT_METHOD = SHA256
|
||||
else ifeq ($(BR2_TARGET_GENERIC_PASSWD_SHA512),y)
|
||||
SHADOW_ENCRYPT_METHOD = SHA512
|
||||
endif
|
||||
|
||||
ifneq ($(SHADOW_ENCRYPT_METHOD),)
|
||||
define SHADOW_SET_ENCRYPT_METHOD
|
||||
$(SED) 's/^[#]\?ENCRYPT_METHOD .*/ENCRYPT_METHOD $(SHADOW_ENCRYPT_METHOD)/' \
|
||||
$(TARGET_DIR)/etc/login.defs
|
||||
endef
|
||||
|
||||
SHADOW_POST_INSTALL_TARGET_HOOKS += SHADOW_SET_ENCRYPT_METHOD
|
||||
endif
|
||||
|
||||
$(eval $(autotools-package))
|
||||
|
||||
Reference in New Issue
Block a user