Forráskód Böngészése

use a hash in the config

This avoids breakage when using a # in the password.
And no sensitive data is saved in clear on the target.
Suggested by a Achim Marikar.
Waldemar Brodkorb 10 éve
szülő
commit
28b1ec7d57
2 módosított fájl, 5 hozzáadás és 4 törlés
  1. 2 3
      package/base-files/Makefile
  2. 3 1
      target/config/Config.in.runtime

+ 2 - 3
package/base-files/Makefile

@@ -6,7 +6,7 @@ include $(ADK_TOPDIR)/mk/rootfs.mk
 
 PKG_NAME:=		base-files
 PKG_VERSION:=		1.1
-PKG_RELEASE:=		10
+PKG_RELEASE:=		11
 PKG_SECTION:=		base/apps
 PKG_DESCR:=		basic files and scripts
 
@@ -96,8 +96,7 @@ endif
 	    echo "ff02::2 ip6-allrouters" >> $(IDIR_BASE_FILES)/etc/hosts
 	    echo "ff02::3 ip6-allhosts" >> $(IDIR_BASE_FILES)/etc/hosts
 	test -z '$(ADK_RUNTIME_PASSWORD)' || \
-	    $(SED) 's,\*NP\*,'"$$($(STAGING_HOST_DIR)/usr/bin/mkcrypt \
-	    $$(awk -F\= '/^ADK_RUNTIME_PASSWORD/ { print $$2 }' $(ADK_TOPDIR)/.config|sed -e 's^\"^^g')),g" \
+	    $(SED) 's,\*NP\*,'"$$(awk -F\= '/^ADK_RUNTIME_PASSWORD/ { print $$2 }' $(ADK_TOPDIR)/.config|sed -e 's^\"^^g')),g" \
 		 $(IDIR_BASE_FILES)/etc/shadow
 	echo $(ADK_RUNTIME_TMPFS_SIZE) > $(IDIR_BASE_FILES)/etc/tmpfs
 ifeq ($(ADK_TARGET_WITH_ROOT_RW),y)

+ 3 - 1
target/config/Config.in.runtime

@@ -17,9 +17,11 @@ config ADK_RUNTIME_SSH_PUBKEY
 
 config ADK_RUNTIME_PASSWORD
 	string "root password for the embedded system"
-	default "linux123"
+	default "$1$bJoW4DmS$7fUVat.9iFSAePzA4j4Jm."
 	help
 	  Predefine the root password enabled in the built image.
+	  Use ./host_x86_64-linux-gnu/usr/bin/mkcrypt to generate the hash.
+	  Default password is linux123.
 
 config ADK_RUNTIME_START_SERVICES
 	bool "start services by default"