mirror of
https://github.com/Yubico/yubico-pam.git
synced 2025-02-01 10:52:17 +01:00
Add test for LDAP entries with empty token list
This commit is contained in:
parent
fc3b1e0076
commit
d048a4a6e2
@ -45,6 +45,7 @@ use constant RESULT_OK => {
|
|||||||
my %objects = (
|
my %objects = (
|
||||||
'base=uid=foo,ou=users,dc=example,dc=com' => {keys => ['vvincredible']},
|
'base=uid=foo,ou=users,dc=example,dc=com' => {keys => ['vvincredible']},
|
||||||
'base=uid=test,ou=users,dc=example,dc=com' => {keys => ['cccccccfhcbe', 'ccccccbchvth']},
|
'base=uid=test,ou=users,dc=example,dc=com' => {keys => ['cccccccfhcbe', 'ccccccbchvth']},
|
||||||
|
'base=uid=nokeys,ou=users,dc=example,dc=com' => {keys => []},
|
||||||
'sub:base=:(uid=test)' => {keys => ['cccccccfhcbe', 'ccccccbchvth'], dn => 'uid=test,out=users,dc=example,dc=com'},
|
'sub:base=:(uid=test)' => {keys => ['cccccccfhcbe', 'ccccccbchvth'], dn => 'uid=test,out=users,dc=example,dc=com'},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ static struct data {
|
|||||||
{"test", "ccccccbchvthlivuitriujjifivbvtrjkjfirllluurj"},
|
{"test", "ccccccbchvthlivuitriujjifivbvtrjkjfirllluurj"},
|
||||||
{"foo", ""},
|
{"foo", ""},
|
||||||
{"bar", ""},
|
{"bar", ""},
|
||||||
|
{"nokeys", ""},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -274,6 +275,10 @@ static int test_authenticate_ldap5(void) {
|
|||||||
return pam_sm_authenticate(6, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
|
return pam_sm_authenticate(6, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int test_authenticate_ldap6(void) {
|
||||||
|
return pam_sm_authenticate(7, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_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) {
|
||||||
@ -354,6 +359,10 @@ int main(void) {
|
|||||||
ret = 1007;
|
ret = 1007;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
if(test_authenticate_ldap6() != PAM_USER_UNKNOWN) {
|
||||||
|
ret = 1008;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user