From patchwork Tue Sep 29 15:36:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Mayhew X-Patchwork-Id: 7287731 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CD450BEEA4 for ; Tue, 29 Sep 2015 15:37:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F33242061D for ; Tue, 29 Sep 2015 15:37:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F22A620615 for ; Tue, 29 Sep 2015 15:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933335AbbI2PhG (ORCPT ); Tue, 29 Sep 2015 11:37:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47778 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934853AbbI2Pgo (ORCPT ); Tue, 29 Sep 2015 11:36:44 -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 (Postfix) with ESMTPS id 75C572E8349 for ; Tue, 29 Sep 2015 15:36:44 +0000 (UTC) Received: from tonberry.usersys.redhat.com (dhcp145-188.rdu.redhat.com [10.13.145.188]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8TFahbn031688 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 29 Sep 2015 11:36:44 -0400 Received: from tonberry.usersys.redhat.com (localhost [127.0.0.1]) by tonberry.usersys.redhat.com (8.14.8/8.14.5) with ESMTP id t8TFahhl028108; Tue, 29 Sep 2015 11:36:43 -0400 Received: (from smayhew@localhost) by tonberry.usersys.redhat.com (8.14.8/8.14.8/Submit) id t8TFahkg028107; Tue, 29 Sep 2015 11:36:43 -0400 From: Scott Mayhew To: steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [nfs-utils PATCH] Allow gssd and svcgssd to set the libtirpc debug level Date: Tue, 29 Sep 2015 11:36:43 -0400 Message-Id: <1443541003-28073-1-git-send-email-smayhew@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, T_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 The interface for controlling the debug level in libtirpc was added over a year ago, but nothing's taking advantage of it. Signed-off-by: Scott Mayhew --- aclocal/libtirpc.m4 | 6 ++++++ utils/gssd/gssd.c | 7 +++++++ utils/gssd/svcgssd.c | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4 index b7de636..27368ff 100644 --- a/aclocal/libtirpc.m4 +++ b/aclocal/libtirpc.m4 @@ -20,6 +20,12 @@ AC_DEFUN([AC_LIBTIRPC], [ [Define to 1 if your rpcsec library provides authgss_free_private_data])],, [${LIBS}])]) + AS_IF([test -n "${LIBTIRPC}"], + [AC_CHECK_LIB([tirpc], [libtirpc_set_debug], + [AC_DEFINE([HAVE_LIBTIRPC_SET_DEBUG], [1], + [Define to 1 if your tirpc library provides libtirpc_set_debug])],, + [${LIBS}])]) + AC_SUBST([AM_CPPFLAGS]) AC_SUBST(LIBTIRPC) diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c index e480349..078e558 100644 --- a/utils/gssd/gssd.c +++ b/utils/gssd/gssd.c @@ -869,6 +869,13 @@ main(int argc, char *argv[]) if (verbosity && rpc_verbosity == 0) rpc_verbosity = verbosity; authgss_set_debug_level(rpc_verbosity); +#elif HAVE_LIBTIRPC_SET_DEBUG + /* + * Only set the libtirpc debug level if explicitly requested via -r... + * gssd is chatty enough as it is. + */ + if (rpc_verbosity > 0) + libtirpc_set_debug(progname, rpc_verbosity, fg); #else if (rpc_verbosity > 0) printerr(0, "Warning: rpcsec_gss library does not " diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c index f1b4347..0fe7c6d 100644 --- a/utils/gssd/svcgssd.c +++ b/utils/gssd/svcgssd.c @@ -135,6 +135,13 @@ main(int argc, char *argv[]) if (verbosity && rpc_verbosity == 0) rpc_verbosity = verbosity; authgss_set_debug_level(rpc_verbosity); +#elif HAVE_LIBTIRPC_SET_DEBUG + /* + * Only set the libtirpc debug level if explicitly requested via -r... + * svcgssd is chatty enough as it is. + */ + if (rpc_verbosity > 0) + libtirpc_set_debug(progname, rpc_verbosity, fg); #else if (rpc_verbosity > 0) printerr(0, "Warning: rpcsec_gss library does not "