diff --git a/tests/aux/ldap.pl b/tests/aux/ldap.pl index 55be4d6..6007373 100755 --- a/tests/aux/ldap.pl +++ b/tests/aux/ldap.pl @@ -45,6 +45,7 @@ use constant RESULT_OK => { my %objects = ( '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=nokeys,ou=users,dc=example,dc=com' => {keys => []}, 'sub:base=:(uid=test)' => {keys => ['cccccccfhcbe', 'ccccccbchvth'], dn => 'uid=test,out=users,dc=example,dc=com'}, ); diff --git a/tests/pam_test.c b/tests/pam_test.c index 6be0d1f..25c2b2e 100644 --- a/tests/pam_test.c +++ b/tests/pam_test.c @@ -66,6 +66,7 @@ static struct data { {"test", "ccccccbchvthlivuitriujjifivbvtrjkjfirllluurj"}, {"foo", ""}, {"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); } +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) { pid_t pid = fork(); if(pid == 0) { @@ -354,6 +359,10 @@ int main(void) { ret = 1007; goto out; } + if(test_authenticate_ldap6() != PAM_USER_UNKNOWN) { + ret = 1008; + goto out; + } #endif out: