Commit ed251e9c authored by Alessandro Rubini's avatar Alessandro Rubini

userspace/config: fix a problem with encrypted root password

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent c189e26c
......@@ -47,8 +47,9 @@ passwd=""
if [ ! -z "$CONFIG_ROOT_PWD_CLEAR" ]; then
passwd=$(/wr/bin/mkpasswd --method=md5 "$CONFIG_ROOT_PWD_CLEAR")
fi
if [ ! -z "$CONFIG_ROOT_PWD_CYPHER" ]; then
passwd="$CONFIG_ROOT_PWD_CYPHER"
if [ ! -z "$CONFIG_ROOT_PWD_IS_ENCRYPTED" ]; then
#problem: the password includes '$', so the shell assignment failed.
passwd=$(busybox awk '-F"' '/PWD_CYPHER/ {print $2}' /wr/etc/dot-config)
fi
if [ ! -z "$passwd" ]; then
sed -i "s,^root:[^:]*:,root:$passwd:," /etc/shadow
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment