From patchwork Tue Jul 15 15:09:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 4554691 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1A989C0515 for ; Tue, 15 Jul 2014 15:09:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C75A82012B for ; Tue, 15 Jul 2014 15:09:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF2CA20179 for ; Tue, 15 Jul 2014 15:09:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753322AbaGOPJt (ORCPT ); Tue, 15 Jul 2014 11:09:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56647 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753313AbaGOPJr (ORCPT ); Tue, 15 Jul 2014 11:09:47 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6FF9eAu006313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Jul 2014 11:09:40 -0400 Received: from smallhat.boston.devel.redhat.com (smallhat.boston.devel.redhat.com [10.19.60.65]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6FF9ahS009793; Tue, 15 Jul 2014 11:09:39 -0400 From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 06/15] libtirpc_debug: Converted the rest of the #ifdef DEBUGs Date: Tue, 15 Jul 2014 11:09:25 -0400 Message-Id: <1405436974-4161-7-git-send-email-steved@redhat.com> In-Reply-To: <1405436974-4161-1-git-send-email-steved@redhat.com> References: <1405436974-4161-1-git-send-email-steved@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace the rest of the fprintf(stderr) surrounded by #ifdef DEBUGS with the LIBTIRPC_DEBUG() macro Signed-off-by: Steve Dickson --- src/auth_gss.c | 18 ++++++------------ src/getpublickey.c | 13 ++++++------- src/netnamer.c | 20 ++++++++------------ src/svc_auth_gss.c | 2 -- 4 files changed, 20 insertions(+), 33 deletions(-) diff --git a/src/auth_gss.c b/src/auth_gss.c index 76bab66..e636e7e 100644 --- a/src/auth_gss.c +++ b/src/auth_gss.c @@ -49,6 +49,8 @@ #include #include +#include "debug.h" + static void authgss_nextverf(AUTH *); static bool_t authgss_marshal(AUTH *, XDR *); static bool_t authgss_refresh(AUTH *, void *); @@ -164,9 +166,7 @@ authgss_create(CLIENT *clnt, gss_name_t name, struct rpc_gss_sec *sec) free(auth); return (NULL); } -#ifdef DEBUG - fprintf(stderr, "authgss_create: name is %p\n", name); -#endif + LIBTIRPC_DEBUG(2, ("authgss_create: name is %p\n", name)); if (name != GSS_C_NO_NAME) { if (gss_duplicate_name(&min_stat, name, &gd->name) != GSS_S_COMPLETE) { @@ -179,9 +179,7 @@ authgss_create(CLIENT *clnt, gss_name_t name, struct rpc_gss_sec *sec) else gd->name = name; -#ifdef DEBUG - fprintf(stderr, "authgss_create: gd->name is %p\n", gd->name); -#endif + LIBTIRPC_DEBUG(2, ("authgss_create: gd->name is %p\n", gd->name)); gd->clnt = clnt; gd->ctx = GSS_C_NO_CONTEXT; gd->sec = *sec; @@ -234,9 +232,7 @@ authgss_create_default(CLIENT *clnt, char *service, struct rpc_gss_sec *sec) auth = authgss_create(clnt, name, sec); if (name != GSS_C_NO_NAME) { -#ifdef DEBUG - fprintf(stderr, "authgss_create_default: freeing name %p\n", name); -#endif + LIBTIRPC_DEBUG(1, ("authgss_create_default: freeing name %p\n", name)); gss_release_name(&min_stat, &name); } @@ -627,9 +623,7 @@ authgss_destroy(AUTH *auth) authgss_destroy_context(auth); -#ifdef DEBUG - fprintf(stderr, "authgss_destroy: freeing name %p\n", gd->name); -#endif + LIBTIRPC_DEBUG(2, ("authgss_destroy: freeing name %p\n", gd->name)); if (gd->name != GSS_C_NO_NAME) gss_release_name(&min_stat, &gd->name); diff --git a/src/getpublickey.c b/src/getpublickey.c index 332c725..85935d8 100644 --- a/src/getpublickey.c +++ b/src/getpublickey.c @@ -46,6 +46,8 @@ #include #include +#include "debug.h" + #define PKFILE "/etc/publickey" /* @@ -120,9 +122,8 @@ getpublicandprivatekey(key, ret) lookup = NULL; err = yp_match(domain, PKMAP, key, strlen(key), &lookup, &len); if (err) { -#ifdef DEBUG - fprintf(stderr, "match failed error %d\n", err); -#endif + LIBTIRPC_DEBUG(1, + ("getpublicandprivatekey: match failed error %d\n", err)); continue; } lookup[len] = 0; @@ -131,10 +132,8 @@ getpublicandprivatekey(key, ret) free(lookup); return (2); #else /* YP */ -#ifdef DEBUG - fprintf(stderr, -"Bad record in %s '+' -- NIS not supported in this library copy\n", PKFILE); -#endif /* DEBUG */ + LIBTIRPC_DEBUG(1, +("Bad record in %s '+' -- NIS not supported in this library copy\n", PKFILE)); continue; #endif /* YP */ } else { diff --git a/src/netnamer.c b/src/netnamer.c index 9b3b7dc..7da2f0d 100644 --- a/src/netnamer.c +++ b/src/netnamer.c @@ -47,6 +47,8 @@ #include #include +#include "debug.h" + static char *OPSYS = "unix"; static char *NETID = "netid.byname"; static char *NETIDFILE = "/etc/netid"; @@ -159,10 +161,8 @@ _getgroups(uname, groups) for (i = 0; grp->gr_mem[i]; i++) if (!strcmp(grp->gr_mem[i], uname)) { if (ngroups == NGROUPS) { -#ifdef DEBUG - fprintf(stderr, - "initgroups: %s is in too many groups\n", uname); -#endif + LIBTIRPC_DEBUG(1, + ("_getgroups: %s is in too many groups\n", uname)); goto toomany; } /* filter out duplicate group entries */ @@ -279,9 +279,7 @@ getnetid(key, ret) err = yp_match(domain, NETID, key, strlen(key), &lookup, &len); if (err) { -#ifdef DEBUG - fprintf(stderr, "match failed error %d\n", err); -#endif + LIBTIRPC_DEBUG(1, ("getnetid: match failed error %d\n", err)); continue; } lookup[len] = 0; @@ -291,11 +289,9 @@ getnetid(key, ret) fclose(fd); return (2); #else /* YP */ -#ifdef DEBUG - fprintf(stderr, -"Bad record in %s '+' -- NIS not supported in this library copy\n", - NETIDFILE); -#endif + LIBTIRPC_DEBUG(1, +("Bad record in %s '+' -- NIS not supported in this library copy\n", + NETIDFILE)); continue; #endif /* YP */ } else { diff --git a/src/svc_auth_gss.c b/src/svc_auth_gss.c index a032dd6..155c8de 100644 --- a/src/svc_auth_gss.c +++ b/src/svc_auth_gss.c @@ -248,7 +248,6 @@ svcauth_gss_accept_sec_context(struct svc_req *rqst, maj_stat, min_stat); return (FALSE); } -#ifdef DEBUG #ifdef HAVE_KRB5 { gss_buffer_desc mechname; @@ -269,7 +268,6 @@ svcauth_gss_accept_sec_context(struct svc_req *rqst, gd->cname.length, (char *)gd->cname.value, gd->sec.qop, gd->sec.svc); #endif -#endif /* DEBUG */ seq = htonl(gr->gr_win); seqbuf.value = &seq; seqbuf.length = sizeof(seq);