From 8801af07013ddfdf517d42bb50a21ebfad621460 Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 4 Apr 2017 09:54:52 -0500 Subject: Password based on the device-id and Ethernet MAC not paths of the same. --- src/ubpasswd.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ubpasswd.sh b/src/ubpasswd.sh index c379563..1a32ef4 100755 --- a/src/ubpasswd.sh +++ b/src/ubpasswd.sh @@ -55,8 +55,8 @@ fi len=8 saltlen=128 mts=/sys/devices/platform/mts-io -did="${mts}/device-id" -mac="${mts}/mac-eth" +did=$(cat "${mts}/device-id") +mac=$(cat "${mts}/mac-eth") if ! /bin/fgrep "mts password protected" /dev/mtdblock2 >/dev/null 2>&1; then echo "U-Boot does not support password protection." @@ -68,8 +68,8 @@ fi echo "salt: $salt" -((v == 1)) && echo upwd is $upwd -((v == 1)) && echo did length is ${#did} +((debug)) && echo upwd is $upwd +((debug)) && echo did length is ${#did} if ((upwd == 0)) ; then if ((${#did} == 0)) ; then echo "${mts}/device-id must have a non-zero length value" @@ -79,7 +79,7 @@ if ((upwd == 0)) ; then echo "${mts}/mac-eth must have a non-zero length value" usage fi - if ((v == 1)) ; then + if ((debug)) ; then echo Try this: echo "/sbin/mts-hashpwd -d ${did} -m ${mac} ${salt}" fi @@ -91,7 +91,7 @@ if ! [[ $result =~ ^pass=([^[:space:]]+)[[:space:]]+password_hash=([^[:space:]]+ echo "/sbin/mts-hashpwd failed: ${result}" exit 1 fi -if ((v == 1)) ; then +if ((debug)) ; then echo result is: echo "$result" fi -- cgit v1.2.3