From 5ff1c3c5a12930692cb6284d14f7fda3a974af8e Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Tue, 22 Jan 2013 14:31:37 +0100 Subject: sudo responder: change num_rules type from size_t to uint32_t https://fedorahosted.org/sssd/ticket/1779 2^32 should be enough to store sudo rules. size_t type was causing troubles on big endian architectures, because it wasn't used correctly in combination with D-Bus. --- src/responder/sudo/sudosrv_query.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/responder/sudo/sudosrv_query.c') diff --git a/src/responder/sudo/sudosrv_query.c b/src/responder/sudo/sudosrv_query.c index 1574104cb..a8501df56 100644 --- a/src/responder/sudo/sudosrv_query.c +++ b/src/responder/sudo/sudosrv_query.c @@ -188,7 +188,7 @@ done: */ errno_t sudosrv_build_response(TALLOC_CTX *mem_ctx, uint32_t error, - int rules_num, + uint32_t rules_num, struct sysdb_attrs **rules, uint8_t **_response_body, size_t *_response_len) @@ -196,7 +196,7 @@ errno_t sudosrv_build_response(TALLOC_CTX *mem_ctx, uint8_t *response_body = NULL; size_t response_len = 0; TALLOC_CTX *tmp_ctx = NULL; - int i = 0; + uint32_t i = 0; errno_t ret = EOK; tmp_ctx = talloc_new(NULL); @@ -225,7 +225,7 @@ errno_t sudosrv_build_response(TALLOC_CTX *mem_ctx, } /* rules count */ - ret = sudosrv_response_append_uint32(tmp_ctx, (uint32_t)rules_num, + ret = sudosrv_response_append_uint32(tmp_ctx, rules_num, &response_body, &response_len); if (ret != EOK) { goto fail; -- cgit