version 1.2, 2012/09/19 15:22:31
|
version 1.3, 2013/05/30 09:12:27
|
Line 2
|
Line 2
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
#include <time.h> |
#include <time.h> |
#include "aitcfg.h" | #include <aitcfg.h> |
#include "aitpwd.h" | #include <aitpwd.h> |
|
|
|
|
int main() |
int main() |
Line 72 int main()
|
Line 72 int main()
|
printf("\n----------\n"); |
printf("\n----------\n"); |
|
|
/* unit test set */ |
/* unit test set */ |
printf("cfg_setPasswd %p\n", cfg_setPasswd(&db, 4, "use", "alabala", 101, 4, | printf("cfg_setPasswd %d\n", cfg_setPasswd(&db, 4, "use", "alabala", 101, 4, |
NULL, 0, 0, NULL, NULL, NULL)); |
NULL, 0, 0, NULL, NULL, NULL)); |
printf("cfg_setPasswd %p\n", cfg_setPasswd(&db, 3, "use", "alabala", 101, 3, | printf("cfg_setPasswd %d\n", cfg_setPasswd(&db, 3, "use", "alabala", 101, 3, |
NULL, 0, 0, NULL, NULL, NULL)); |
NULL, 0, 0, NULL, NULL, NULL)); |
printf("cfg_setPasswd %p\n", cfg_setPasswd(&db, 3, "user_l", "pliok", 999, 3, | printf("cfg_setPasswd %d\n", cfg_setPasswd(&db, 3, "user_l", "pliok", 999, 3, |
NULL, 0, 0, NULL, NULL, NULL)); |
NULL, 0, 0, NULL, NULL, NULL)); |
printf("cfg_setPasswd %p\n", cfg_setPasswd(&db, 2, "use1", "WC_00", 0, 0, | printf("cfg_setPasswd %d\n", cfg_setPasswd(&db, 2, "use1", "WC_00", 0, 0, |
NULL, 0, 0, NULL, NULL, NULL)); |
NULL, 0, 0, NULL, NULL, NULL)); |
printf("cfg_setPasswd %p\n", cfg_setPasswd(&db, 0, "USE1", "WC_00", 10000, 20, | printf("cfg_setPasswd %d\n", cfg_setPasswd(&db, 0, "USE1", "WC_00", 10000, 20, |
NULL, 0, 0, "TEST for use", "/home/USE1", "/bin/sh")); |
NULL, 0, 0, "TEST for use", "/home/USE1", "/bin/sh")); |
printf("cfg_setPasswd %p\n", cfg_setPasswd(&db, 0, "USE2", "WC_!!", 10001, 20, | printf("cfg_setPasswd %d\n", cfg_setPasswd(&db, 0, "USE2", "WC_!!", 10001, 20, |
NULL, 0, 0, "TEST for use", "/home/USE2", NULL)); |
NULL, 0, 0, "TEST for use", "/home/USE2", NULL)); |
|
|
printf("\n----------\n"); |
printf("\n----------\n"); |
Line 92 int main()
|
Line 92 int main()
|
printf("-> user=%s %u:%u \"%s\"\n", AIT_GET_STR(&u->usr_name), |
printf("-> user=%s %u:%u \"%s\"\n", AIT_GET_STR(&u->usr_name), |
(u_int) AIT_RAW(&u->usr_uid), (u_int) AIT_RAW(&u->usr_gid), |
(u_int) AIT_RAW(&u->usr_uid), (u_int) AIT_RAW(&u->usr_gid), |
AIT_GET_LIKE(&u->usr_realm, char*)); |
AIT_GET_LIKE(&u->usr_realm, char*)); |
printf("unset %p\n", cfg_unsetPasswd(&db, PWD_CRIT_NAME, "ttt")); | printf("unset %d\n", cfg_unsetPasswd(&db, PWD_CRIT_NAME, "ttt")); |
printf("unset %p\n", cfg_unsetPasswd(&db, PWD_CRIT_NAME, "tttZZZ")); | printf("unset %d\n", cfg_unsetPasswd(&db, PWD_CRIT_NAME, "tttZZZ")); |
printf("unset %p\n", cfg_unsetPasswd(&db, PWD_CRIT_NAME, "ttt")); | printf("unset %d\n", cfg_unsetPasswd(&db, PWD_CRIT_NAME, "ttt")); |
|
|
printf("\n----------\n"); |
printf("\n----------\n"); |
|
|