mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-10-01 06:21:56 -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>
(cherry picked from commit 39e6184419)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
committed by
Thomas Perale
parent
7e1d81d73d
commit
a403a0d662
@@ -140,4 +140,19 @@ define SHADOW_PERMISSIONS
|
|||||||
$(SHADOW_SUBORDINATE_IDS_PERMISSIONS)
|
$(SHADOW_SUBORDINATE_IDS_PERMISSIONS)
|
||||||
endef
|
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))
|
$(eval $(autotools-package))
|
||||||
|
|||||||
Reference in New Issue
Block a user