Browse Source

allow passwords with special characters, like #. reported by Martin T.

Waldemar Brodkorb 10 years ago
parent
commit
e816651b16
2 changed files with 4 additions and 3 deletions
  1. 3 3
      package/base-files/Makefile
  2. 1 0
      rules.mk

+ 3 - 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:=		5
+PKG_RELEASE:=		6
 PKG_SECTION:=		base/apps
 PKG_DESCR:=		basic files and scripts
 
@@ -78,8 +78,8 @@ endif
 	    echo "::1		localhost" >> $(IDIR_BASE_FILES)/etc/hosts
 	    echo "127.0.1.1	$(ADK_RUNTIME_HOSTNAME)" >> $(IDIR_BASE_FILES)/etc/hosts
 	test -z $(ADK_RUNTIME_PASSWORD) || \
-	    $(SED) 's,\*NP\*,'"$$($(STAGING_HOST_DIR)/usr/bin/mkcrypt \
-	    ${ADK_RUNTIME_PASSWORD}),g" $(IDIR_BASE_FILES)/etc/shadow
+	    passwd=$$($(STAGING_HOST_DIR)/usr/bin/mkcrypt '${ADK_RUNTIME_PASSWORD}'); \
+	    $(SED) "s,\*NP\*,$$passwd,g" $(IDIR_BASE_FILES)/etc/shadow
 	echo $(ADK_RUNTIME_TMPFS_SIZE) > $(IDIR_BASE_FILES)/etc/tmpfs
 ifeq ($(ADK_TARGET_WITH_ROOT_RW),y)
 	echo 'export IPKGTMPDIR=/root/.ipkg' >> $(IDIR_BASE_FILES)/etc/profile

+ 1 - 0
rules.mk

@@ -46,6 +46,7 @@ ADK_TARGET_SUFFIX:=			$(strip $(subst ",, $(ADK_TARGET_SUFFIX)))
 ADK_TARGET_CMDLINE:=			$(strip $(subst ",, $(ADK_TARGET_CMDLINE)))
 ADK_QEMU_ARGS:=				$(strip $(subst ",, $(ADK_QEMU_ARGS)))
 ADK_RUNTIME_TMPFS_SIZE:=		$(strip $(subst ",, $(ADK_RUNTIME_TMPFS_SIZE)))
+ADK_RUNTIME_PASSWORD:=			$(strip $(subst ",, $(ADK_RUNTIME_PASSWORD)))
 ADK_RUNTIME_CONSOLE_SERIAL_SPEED:=	$(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)))
 ADK_RUNTIME_CONSOLE_SERIAL_DEVICE:=	$(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE)))
 ADK_HOST:=				$(strip $(subst ",, $(ADK_HOST)))