[SSSD] [PATCH] DP: Print a type as hexadecimal number in debug message.

Lukas Slebodnik lslebodn at redhat.com
Wed Oct 1 20:57:10 UTC 2014


ehlo,

I was analysing log files for unrelated problem and I had to convert decimal
number to hexidecimalt to compare type in debug message in function
be_get_account_info. BE_REQ_* numbers are defined as hexadecimal in header file
src/providers/data_provider.h

Simple patch is attached.

LS
-------------- next part --------------
>From 8a469d1eee964afdc8ea2db70e1d04807b367d15 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Wed, 1 Oct 2014 15:58:24 +0200
Subject: [PATCH] DP: Print a type as hexadecimal number in debug message.

All request from nss responder, start in domain log with debug message
in function be_get_account_info e.g.
[be_get_account_info] (0x0100): Got request for [4099][1][name=user1]
[be_get_account_info] (0x0100): Got request for [4098][1][name=group1]
[be_get_account_info] (0x0100): Got request for [4097][1][name=user1]

The 1st number is type, which is defined as hexadecimal nuber
in header file src/providers/data_provider.h
 #define BE_REQ_USER          0x0001
 #define BE_REQ_GROUP         0x0002
 #define BE_REQ_INITGROUPS    0x0003
 ...

This patch changes formatting from decimal representation to hexadecimal;
so you needn't convert it in head while analysing log files.
---
 src/providers/data_provider_be.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index d5dc024193383f94dbe1f2aab3af8ad83d5f0abf..6e7fcd51033345ac34999689e812b226b27ecb06 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -1093,7 +1093,7 @@ static int be_get_account_info(struct sbus_request *dbus_req, void *user_data)
         return EOK; /* handled */
 
     DEBUG(SSSDBG_FUNC_DATA,
-          "Got request for [%u][%d][%s]\n", type, attr_type, filter);
+          "Got request for [%#x][%d][%s]\n", type, attr_type, filter);
 
     /* If we are offline and fast reply was requested
      * return offline immediately
-- 
2.1.0



More information about the sssd-devel mailing list