cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [4/4] git commit: updated refs/heads/master to 17d5bfa
Date Thu, 03 Dec 2015 08:59:26 GMT
Merge pull request #841 from karuturi/CLOUDSTACK-8868

CLOUDSTACK-8868: use PasswordGenerator.generateRandomPassword() to generate systemvm passwordsgenerateRandomPassword()
is supposed to create root user passwords. Right now it is only used on the guest VMs. The
format of the passwords it creates are of the form "random 3-character string with a lowercase
character, uppercase character, and a digit" + random n-character string with only lowercase
characters".

For whatever reason it was that we use generateRandomPassword() for guest VM root user passwords(maybe
more secure?) we should use the same function for system VM root user passwords.

Tests:
manually tested that password is generated in proper format and am able to login to cpvm with
the new password. ex: zD2ztm, tR8snbwhq

```
$ mvn -pl server test -Dtest=ConfigurationServerImplTest#testUpdateSystemvmPassword
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.cloud.server.ConfigurationServerImplTest
log4j:WARN No appenders could be found for logger (com.cloud.utils.crypt.EncryptionSecretKeyChecker).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.487 sec - in com.cloud.server.ConfigurationServerImplTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.781 s
[INFO] Finished at: 2015-09-16T14:17:07+05:30
[INFO] Final Memory: 60M/466M
[INFO] ------------------------------------------------------------------------
```

* pr/841:
  CLOUDSTACK-8868: change the default vm.password.length to 10
  CLOUDSTACK-8868: use same method to generate passwords for system/guest vms
  removed commented code

Signed-off-by: Remi Bergsma <github@remi.nl>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/17d5bfa3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/17d5bfa3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/17d5bfa3

Branch: refs/heads/master
Commit: 17d5bfa32c5285bc0c96eade29ba9589b3e828c2
Parents: 4ffad54 f531881
Author: Remi Bergsma <github@remi.nl>
Authored: Thu Dec 3 09:58:51 2015 +0100
Committer: Remi Bergsma <github@remi.nl>
Committed: Thu Dec 3 09:58:52 2015 +0100

----------------------------------------------------------------------
 server/src/com/cloud/configuration/Config.java  |  8 --
 .../configuration/ConfigurationManagerImpl.java |  2 +-
 .../cloud/server/ConfigurationServerImpl.java   | 28 +------
 .../com/cloud/server/ManagementServerImpl.java  | 17 ++++-
 .../server/ConfigurationServerImplTest.java     | 78 ++++++++++++++++++++
 5 files changed, 97 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/17d5bfa3/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 9032ff9,74af277..566f46e
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@@ -773,17 -770,9 +773,17 @@@ public class ConfigurationManagerImpl e
                      throw new InvalidParameterValueException("Please enter a positive value
for the configuration parameter:" + name);
                  }
                  //TODO - better validation for all password pamameters
-                 if ("vm.password.length".equalsIgnoreCase(name) && val < 6) {
+                 if ("vm.password.length".equalsIgnoreCase(name) && val < 10)
{
                      throw new InvalidParameterValueException("Please enter a value greater
than 6 for the configuration parameter:" + name);
                  }
 +                if ("remote.access.vpn.psk.length".equalsIgnoreCase(name)) {
 +                    if (val < 8) {
 +                        throw new InvalidParameterValueException("Please enter a value greater
than 8 for the configuration parameter:" + name);
 +                    }
 +                    if (val > 256) {
 +                        throw new InvalidParameterValueException("Please enter a value less
than 256 for the configuration parameter:" + name);
 +                    }
 +                }
              } catch (final NumberFormatException e) {
                  s_logger.error("There was an error trying to parse the integer value for:"
+ name);
                  throw new InvalidParameterValueException("There was an error trying to parse
the integer value for:" + name);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/17d5bfa3/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------


Mime
View raw message