Added passsword policy parameters
Following parameters are added as compile time option to
control the complexitiy of the password.
- Minimum upper case characters
- Minimum lower case characters
- Minimum digits
NOTE: Add of all should be less than or equal to
minimum password length.
Tested:
1) Sum of all was greater then min password length
2) Negative value test.
3) Password strictness was getting imposed as the given configuration
Signed-off-by: Ratan Gupta <ratankgupta31@gmail.com>
diff --git a/configure.ac b/configure.ac
index c30e109..d36b4f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,18 @@
AS_IF([test "x$DEFAULT_CRYPT_ALGO" == "x"], [DEFAULT_CRYPT_ALGO="1"])
AC_DEFINE_UNQUOTED([DEFAULT_CRYPT_ALGO], ["$DEFAULT_CRYPT_ALGO"], [The default crypt algorithm if one not found in shadow])
+AC_ARG_VAR(MIN_UCASE_CHRS, [minimum number of upper case characters in the password])
+AS_IF([test "x$MIN_UCASE_CHRS" == "x"], [MIN_UCASE_CHRS=0])
+AC_DEFINE_UNQUOTED([MIN_UCASE_CHRS], [$MIN_UCASE_CHRS], [minimum number of upper case characters in the password])
+
+AC_ARG_VAR(MIN_LCASE_CHRS, [minimum number of lower case characters in the password])
+AS_IF([test "x$MIN_LCASE_CHRS" == "x"], [MIN_LCASE_CHRS=0])
+AC_DEFINE_UNQUOTED([MIN_LCASE_CHRS], [$MIN_LCASE_CHRS], [minimum number of lower case characters in the password])
+
+AC_ARG_VAR(MIN_DIGITS, [minimum number of digits in the password])
+AS_IF([test "x$MIN_DIGITS" == "x"], [MIN_DIGITS=0])
+AC_DEFINE_UNQUOTED([MIN_DIGITS], [$MIN_DIGITS], [minimum number of digits in the password])
+
# Check/set gtest specific functions.
AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
AC_SUBST(GTEST_CPPFLAGS)