Blob Blame History Raw
From 9c22ba8f68b48aff49bcdc8af67964a8852e998c Mon Sep 17 00:00:00 2001
From: amitkuma <amitkuma@redhat.com>
Date: Tue, 14 Nov 2017 13:59:12 +0530
Subject: [PATCH 200/201] cache_req: Correction of cache_req debug string ID
 format
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The cache-req debug string representation uses a wrong format
specifier for by-ID requests.
data->id (uint32_t) should be replaced with  %"PRIu32"
in cache_req_group_by_id.c, cache_req_object_by_id.c &
cache_req_user_by_id.c.

Resolves:
https://pagure.io/SSSD/sssd/issue/3570

Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
(cherry picked from commit d25646c64a7117a6551468256efa82d01647751e)
---
 src/responder/common/cache_req/plugins/cache_req_group_by_id.c  | 2 +-
 src/responder/common/cache_req/plugins/cache_req_object_by_id.c | 2 +-
 src/responder/common/cache_req/plugins/cache_req_user_by_id.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/responder/common/cache_req/plugins/cache_req_group_by_id.c b/src/responder/common/cache_req/plugins/cache_req_group_by_id.c
index 5ca64283a781318bc4e4d6920fff989c3f3919b4..121f95abe86d2466aaea69f0fe68dfb33b1fee9e 100644
--- a/src/responder/common/cache_req/plugins/cache_req_group_by_id.c
+++ b/src/responder/common/cache_req/plugins/cache_req_group_by_id.c
@@ -31,7 +31,7 @@ cache_req_group_by_id_create_debug_name(TALLOC_CTX *mem_ctx,
                                         struct cache_req_data *data,
                                         struct sss_domain_info *domain)
 {
-    return talloc_asprintf(mem_ctx, "GID:%d@%s", data->id, domain->name);
+    return talloc_asprintf(mem_ctx, "GID:%"PRIu32"@%s", data->id, domain->name);
 }
 
 static errno_t
diff --git a/src/responder/common/cache_req/plugins/cache_req_object_by_id.c b/src/responder/common/cache_req/plugins/cache_req_object_by_id.c
index 339bd4f5fef827acc1aa3c123d041e426d9e4782..4c88e1035b41969703c1c38d740e15516ac0d622 100644
--- a/src/responder/common/cache_req/plugins/cache_req_object_by_id.c
+++ b/src/responder/common/cache_req/plugins/cache_req_object_by_id.c
@@ -31,7 +31,7 @@ cache_req_object_by_id_create_debug_name(TALLOC_CTX *mem_ctx,
                                          struct cache_req_data *data,
                                          struct sss_domain_info *domain)
 {
-    return talloc_asprintf(mem_ctx, "ID:%d@%s", data->id, domain->name);
+    return talloc_asprintf(mem_ctx, "ID:%"PRIu32"@%s", data->id, domain->name);
 }
 
 static errno_t
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_id.c b/src/responder/common/cache_req/plugins/cache_req_user_by_id.c
index 913f9be5bcc2dfd074b52cb3b15fb6948826e831..3c25c7631b3da4a829ab577629334a7ee97980da 100644
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_id.c
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_id.c
@@ -31,7 +31,7 @@ cache_req_user_by_id_create_debug_name(TALLOC_CTX *mem_ctx,
                                        struct cache_req_data *data,
                                        struct sss_domain_info *domain)
 {
-    return talloc_asprintf(mem_ctx, "UID:%d@%s", data->id, domain->name);
+    return talloc_asprintf(mem_ctx, "UID:%"PRIu32"@%s", data->id, domain->name);
 }
 
 static errno_t
-- 
2.14.3