[SSSD] [PATCH] declare hostip only in debug mode

2009-09-24 Thread Sumit Bose
Hi,

this patch suppresses a compiler warning when KRB5_PLUGIN_DEBUG is not
set, which is the common case.

bye,
Sumit
From bc6076e2cf15cfe63afee133921063a12a611eec Mon Sep 17 00:00:00 2001
From: Sumit Bose sb...@redhat.com
Date: Thu, 24 Sep 2009 14:28:33 +0200
Subject: [PATCH] declare hostip only in debug mode

---
 server/krb5_plugin/sssd_krb5_locator_plugin.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/krb5_plugin/sssd_krb5_locator_plugin.c 
b/server/krb5_plugin/sssd_krb5_locator_plugin.c
index 82ab8e9..18e47c4 100644
--- a/server/krb5_plugin/sssd_krb5_locator_plugin.c
+++ b/server/krb5_plugin/sssd_krb5_locator_plugin.c
@@ -117,12 +117,12 @@ krb5_error_code sssd_krb5_locator_lookup(void 
*private_data,
 int ret;
 struct addrinfo *ai;
 struct sssd_ctx *ctx;
-char hostip[NI_MAXHOST];
 
 if (private_data == NULL) return KRB5_PLUGIN_NO_HANDLE;
 ctx = (struct sssd_ctx *) private_data;
 
 #ifdef KRB5_PLUGIN_DEBUG
+char hostip[NI_MAXHOST];
 fprintf(stderr,sssd_realm[%s] requested realm[%s] family[%d] 
socktype[%d] locate_service[%d]\n,
ctx-sssd_realm, realm, family, socktype, svc);
-- 
1.6.2.5

___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


Re: [SSSD] [PATCH] declare hostip only in debug mode

2009-09-24 Thread Sumit Bose
On Thu, Sep 24, 2009 at 09:09:04AM -0400, Simo Sorce wrote:
 On Thu, 2009-09-24 at 14:39 +0200, Sumit Bose wrote:
  Hi,
  
  this patch suppresses a compiler warning when KRB5_PLUGIN_DEBUG is not
  set, which is the common case.
 
 Sumit,
 would it be possible to use an env variable to control debug instead of
 a compile time define ? That would solve it more neatly and also make it
 simple to activate debugging at will.
 
 Simo.
 

Thanks, very nice idea. I will set it automatically if the debug level
of the Kerberos provider is 5 or higher and anyone is free to set it
explicit when needed.

bye,
Sumit
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel