Updated Branches: refs/heads/trunk 873b3502b -> aa4b88fed
AMBARI-2620. Weak database passwords cause Hive fail to start. (Diego Pereira Domingos via srimanth) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/aa4b88fe Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/aa4b88fe Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/aa4b88fe Branch: refs/heads/trunk Commit: aa4b88fed9bfc7ab0fa70c78488e4b40c46aae7c Parents: 873b350 Author: Srimanth Gunturi <[email protected]> Authored: Thu Oct 17 17:43:31 2013 -0700 Committer: Srimanth Gunturi <[email protected]> Committed: Thu Oct 17 17:43:31 2013 -0700 ---------------------------------------------------------------------- ambari-web/app/models/service_config.js | 5 +++++ ambari-web/app/utils/validator.js | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/aa4b88fe/ambari-web/app/models/service_config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service_config.js b/ambari-web/app/models/service_config.js index 1c9bc97..e606bd9 100644 --- a/ambari-web/app/models/service_config.js +++ b/ambari-web/app/models/service_config.js @@ -584,6 +584,11 @@ App.ServiceConfigProperty = Ember.Object.extend({ this.set('errorMessage', 'Passwords do not match'); isError = true; } + else if (!validator.isValidPassword(value)){ + this.set('errorMessage', 'Weak password: too short.'); + isError = true; + } + } } http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/aa4b88fe/ambari-web/app/utils/validator.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/validator.js b/ambari-web/app/utils/validator.js index e161f0f..9bc1780 100644 --- a/ambari-web/app/utils/validator.js +++ b/ambari-web/app/utils/validator.js @@ -106,6 +106,16 @@ module.exports = { }, /** + * validate password + * @param value + * #return {Boolean} + */ + isValidPassword: function(value) { + var passwordRegex = /^.{5,}$/; + return passwordRegex.test(value); + }, + + /** * validate key of configurations * @param value * @return {Boolean} @@ -128,4 +138,4 @@ module.exports = { return false; } } -}; \ No newline at end of file +};
