1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

B #4103: crop size of spice random password (#4618)

This commit is contained in:
Alejandro Huertas Herrero 2020-04-28 18:24:46 +02:00 committed by GitHub
parent c85f9a1031
commit 9a5d637c4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -416,7 +416,17 @@ int VirtualMachine::parse_graphics(string& error_str, Template * tmpl)
if ( !random_passwd.empty() )
{
graphics->replace("PASSWD", one_util::random_password());
string password = one_util::random_password();
if ( graphics->vector_value("TYPE") == "SPICE" )
{
// Spice password must be 60 characters maximum
graphics->replace("PASSWD", password.substr(0, 59));
}
else
{
graphics->replace("PASSWD", password);
}
}
return 0;