Added function

pull/43/head
parent c399dcab32
commit efa9ccff09

@ -1080,6 +1080,27 @@ config_str yon_ubl_get_all_users(int *user_size){
// parsing functions // 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 yon_size_convert_automatic(int bytes, int *size){
float byte_float=bytes; float byte_float=bytes;
for (*size=-1;byte_float>1024;*size=*size+1){ for (*size=-1;byte_float>1024;*size=*size+1){

@ -625,6 +625,8 @@ config_str yon_ubl_get_all_users(int *user_size);
// parsing functions // parsing functions
int yon_password_get_min_len();
/** yon_size_convert_automatic(int bytes, int *size) /** yon_size_convert_automatic(int bytes, int *size)
* [EN] * [EN]
* *

Loading…
Cancel
Save