CS-16041. Not able to deploy Vms using base64 encoded userdata.

Relaxed the validation applied on userdata.
Reviewed by: Prachi
This commit is contained in:
Likitha Shetty 2012-08-17 11:42:31 +05:30
parent fc8b7210c2
commit 5b9224f290
1 changed files with 1 additions and 1 deletions

View File

@ -2563,7 +2563,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
private void validateUserData(String userData) {
byte[] decodedUserData = null;
if (userData != null) {
if ( !userData.matches("^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$")) {
if ( !org.apache.commons.codec.binary.Base64.isBase64(userData)) {
throw new InvalidParameterValueException("User data is not base64 encoded", null);
}
if (userData.length() >= 2 * MAX_USER_DATA_LENGTH_BYTES) {