Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warning in pam_test.c #169

Merged
merged 1 commit into from
Oct 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions tests/pam_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ struct pam_modutil_privs {
};
#endif

int
pam_sm_authenticate (pam_handle_t * pamh,
int flags, int argc, const char **argv);

#define YKVAL_PORT1 "17502"
#define YKVAL_PORT2 "30559"
#define LDAP_PORT "52825"
Expand Down Expand Up @@ -181,7 +185,7 @@ static int test_authenticate1(void) {
"authfile="AUTHFILE,
"debug",
};
return pam_sm_authenticate(0, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)0, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_authenticate2(void) {
Expand All @@ -191,7 +195,7 @@ static int test_authenticate2(void) {
"authfile="AUTHFILE,
"debug",
};
return pam_sm_authenticate(0, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)0, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_authenticate3(void) {
Expand All @@ -201,7 +205,7 @@ static int test_authenticate3(void) {
"authfile="AUTHFILE,
"debug",
};
return pam_sm_authenticate(4, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)4, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_authenticate4(void) {
Expand All @@ -211,7 +215,7 @@ static int test_authenticate4(void) {
"authfile="AUTHFILE,
"debug",
};
return pam_sm_authenticate(5, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)5, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_authenticate5(void) {
Expand All @@ -221,7 +225,7 @@ static int test_authenticate5(void) {
"authfile="AUTHFILE,
"debug",
};
return pam_sm_authenticate(6, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)6, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_fail_authenticate1(void) {
Expand All @@ -231,7 +235,7 @@ static int test_fail_authenticate1(void) {
"authfile="AUTHFILE,
"debug"
};
return pam_sm_authenticate(1, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)1, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_fail_authenticate2(void) {
Expand All @@ -241,7 +245,7 @@ static int test_fail_authenticate2(void) {
"authfile="AUTHFILE,
"debug"
};
return pam_sm_authenticate(2, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)2, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_fail_authenticate3(void) {
Expand All @@ -251,7 +255,7 @@ static int test_fail_authenticate3(void) {
"authfile="AUTHFILE,
"debug"
};
return pam_sm_authenticate(3, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)3, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_firstpass_authenticate(void) {
Expand All @@ -262,7 +266,7 @@ static int test_firstpass_authenticate(void) {
"use_first_pass",
"debug"
};
return pam_sm_authenticate(8, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)8, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_firstpass_fail(void) {
Expand All @@ -273,7 +277,7 @@ static int test_firstpass_fail(void) {
"use_first_pass",
"debug"
};
return pam_sm_authenticate(9, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)9, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_firstpass_fail2(void) {
Expand All @@ -284,39 +288,39 @@ static int test_firstpass_fail2(void) {
"use_first_pass",
"debug"
};
return pam_sm_authenticate(10, 0, sizeof(cfg) / sizeof(char*), cfg);
return pam_sm_authenticate((pam_handle_t *)10, 0, sizeof(cfg) / sizeof(char*), cfg);
}

static int test_authenticate_ldap1(void) {
return pam_sm_authenticate(0, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
return pam_sm_authenticate((pam_handle_t *)0, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
}

static int test_authenticate_ldap_fail1(void) {
return pam_sm_authenticate(1, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
return pam_sm_authenticate((pam_handle_t *)1, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
}

static int test_authenticate_ldap_fail2(void) {
return pam_sm_authenticate(2, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
return pam_sm_authenticate((pam_handle_t *)2, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
}

static int test_authenticate_ldap2(void) {
return pam_sm_authenticate(4, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
return pam_sm_authenticate((pam_handle_t *)4, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
}

static int test_authenticate_ldap3(void) {
return pam_sm_authenticate(4, 0, sizeof(ldap_cfg2) / sizeof(char*), ldap_cfg2);
return pam_sm_authenticate((pam_handle_t *)4, 0, sizeof(ldap_cfg2) / sizeof(char*), ldap_cfg2);
}

static int test_authenticate_ldap4(void) {
return pam_sm_authenticate(5, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
return pam_sm_authenticate((pam_handle_t *)5, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
}

static int test_authenticate_ldap5(void) {
return pam_sm_authenticate(6, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
return pam_sm_authenticate((pam_handle_t *)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);
return pam_sm_authenticate((pam_handle_t *)7, 0, sizeof(ldap_cfg) / sizeof(char*), ldap_cfg);
}

static pid_t run_mock(const char *port, const char *type) {
Expand Down