|
|
|
|
@ -1080,6 +1080,27 @@ config_str yon_ubl_get_all_users(int *user_size){
|
|
|
|
|
|
|
|
|
|
// parsing functions
|
|
|
|
|
|
|
|
|
|
int yon_password_get_min_len(){
|
|
|
|
|
int leng=6;
|
|
|
|
|
int login_size;
|
|
|
|
|
config_str login_defs = yon_file_open("/etc/security/pwquiality.conf",&login_size);
|
|
|
|
|
for (int i=0;i<login_size;i++){
|
|
|
|
|
if (login_defs[i][0]!='#'){
|
|
|
|
|
char *copy = yon_char_new(login_defs[i]);
|
|
|
|
|
char *divided = yon_char_divide(copy,7);
|
|
|
|
|
if (divided){
|
|
|
|
|
if (!strcmp(divided,"minlen")){
|
|
|
|
|
leng = atol(strstr(login_defs[i],"\t"));
|
|
|
|
|
}
|
|
|
|
|
free(divided);
|
|
|
|
|
}
|
|
|
|
|
free(copy);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(login_defs,login_size);
|
|
|
|
|
return leng;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float yon_size_convert_automatic(int bytes, int *size){
|
|
|
|
|
float byte_float=bytes;
|
|
|
|
|
for (*size=-1;byte_float>1024;*size=*size+1){
|
|
|
|
|
|