fix: Legacy username validation (#1966)

This commit is contained in:
Kroese
2026-07-25 21:30:26 +02:00
committed by GitHub
parent 4cf7dc005b
commit 184ab1c481
+10 -5
View File
@@ -946,7 +946,8 @@ validateLegacyUsername() {
fi
case "$value" in
*'"'* | *'/'* | *\\* | *'['* | *']'* | *':'* | *';'* | *'|'* | *'='* | *','* | *'+'* | *'*'* | *'?'* | *'<'* | *'>'* )
*'"'* | *'/'* | *\\* | *'['* | *']'* | *':'* | *';'* | *'|'* | *'='* | \
*','* | *'+'* | *'*'* | *'?'* | *'<'* | *'>'* | *'%'* )
error "The USERNAME variable contains unsupported characters$suffix!"
return 1 ;;
esac
@@ -961,10 +962,14 @@ validateLegacyUsername() {
return 1
fi
if [[ "${value^^}" == "GUEST" ]]; then
error "The USERNAME value \"$value\" is reserved for a built-in Windows account$suffix!"
return 1
fi
case "${value^^}" in
"NONE" )
error "The USERNAME value \"NONE\" is reserved by Windows$suffix!"
return 1 ;;
"ADMINISTRATOR" | "GUEST" | "DEFAULTACCOUNT" | "WDAGUTILITYACCOUNT" | "WSIACCOUNT" )
error "The USERNAME value \"$value\" is reserved for a built-in Windows account$suffix!"
return 1 ;;
esac
return 0
}