Jan 26

if you want to modify qmailadmin to check if new password is strong you can do like this:

edit qmailadmin.c and:

add:   #include <ctype.h>

I wrote a function to check if new password contains at least 1 alphachar and 1 digit.

add it before int main(argc,argv)


int check_strong(char *pass_string)
{
    int digit=0;
    int alpha=0;
    int length=strlen(pass_string);
    int i;
    for(i=0;i<length;i++){
       if( digit == 1 && alpha == 1 ) return 1;
       else{
                  if(isdigit(pass_string[i])) digit=1;
                  if(isalpha(pass_string[i])) alpha=1;
       }
    }
    return 0;
}
Continue reading »

written by MG \\ tags: , , , ,