From patchwork Fri May 8 08:17:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thorsten Kukuk X-Patchwork-Id: 6363391 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7B5019F373 for ; Fri, 8 May 2015 08:17:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 694E220172 for ; Fri, 8 May 2015 08:17:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6243D2015A for ; Fri, 8 May 2015 08:17:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752353AbbEHIRY (ORCPT ); Fri, 8 May 2015 04:17:24 -0400 Received: from cantor2.suse.de ([195.135.220.15]:40795 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752346AbbEHIRU (ORCPT ); Fri, 8 May 2015 04:17:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1792CAAC7; Fri, 8 May 2015 08:17:18 +0000 (UTC) Date: Fri, 8 May 2015 10:17:17 +0200 From: Thorsten Kukuk To: Steve Dickson , libtirpc-devel@lists.sourceforge.net, linux-nfs@vger.kernel.org Subject: Re: [PATCH V2] Fix Build w/gssapi disabled Message-ID: <20150508081717.GA16376@suse.de> References: <1430983149-22199-1-git-send-email-vapier@gentoo.org> <20150507115248.GA20243@suse.de> <554B86E2.8090908@RedHat.com> <20150507163326.GA6156@suse.de> <554B98E9.4040601@RedHat.com> <20150507181206.GA7810@suse.de> <554BC53C.5080807@RedHat.com> <554BC730.3000004@RedHat.com> <554BC9F3.6020005@RedHat.com> <20150508020322.GF30924@vapier> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150508020322.GF30924@vapier> User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Thu, May 07, Mike Frysinger wrote: > it is dangerous to export raw HAVE_xxx defines -- it can break packages that > use autotools themselves. they need an appropriate prefix like RPC_xxx or > TIRPC_xxx. For this and to solve the different size of the struct, I created a new patch on top of current git. I only had to rearange the structs a little bit, since they don't use any kerberos specific variables, only standard C: diff --git a/configure.ac b/configure.ac index 290c635..5d11a69 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_ARG_ENABLE(gssapi, AM_CONDITIONAL(GSS, test "x$enable_gssapi" = xyes) if test "x$enable_gssapi" = xyes; then - AC_DEFINE([HAVE_GSSAPI], [1], [Define to 1 if GSSAPI is enabled]) + AC_DEFINE([TIRPC_GSSAPI], [1], [Define to 1 if GSSAPI is enabled]) GSSAPI_CFLAGS=`krb5-config --cflags gssapi` GSSAPI_LIBS=`krb5-config --libs gssapi` AC_SUBST([GSSAPI_CFLAGS]) @@ -22,7 +22,7 @@ AC_ARG_ENABLE(authdes, [],[enable_authdes=no]) AM_CONDITIONAL(AUTHDES, test "x$enable_authdes" = xyes) if test "x$enable_authdes" = xyes; then - AC_DEFINE([HAVE_AUTHDES], [1], + AC_DEFINE([TIRPC_AUTHDES], [1], [Define to 1 if DES authentication is enabled]) CFLAG_AUTHDES="-DHAVE_AUTHDES=1" AC_SUBST([CFLAG_AUTHDES]) diff --git a/tirpc/rpc/auth.h b/tirpc/rpc/auth.h index f7fa16c..6cf512a 100644 --- a/tirpc/rpc/auth.h +++ b/tirpc/rpc/auth.h @@ -164,7 +164,7 @@ union des_block { }; typedef union des_block des_block; -#ifdef HAVE_AUTHDES +#ifdef TIRPC_AUTHDES #ifdef __cplusplus extern "C" { #endif @@ -172,7 +172,7 @@ extern bool_t xdr_des_block(XDR *, des_block *); #ifdef __cplusplus } #endif -#endif /* HAVE_AUTHDES */ +#endif /* TIRPC_AUTHDES */ /* * Authentication info. Opaque to client. @@ -320,7 +320,7 @@ extern AUTH *authnone_create(void); /* takes no parameters */ } #endif -#ifdef HAVE_AUTHDES +#ifdef TIRPC_AUTHDES /* * DES style authentication * AUTH *authsecdes_create(servername, window, timehost, ckey) @@ -338,7 +338,7 @@ extern AUTH *authdes_seccreate (const char *, const u_int, const char *, #ifdef __cplusplus } #endif -#endif /* HAVE_AUTHDES */ +#endif /* TIRPC_AUTHDES */ #ifdef __cplusplus extern "C" { @@ -362,9 +362,9 @@ extern int host2netname(char *, const char *, const char *); extern int user2netname(char *, const uid_t, const char *); extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *); extern int netname2host(char *, char *, const int); -#ifdef HAVE_AUTHDES +#ifdef TIRPC_AUTHDES extern void passwd2des ( char *, char * ); -#endif /* HAVE_AUTHDES */ +#endif /* TIRPC_AUTHDES */ #ifdef __cplusplus } #endif diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h index 8f37454..942959a 100644 --- a/tirpc/rpc/rpc.h +++ b/tirpc/rpc/rpc.h @@ -54,15 +54,15 @@ #include /* protocol for rpc messages */ #include /* protocol for unix style cred */ -#ifdef HAVE_AUTHDES +#ifdef TIRPC_AUTHDES /* * Uncomment-out the next line if you are building the rpc library with * DES Authentication (see the README file in the secure_rpc/ directory). */ #include /* protocol for des style cred */ -#endif /* HAVE_AUTHDES */ +#endif /* TIRPC_AUTHDES */ -#ifdef HAVE_GSSAPI +#ifdef TIRPC_GSSAPI #include /* RPCSEC_GSS */ #endif diff --git a/tirpc/rpc/rpcsec_gss.h b/tirpc/rpc/rpcsec_gss.h index 217fc0d..767988c 100644 --- a/tirpc/rpc/rpcsec_gss.h +++ b/tirpc/rpc/rpcsec_gss.h @@ -50,6 +50,19 @@ typedef struct { } *rpc_gss_principal_t; typedef struct { + u_int version; + char *mechanism; + char *qop; + rpc_gss_principal_t client_principal; + char *svc_principal; + rpc_gss_service_t service; +} rpc_gss_rawcred_t; + +#ifdef TIRPC_GSSAPI + +#include + +typedef struct { int req_flags; int time_req; gss_cred_id_t my_cred; @@ -68,15 +81,6 @@ typedef struct { } rpc_gss_options_ret_t; typedef struct { - u_int version; - char *mechanism; - char *qop; - rpc_gss_principal_t client_principal; - char *svc_principal; - rpc_gss_service_t service; -} rpc_gss_rawcred_t; - -typedef struct { uid_t uid; gid_t gid; short gidlen; @@ -129,4 +133,6 @@ bool_t rpc_gss_mech_to_oid(char *, rpc_gss_OID *); bool_t rpc_gss_qop_to_num(char *, char *, u_int *); __END_DECLS +#endif /* TIRPC_GSSAPI */ + #endif /* !_TIRPC_RPCSEC_GSS_H */ diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h index dbd8cc9..f91bf01 100644 --- a/tirpc/rpc/svc_auth.h +++ b/tirpc/rpc/svc_auth.h @@ -42,9 +42,6 @@ #define _RPC_SVC_AUTH_H #include - -#ifdef HAVE_GSSAPI - #include typedef struct { @@ -55,8 +52,6 @@ typedef struct { u_int seq_num; } svc_rpc_gss_parms_t; -#endif /* HAVE_GSSAPI */ - /* * Interface to server-side authentication flavors. */ @@ -69,10 +64,8 @@ typedef struct SVCAUTH { int (*svc_ah_destroy)(struct SVCAUTH *); } *svc_ah_ops; caddr_t svc_ah_private; -#ifdef HAVE_GSSAPI svc_rpc_gss_parms_t svc_gss_params; rpc_gss_rawcred_t raw_cred; -#endif } SVCAUTH; #define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \ diff --git a/tirpc/tirpc-features.h.in b/tirpc/tirpc-features.h.in index 72e18bc..39fa64e 100644 --- a/tirpc/tirpc-features.h.in +++ b/tirpc/tirpc-features.h.in @@ -2,9 +2,9 @@ #define _TIRPC_FEATURES_H /* Define to 1 if DES authentication is enabled */ -#undef HAVE_AUTHDES +#undef TIRPC_AUTHDES /* Define to 1 if GSSAPI is enabled */ -#undef HAVE_GSSAPI +#undef TIRPC_GSSAPI #endif /* _TIRPC_FEATURES_H */