confd: do not fail if pwhash is missing in VPD, instead lock account

If pwhash is missing from system.json, lock account.  This allows for
more extensive diagnosis on developer builds with a root login.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-11-24 08:55:57 +01:00
parent 8141cc13d1
commit f53f985dbc
+8 -1
View File
@@ -5,7 +5,12 @@ shell="$1"
pwhash="$(jq .pwhash /run/system.json)"
if [ -z "$pwhash" ] || [ "$pwhash" = "null" ]; then
exit 1
# Do not fail, lock account instead. This way developers can enable
# root account login at build-tiem to diagnose the system.
pwhash="!"
rc=1
else
rc=0
fi
cat <<EOF
@@ -23,3 +28,5 @@ cat <<EOF
}
}
EOF
exit $rc