mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipa-kdb: fix gcc complaints in kdb tests
We use string_to_sid() from internal Samba libraries, so we have to link to it properly. In addition, size_t is (long unsigned int), just cast to (int) in asprintf. Fixes: https://pagure.io/freeipa/issue/8585 Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
f513a55ded
commit
fc11c56544
@ -92,6 +92,7 @@ ipa_kdb_tests_SOURCES += ipa_kdb_kdcpolicy.c
|
||||
endif
|
||||
|
||||
ipa_kdb_tests_CFLAGS = $(CMOCKA_CFLAGS)
|
||||
ipa_kdb_tests_LDFLAGS = -L$(libdir)/samba -Wl,-rpath=$(libdir)/samba
|
||||
ipa_kdb_tests_LDADD = \
|
||||
$(CMOCKA_LIBS) \
|
||||
$(KRB5_LIBS) \
|
||||
@ -102,6 +103,7 @@ ipa_kdb_tests_LDADD = \
|
||||
$(top_builddir)/util/libutil.la \
|
||||
-lkdb5 \
|
||||
-lsss_idmap \
|
||||
-lsamba-security-samba4 \
|
||||
$(NULL)
|
||||
|
||||
appdir = $(libexecdir)/ipa
|
||||
|
@ -72,7 +72,7 @@ struct test_ctx {
|
||||
#define DOM_SID_TRUST "S-1-5-21-4-5-6"
|
||||
#define BLOCKLIST_SID "S-1-5-1"
|
||||
#define NUM_SUFFIXES 10
|
||||
#define SUFFIX_TEMPLATE "d%0d" DOMAIN_NAME
|
||||
#define SUFFIX_TEMPLATE "d%zu" DOMAIN_NAME
|
||||
#define TEST_REALM_TEMPLATE "some." SUFFIX_TEMPLATE
|
||||
#define EXTERNAL_REALM "WRONG.DOMAIN"
|
||||
|
||||
@ -136,7 +136,8 @@ static int setup(void **state)
|
||||
ipa_ctx->mspac->trusts[0].upn_suffixes = calloc(NUM_SUFFIXES + 1, sizeof(char *));
|
||||
ipa_ctx->mspac->trusts[0].upn_suffixes_len = calloc(NUM_SUFFIXES, sizeof(size_t));
|
||||
for (size_t i = 0; i < NUM_SUFFIXES; i++) {
|
||||
asprintf(&(ipa_ctx->mspac->trusts[0].upn_suffixes[i]), SUFFIX_TEMPLATE, i);
|
||||
assert_int_not_equal(asprintf(&(ipa_ctx->mspac->trusts[0].upn_suffixes[i]),
|
||||
SUFFIX_TEMPLATE, i), -1);
|
||||
ipa_ctx->mspac->trusts[0].upn_suffixes_len[i] =
|
||||
strlen(ipa_ctx->mspac->trusts[0].upn_suffixes[i]);
|
||||
|
||||
@ -504,7 +505,7 @@ void test_check_trusted_realms(void **state)
|
||||
|
||||
for(size_t i = 0; i < NUM_SUFFIXES; i++) {
|
||||
char *test_realm = NULL;
|
||||
asprintf(&test_realm, TEST_REALM_TEMPLATE, i);
|
||||
assert_int_not_equal(asprintf(&test_realm, TEST_REALM_TEMPLATE, i), -1);
|
||||
|
||||
if (test_realm) {
|
||||
kerr = ipadb_is_princ_from_trusted_realm(
|
||||
|
Loading…
Reference in New Issue
Block a user