List:Commits« Previous MessageNext Message »
From:Ashish Agarwal Date:May 10 2012 3:23pm
Subject:bzr push into mysql-trunk branch (ashish.y.agarwal:3885 to 3886)
View as plain text  
 3886 Ashish Agarwal	2012-05-10
      wl2739: Auditing Password Security
              Build failure in windows

    modified:
      plugin/password_validation/validate_password.cc
 3885 Ashish Agarwal	2012-05-10
      wl2739: Auditing Password Security
              Build failure in windows.

    modified:
      include/mysql/plugin_audit.h.pp
      include/mysql/plugin_auth.h.pp
      include/mysql/plugin_ftparser.h.pp
      include/mysql/service_password_string.h
      mysql-test/r/validate_password_plugin.result
      mysql-test/t/validate_password_plugin.test
      plugin/password_validation/validate_password.cc
      sql/share/CMakeLists.txt
=== modified file 'plugin/password_validation/validate_password.cc'
--- a/plugin/password_validation/validate_password.cc	2012-05-10 14:15:01 +0000
+++ b/plugin/password_validation/validate_password.cc	2012-05-10 15:22:26 +0000
@@ -13,7 +13,6 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
 
-#include <stdlib.h>
 #include <string>
 #include <mysql/plugin_validate_password.h>
 #include <set>
@@ -101,13 +100,13 @@ static int validate_dictionary_check(str
         password_substr= password_str.substr(substr_pos, substr_length);
         itr= dictionary_words.find(password_substr);
         if (itr != dictionary_words.end())
-          return 0;
+          return (0);
         substr_pos++;
       }
       substr_length--;
     }
   }
-  return 1;
+  return (1);
 }
 
 static int validate_password_policy(string_handle password, size_t length,
@@ -122,7 +121,7 @@ static int validate_password_policy(stri
   if ((int)length >= validate_password_length)
   {
     if (policy == PASSWORD_STRENGTH_LOW)
-      return 1;
+      return (1);
     password_string_case(&chars_case, password);
 
     if (chars_case.has_upper >= validate_password_mixed_case_count &&
@@ -132,10 +131,10 @@ static int validate_password_policy(stri
     {
       if (policy == PASSWORD_STRENGTH_MEDIUM ||
           validate_dictionary_check(password, length))
-        return 1;
+        return (1);
     }
   }
-  return 0;
+  return (0);
 }
 
 /* Actual plugin function which acts as a wrapper */
@@ -177,15 +176,25 @@ static struct st_mysql_validate_password
   get_password_strength                      /* validate strength function */
 };
 
+/**
+    Initialize the password plugin at server start or plugin installation
+    Does nothing, return 0
+*/
+
 static int validate_password_init(void *arg __attribute__((unused)))
 {
-  return 0;
+  return (0);
 }
 
+/**
+   Terminate the password plugin at server shutdown or plugin deinstallation.
+   It empty the std::set and returns 0
+*/
+
 static int validate_password_deinit(void *arg __attribute__((unused)))
 {
   free_dictionary_file();
-  return 0;
+  return (0);
 }
 
 /*

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (ashish.y.agarwal:3885 to 3886) Ashish Agarwal22 May