mirror of
https://github.com/Yubico/yubico-pam.git
synced 2025-02-26 21:54:15 +01:00
sql: test failure cases
This commit is contained in:
parent
26b310cda9
commit
60eba4fbac
@ -346,6 +346,10 @@ static int test_fail_authenticate_mysql1(void) {
|
|||||||
return pam_sm_authenticate((pam_handle_t *)1, 0, sizeof(mysql_cfg) / sizeof(char*), mysql_cfg);
|
return pam_sm_authenticate((pam_handle_t *)1, 0, sizeof(mysql_cfg) / sizeof(char*), mysql_cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int test_fail_authenticate_mysql2(void) {
|
||||||
|
return pam_sm_authenticate((pam_handle_t *)5, 0, sizeof(mysql_cfg) / sizeof(char*), mysql_cfg);
|
||||||
|
}
|
||||||
|
|
||||||
static pid_t run_mock(const char *port, const char *type) {
|
static pid_t run_mock(const char *port, const char *type) {
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
if(pid == 0) {
|
if(pid == 0) {
|
||||||
@ -452,6 +456,10 @@ int main(void) {
|
|||||||
ret = 2002;
|
ret = 2002;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
if(test_fail_authenticate_mysql2() != PAM_AUTH_ERR) {
|
||||||
|
ret = 2003;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user