mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 20:43:02 +02:00
confd: Fix failure-config generation when password is missing
Setting admin's password to "!" is not accepted by the model, which means we end up in RMA mode, even in cases when a valid startup exists. Not supplying a password will cause confd to generate a locked account, which is what we want.
This commit is contained in:
committed by
Joachim Wiberg
parent
e53fd91c7f
commit
2da2e7fd5e
@@ -7,9 +7,10 @@ pwhash=$(jq -r '."factory-password-hash"' /run/system.json)
|
||||
if [ -z "$pwhash" ] || [ "$pwhash" = "null" ]; then
|
||||
# Do not fail, lock account instead. This way developers can enable
|
||||
# root account login at build-time to diagnose the system.
|
||||
pwhash="!"
|
||||
password=""
|
||||
rc=1
|
||||
else
|
||||
password="\"password\": \"$pwhash\","
|
||||
rc=0
|
||||
fi
|
||||
|
||||
@@ -20,7 +21,7 @@ cat <<EOF
|
||||
"user": [
|
||||
{
|
||||
"name": "admin",
|
||||
"password": "$pwhash",
|
||||
${password}
|
||||
"infix-system:shell": "$shell"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user