2015-05-07 07:19:12

by Mike Frysinger

[permalink] [raw]
Subject: [PATCH libtirpc] fix build w/gssapi disabled

Starting with commit d5259e751111cb108c784b044296185f543fc0be (Add header
definitions for rpc_gss_*() APIs), the gss headers were pulled in all the
time leading to build failures like so:
CC libtirpc_la-bindresvport.lo
In file included from ../tirpc/rpc/svc_auth.h:44:0,
from ../tirpc/rpc/rpc.h:68,
from bindresvport.c:46:
../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory

Signed-off-by: Mike Frysinger <[email protected]>
---
tirpc/rpc/svc_auth.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
index 44b38bf..998b13a 100644
--- a/tirpc/rpc/svc_auth.h
+++ b/tirpc/rpc/svc_auth.h
@@ -41,6 +41,8 @@
#ifndef _RPC_SVC_AUTH_H
#define _RPC_SVC_AUTH_H

+#ifdef HAVE_RPCSEC_GSS
+
#include <rpc/rpcsec_gss.h>

typedef struct {
@@ -51,6 +53,8 @@ typedef struct {
u_int seq_num;
} svc_rpc_gss_parms_t;

+#endif
+
/*
* Interface to server-side authentication flavors.
*/
@@ -63,8 +67,10 @@ typedef struct SVCAUTH {
int (*svc_ah_destroy)(struct SVCAUTH *);
} *svc_ah_ops;
caddr_t svc_ah_private;
+#ifdef HAVE_RPCSEC_GSS
svc_rpc_gss_parms_t svc_gss_params;
rpc_gss_rawcred_t raw_cred;
+#endif
} SVCAUTH;

#define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \
--
2.4.0



2015-05-07 07:40:48

by Thorsten Kukuk

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled


Hi,

On Thu, May 07, Mike Frysinger wrote:

> Starting with commit d5259e751111cb108c784b044296185f543fc0be (Add header
> definitions for rpc_gss_*() APIs), the gss headers were pulled in all the
> time leading to build failures like so:
> CC libtirpc_la-bindresvport.lo
> In file included from ../tirpc/rpc/svc_auth.h:44:0,
> from ../tirpc/rpc/rpc.h:68,
> from bindresvport.c:46:
> ../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory

This will not work since this headers will be installed in
/usr/include and other appliations compiled against libtirpc
will never define HAVE_RPCSEC_GSS, thus never see this interfaces.

We need something like the glibc features.h file, which will always
be included and defines, how tirpc was configured.

Thorsten

> Signed-off-by: Mike Frysinger <[email protected]>
> ---
> tirpc/rpc/svc_auth.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
> index 44b38bf..998b13a 100644
> --- a/tirpc/rpc/svc_auth.h
> +++ b/tirpc/rpc/svc_auth.h
> @@ -41,6 +41,8 @@
> #ifndef _RPC_SVC_AUTH_H
> #define _RPC_SVC_AUTH_H
>
> +#ifdef HAVE_RPCSEC_GSS
> +
> #include <rpc/rpcsec_gss.h>
>
> typedef struct {
> @@ -51,6 +53,8 @@ typedef struct {
> u_int seq_num;
> } svc_rpc_gss_parms_t;
>
> +#endif
> +
> /*
> * Interface to server-side authentication flavors.
> */
> @@ -63,8 +67,10 @@ typedef struct SVCAUTH {
> int (*svc_ah_destroy)(struct SVCAUTH *);
> } *svc_ah_ops;
> caddr_t svc_ah_private;
> +#ifdef HAVE_RPCSEC_GSS
> svc_rpc_gss_parms_t svc_gss_params;
> rpc_gss_rawcred_t raw_cred;
> +#endif
> } SVCAUTH;
>
> #define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \
> --
> 2.4.0
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Libtirpc-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libtirpc-devel

--
Thorsten Kukuk, Senior Architect SLES & Common Code Base
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG N?rnberg)

2015-05-07 08:23:45

by Mike Frysinger

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled

On 07 May 2015 09:40, Thorsten Kukuk wrote:
> On Thu, May 07, Mike Frysinger wrote:
> > Starting with commit d5259e751111cb108c784b044296185f543fc0be (Add header
> > definitions for rpc_gss_*() APIs), the gss headers were pulled in all the
> > time leading to build failures like so:
> > CC libtirpc_la-bindresvport.lo
> > In file included from ../tirpc/rpc/svc_auth.h:44:0,
> > from ../tirpc/rpc/rpc.h:68,
> > from bindresvport.c:46:
> > ../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory
>
> This will not work since this headers will be installed in
> /usr/include and other appliations compiled against libtirpc
> will never define HAVE_RPCSEC_GSS, thus never see this interfaces.
>
> We need something like the glibc features.h file, which will always
> be included and defines, how tirpc was configured.

this is what tirpc/rpc/rpc.h is already doing ...
-mike


Attachments:
(No filename) (949.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-05-07 08:51:02

by Thorsten Kukuk

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled

On Thu, May 07, Mike Frysinger wrote:

> On 07 May 2015 09:40, Thorsten Kukuk wrote:
> > On Thu, May 07, Mike Frysinger wrote:
> > > Starting with commit d5259e751111cb108c784b044296185f543fc0be (Add header
> > > definitions for rpc_gss_*() APIs), the gss headers were pulled in all the
> > > time leading to build failures like so:
> > > CC libtirpc_la-bindresvport.lo
> > > In file included from ../tirpc/rpc/svc_auth.h:44:0,
> > > from ../tirpc/rpc/rpc.h:68,
> > > from bindresvport.c:46:
> > > ../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory
> >
> > This will not work since this headers will be installed in
> > /usr/include and other appliations compiled against libtirpc
> > will never define HAVE_RPCSEC_GSS, thus never see this interfaces.
> >
> > We need something like the glibc features.h file, which will always
> > be included and defines, how tirpc was configured.
>
> this is what tirpc/rpc/rpc.h is already doing ...

Ok, I haven't seen that this is already broken :(
Means we need a solution how to provide this defines asap.

Thorsten

--
Thorsten Kukuk, Senior Architect SLES & Common Code Base
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG N?rnberg)

2015-05-07 11:52:49

by Thorsten Kukuk

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled


Hi,

On Thu, May 07, Mike Frysinger wrote:

> Starting with commit d5259e751111cb108c784b044296185f543fc0be (Add header
> definitions for rpc_gss_*() APIs), the gss headers were pulled in all the
> time leading to build failures like so:
> CC libtirpc_la-bindresvport.lo
> In file included from ../tirpc/rpc/svc_auth.h:44:0,
> from ../tirpc/rpc/rpc.h:68,
> from bindresvport.c:46:
> ../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory

Here is my proof of concept how I think we should solve this.
But there is one part of your patch I have no solution for:

> --- a/tirpc/rpc/svc_auth.h
> +++ b/tirpc/rpc/svc_auth.h
[...]
> @@ -63,8 +67,10 @@ typedef struct SVCAUTH {
> int (*svc_ah_destroy)(struct SVCAUTH *);
> } *svc_ah_ops;
> caddr_t svc_ah_private;
> +#ifdef HAVE_RPCSEC_GSS
> svc_rpc_gss_parms_t svc_gss_params;
> rpc_gss_rawcred_t raw_cred;
> +#endif
> } SVCAUTH;

You are changeing the size of a struct here. I'm not sure
if this will work, if an application is compiled with headers
where it is disabled and then runs with a tirpc where it is
enabled. Or the other way around.
Does somebody have an idea how to solve that?

Else here is my patch:

diff --git a/Makefile.am b/Makefile.am
index 2bf725c..2bce3b0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,9 +4,11 @@ ACLOCAL_AMFLAGS = -I m4
noinst_HEADERS = tirpc/reentrant.h \
tirpc/getpeereid.h \
tirpc/libc_private.h \
- tirpc/un-namespace.h
+ tirpc/un-namespace.h \
+ tirpc/tirpc-features.h.in

nobase_include_HEADERS = tirpc/netconfig.h \
+ tirpc/tirpc-features.h \
tirpc/rpcsvc/crypt.x \
tirpc/rpcsvc/crypt.h \
tirpc/rpc/xdr.h \
diff --git a/configure.ac b/configure.ac
index 711b054..290c635 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +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])
GSSAPI_CFLAGS=`krb5-config --cflags gssapi`
GSSAPI_LIBS=`krb5-config --libs gssapi`
AC_SUBST([GSSAPI_CFLAGS])
@@ -41,7 +42,7 @@ AC_ARG_ENABLE(symvers,
AM_CONDITIONAL(SYMVERS, test "x$enable_symvers" = xyes)

AC_PROG_CC
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([config.h tirpc/tirpc-features.h])
AC_PROG_LIBTOOL
AC_HEADER_DIRENT
AC_PREFIX_DEFAULT(/usr)
diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h
index 1dbb391..8f37454 100644
--- a/tirpc/rpc/rpc.h
+++ b/tirpc/rpc/rpc.h
@@ -35,6 +35,8 @@
#ifndef _TIRPC_RPC_H
#define _TIRPC_RPC_H

+#include <tirpc-features.h>
+
#include <rpc/types.h> /* some typedefs */
#include <sys/socket.h>
#include <netinet/in.h>
@@ -60,7 +62,7 @@
#include <rpc/auth_des.h> /* protocol for des style cred */
#endif /* HAVE_AUTHDES */

-#ifdef HAVE_RPCSEC_GSS
+#ifdef HAVE_GSSAPI
#include <rpc/auth_gss.h> /* RPCSEC_GSS */
#endif

diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
index 44b38bf..b308d2b 100644
--- a/tirpc/rpc/svc_auth.h
+++ b/tirpc/rpc/svc_auth.h
@@ -41,6 +41,10 @@
#ifndef _RPC_SVC_AUTH_H
#define _RPC_SVC_AUTH_H

+#include <tirpc-features.h>
+
+#ifdef HAVE_GSSAPI
+
#include <rpc/rpcsec_gss.h>

typedef struct {
@@ -51,6 +55,8 @@ typedef struct {
u_int seq_num;
} svc_rpc_gss_parms_t;

+#endif /* HAVE_GSSAPI */
+
/*
* Interface to server-side authentication flavors.
*/
diff --git a/tirpc/tirpc-features.h.in b/tirpc/tirpc-features.h.in
index e69de29..72e18bc 100644
--- a/tirpc/tirpc-features.h.in
+++ b/tirpc/tirpc-features.h.in
@@ -0,0 +1,10 @@
+#ifndef _TIRPC_FEATURES_H
+#define _TIRPC_FEATURES_H
+
+/* Define to 1 if DES authentication is enabled */
+#undef HAVE_AUTHDES
+
+/* Define to 1 if GSSAPI is enabled */
+#undef HAVE_GSSAPI
+
+#endif /* _TIRPC_FEATURES_H */


--
Thorsten Kukuk, Senior Architect SLES & Common Code Base
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG N?rnberg)

2015-05-07 15:12:53

by Mike Frysinger

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled

On 07 May 2015 13:52, Thorsten Kukuk wrote:
> On Thu, May 07, Mike Frysinger wrote:
> > Starting with commit d5259e751111cb108c784b044296185f543fc0be (Add header
> > definitions for rpc_gss_*() APIs), the gss headers were pulled in all the
> > time leading to build failures like so:
> > CC libtirpc_la-bindresvport.lo
> > In file included from ../tirpc/rpc/svc_auth.h:44:0,
> > from ../tirpc/rpc/rpc.h:68,
> > from bindresvport.c:46:
> > ../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory
>
> Here is my proof of concept how I think we should solve this.
> But there is one part of your patch I have no solution for:
>
> > --- a/tirpc/rpc/svc_auth.h
> > +++ b/tirpc/rpc/svc_auth.h
> [...]
> > @@ -63,8 +67,10 @@ typedef struct SVCAUTH {
> > int (*svc_ah_destroy)(struct SVCAUTH *);
> > } *svc_ah_ops;
> > caddr_t svc_ah_private;
> > +#ifdef HAVE_RPCSEC_GSS
> > svc_rpc_gss_parms_t svc_gss_params;
> > rpc_gss_rawcred_t raw_cred;
> > +#endif
> > } SVCAUTH;
>
> You are changeing the size of a struct here. I'm not sure
> if this will work, if an application is compiled with headers
> where it is disabled and then runs with a tirpc where it is
> enabled. Or the other way around.
> Does somebody have an idea how to solve that?

i did notice that, but i would point out that this struct in the 0.2.5 lacked
these members. they're new to the 0.3.0 release. so if ABI is a concern, we
already lost that battle ;).
-mike


Attachments:
(No filename) (1.49 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-05-07 15:24:23

by Steve Dickson

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled



On 05/07/2015 11:12 AM, Mike Frysinger wrote:
> On 07 May 2015 13:52, Thorsten Kukuk wrote:
>> On Thu, May 07, Mike Frysinger wrote:
>>> Starting with commit d5259e751111cb108c784b044296185f543fc0be (Add header
>>> definitions for rpc_gss_*() APIs), the gss headers were pulled in all the
>>> time leading to build failures like so:
>>> CC libtirpc_la-bindresvport.lo
>>> In file included from ../tirpc/rpc/svc_auth.h:44:0,
>>> from ../tirpc/rpc/rpc.h:68,
>>> from bindresvport.c:46:
>>> ../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory
>>
>> Here is my proof of concept how I think we should solve this.
>> But there is one part of your patch I have no solution for:
>>
>>> --- a/tirpc/rpc/svc_auth.h
>>> +++ b/tirpc/rpc/svc_auth.h
>> [...]
>>> @@ -63,8 +67,10 @@ typedef struct SVCAUTH {
>>> int (*svc_ah_destroy)(struct SVCAUTH *);
>>> } *svc_ah_ops;
>>> caddr_t svc_ah_private;
>>> +#ifdef HAVE_RPCSEC_GSS
>>> svc_rpc_gss_parms_t svc_gss_params;
>>> rpc_gss_rawcred_t raw_cred;
>>> +#endif
>>> } SVCAUTH;
>>
>> You are changeing the size of a struct here. I'm not sure
>> if this will work, if an application is compiled with headers
>> where it is disabled and then runs with a tirpc where it is
>> enabled. Or the other way around.
>> Does somebody have an idea how to solve that?
>
> i did notice that, but i would point out that this struct in the 0.2.5 lacked
> these members. they're new to the 0.3.0 release. so if ABI is a concern, we
> already lost that battle ;).
Right.. I knew this was the case...

steved.


2015-05-07 15:38:27

by Steve Dickson

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled

Hello,

Boy I had no idea --disable-gssapi was so prevalent...
My apologies for breaking it...


On 05/07/2015 07:52 AM, Thorsten Kukuk wrote:
>
> Hi,
>
> On Thu, May 07, Mike Frysinger wrote:
>
>> Starting with commit d5259e751111cb108c784b044296185f543fc0be (Add header
>> definitions for rpc_gss_*() APIs), the gss headers were pulled in all the
>> time leading to build failures like so:
>> CC libtirpc_la-bindresvport.lo
>> In file included from ../tirpc/rpc/svc_auth.h:44:0,
>> from ../tirpc/rpc/rpc.h:68,
>> from bindresvport.c:46:
>> ../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory
>
> Here is my proof of concept how I think we should solve this.
> But there is one part of your patch I have no solution for:
>
>> --- a/tirpc/rpc/svc_auth.h
>> +++ b/tirpc/rpc/svc_auth.h
> [...]
>> @@ -63,8 +67,10 @@ typedef struct SVCAUTH {
>> int (*svc_ah_destroy)(struct SVCAUTH *);
>> } *svc_ah_ops;
>> caddr_t svc_ah_private;
>> +#ifdef HAVE_RPCSEC_GSS
>> svc_rpc_gss_parms_t svc_gss_params;
>> rpc_gss_rawcred_t raw_cred;
>> +#endif
>> } SVCAUTH;
>
> You are changeing the size of a struct here. I'm not sure
> if this will work, if an application is compiled with headers
> where it is disabled and then runs with a tirpc where it is
> enabled. Or the other way around.
> Does somebody have an idea how to solve that?
Maybe some type of place holders?? Since the gssapi
is on by default, they would be knowing breaking it,
if that matters...

>
> Else here is my patch:
Is this patch addition to Mike's patch?

steved.

2015-05-07 16:33:28

by Thorsten Kukuk

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled

On Thu, May 07, Steve Dickson wrote:

> On 05/07/2015 07:52 AM, Thorsten Kukuk wrote:
> >
> > Hi,
> >
> > On Thu, May 07, Mike Frysinger wrote:
> >
> >> Starting with commit d5259e751111cb108c784b044296185f543fc0be (Add header
> >> definitions for rpc_gss_*() APIs), the gss headers were pulled in all the
> >> time leading to build failures like so:
> >> CC libtirpc_la-bindresvport.lo
> >> In file included from ../tirpc/rpc/svc_auth.h:44:0,
> >> from ../tirpc/rpc/rpc.h:68,
> >> from bindresvport.c:46:
> >> ../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory
> >
> > Here is my proof of concept how I think we should solve this.
> > But there is one part of your patch I have no solution for:
> >
> >> --- a/tirpc/rpc/svc_auth.h
> >> +++ b/tirpc/rpc/svc_auth.h
> > [...]
> >> @@ -63,8 +67,10 @@ typedef struct SVCAUTH {
> >> int (*svc_ah_destroy)(struct SVCAUTH *);
> >> } *svc_ah_ops;
> >> caddr_t svc_ah_private;
> >> +#ifdef HAVE_RPCSEC_GSS
> >> svc_rpc_gss_parms_t svc_gss_params;
> >> rpc_gss_rawcred_t raw_cred;
> >> +#endif
> >> } SVCAUTH;
> >
> > You are changeing the size of a struct here. I'm not sure
> > if this will work, if an application is compiled with headers
> > where it is disabled and then runs with a tirpc where it is
> > enabled. Or the other way around.
> > Does somebody have an idea how to solve that?
> Maybe some type of place holders?? Since the gssapi
> is on by default, they would be knowing breaking it,
> if that matters...
>
> >
> > Else here is my patch:
> Is this patch addition to Mike's patch?

No, replacing it except the struct part.

Thorsten

--
Thorsten Kukuk, Senior Architect SLES & Common Code Base
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG N?rnberg)

2015-05-07 16:55:07

by Steve Dickson

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled

On 05/07/2015 12:33 PM, Thorsten Kukuk wrote:
>>> > > Else here is my patch:
>> > Is this patch addition to Mike's patch?
> No, replacing it except the struct part.
So this is the complete patch.....

Look reasonable??

steved.

2015-05-07 18:12:08

by Thorsten Kukuk

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled

On Thu, May 07, Steve Dickson wrote:

> On 05/07/2015 12:33 PM, Thorsten Kukuk wrote:
> >>> > > Else here is my patch:
> >> > Is this patch addition to Mike's patch?
> > No, replacing it except the struct part.
> So this is the complete patch.....
>
> Look reasonable??

Some corrections:

> diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
> index 44b38bf..4b9b0f1 100644
> --- a/tirpc/rpc/svc_auth.h
> +++ b/tirpc/rpc/svc_auth.h

> @@ -63,8 +69,10 @@ typedef struct SVCAUTH {
> int (*svc_ah_destroy)(struct SVCAUTH *);
> } *svc_ah_ops;
> caddr_t svc_ah_private;
> +#ifdef HAVE_RPCSEC_GSS
> svc_rpc_gss_parms_t svc_gss_params;
> rpc_gss_rawcred_t raw_cred;
> +#endif
> } SVCAUTH;
>

This needs to be "#ifdef HAVE_GSSAPI", HAVE_RPCSEC_GSS
will never be defined if the header is used outside of
libtirpc sources

> diff --git a/tirpc/tirpc-features.h b/tirpc/tirpc-features.h
> new file mode 100644
> index 0000000..7aec775
> --- /dev/null
> +++ b/tirpc/tirpc-features.h


You should not tirpc/tirpc-features.h, only tirpc/tirpc-features.h.in
tirpc/tirpc-features.h will be created by configure, like libtirpc.pc
and config.h.

Thorsten

--
Thorsten Kukuk, Senior Architect SLES & Common Code Base
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG N?rnberg)

2015-05-07 20:04:14

by Steve Dickson

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled



On 05/07/2015 02:12 PM, Thorsten Kukuk wrote:
> On Thu, May 07, Steve Dickson wrote:
>
>> On 05/07/2015 12:33 PM, Thorsten Kukuk wrote:
>>>>>>> Else here is my patch:
>>>>> Is this patch addition to Mike's patch?
>>> No, replacing it except the struct part.
>> So this is the complete patch.....
>>
>> Look reasonable??
>
> Some corrections:
>
>> diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
>> index 44b38bf..4b9b0f1 100644
>> --- a/tirpc/rpc/svc_auth.h
>> +++ b/tirpc/rpc/svc_auth.h
>
>> @@ -63,8 +69,10 @@ typedef struct SVCAUTH {
>> int (*svc_ah_destroy)(struct SVCAUTH *);
>> } *svc_ah_ops;
>> caddr_t svc_ah_private;
>> +#ifdef HAVE_RPCSEC_GSS
>> svc_rpc_gss_parms_t svc_gss_params;
>> rpc_gss_rawcred_t raw_cred;
>> +#endif
>> } SVCAUTH;
>>
>
> This needs to be "#ifdef HAVE_GSSAPI", HAVE_RPCSEC_GSS
> will never be defined if the header is used outside of
> libtirpc sources
When I do that I get the following errors when the gssapi is
enabled:

svc_auth_gss.c: In function 'rpc_gss_getcred':
svc_auth_gss.c:920:7: error: 'SVCAUTH' has no member named 'raw_cred'
auth->raw_cred = gd->rcred;
^
svc_auth_gss.c:921:7: error: 'SVCAUTH' has no member named 'raw_cred'
auth->raw_cred.service = _rpc_gss_svc_to_service(gd->sec.svc);
^
svc_auth_gss.c:922:32: error: 'SVCAUTH' has no member named 'raw_cred'
(void)rpc_gss_num_to_qop(auth->raw_cred.mechanism, gd->sec.qop,
^
svc_auth_gss.c:923:12: error: 'SVCAUTH' has no member named 'raw_cred'
&auth->raw_cred.qop);
^
svc_auth_gss.c:924:17: error: 'SVCAUTH' has no member named 'raw_cred'
*rcred = &auth->raw_cred;

I guess something is still broken in the configure.ac...
Looking into it.

>
>> diff --git a/tirpc/tirpc-features.h b/tirpc/tirpc-features.h
>> new file mode 100644
>> index 0000000..7aec775
>> --- /dev/null
>> +++ b/tirpc/tirpc-features.h
>
>
> You should not tirpc/tirpc-features.h, only tirpc/tirpc-features.h.in
> tirpc/tirpc-features.h will be created by configure, like libtirpc.pc
> and config.h.
Ok... I'll add tirpc/tirpc-features.h to the .gitignore

Thanks again!

steved.



2015-05-07 20:12:47

by Steve Dickson

[permalink] [raw]
Subject: Re: [Libtirpc-devel] [PATCH libtirpc] fix build w/gssapi disabled

On 05/07/2015 04:04 PM, Steve Dickson wrote:
>> > This needs to be "#ifdef HAVE_GSSAPI", HAVE_RPCSEC_GSS
>> > will never be defined if the header is used outside of
>> > libtirpc sources
> When I do that I get the following errors when the gssapi is
> enabled:
>
> svc_auth_gss.c: In function 'rpc_gss_getcred':
> svc_auth_gss.c:920:7: error: 'SVCAUTH' has no member named 'raw_cred'
> auth->raw_cred = gd->rcred;
> ^
Pilot error on my part... #ifdef HAVE_GSSAPI does work.

Sorry for the noise.

steved.

2015-05-07 20:24:33

by Steve Dickson

[permalink] [raw]
Subject: [PATCH V2] Fix Build w/gssapi disabled

This version seems to work now.

I wonder if this warrants a 0.3.1 release...

How do other library deal with API breakage?

steved.

2015-05-08 02:03:23

by Mike Frysinger

[permalink] [raw]
Subject: Re: [PATCH V2] Fix Build w/gssapi disabled

On 07 May 2015 16:24, Steve Dickson wrote:
> --- /dev/null
> +++ b/tirpc/tirpc-features.h.in
> @@ -0,0 +1,10 @@
> +#ifndef _TIRPC_FEATURES_H
> +#define _TIRPC_FEATURES_H
> +
> +/* Define to 1 if DES authentication is enabled */
> +#undef HAVE_AUTHDES
> +
> +/* Define to 1 if GSSAPI is enabled */
> +#undef HAVE_GSSAPI
> +
> +#endif /* _TIRPC_FEATURES_H */

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.
-mike


Attachments:
(No filename) (527.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-05-08 03:33:28

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH V2] Fix Build w/gssapi disabled



On 05/07/2015 04:24 PM, Steve Dickson wrote:
> This version seems to work now.
>
> I wonder if this warrants a 0.3.1 release...
>
> How do other library deal with API breakage?
>
> steved.
>
> From 6cc5a243f62fbe32fe5f24f4c549a42b1c2b4adc Mon Sep 17 00:00:00 2001
> From: Thorsten Kukuk <[email protected]>
> Date: Thu, 7 May 2015 16:14:04 -0400
> Subject: [PATCH] Fix Build w/gssapi disabled
>
> A regression was introduced by commit d5259e75 that
> broke the --disable-gssapi configuration flag
> causing numerous compile errors.
>
> This patch fixes those errors but then the config
> flag is used it breaks API with previous releases.
>
> Signed-off-by: Steve Dickson <[email protected]>
Committed...

steved.

> ---
> .gitignore | 2 ++
> Makefile.am | 4 +++-
> configure.ac | 3 ++-
> src/svc_auth_gss.c | 5 ++++-
> tirpc/rpc/rpc.h | 4 +++-
> tirpc/rpc/svc_auth.h | 8 ++++++++
> tirpc/tirpc-features.h.in | 10 ++++++++++
> 7 files changed, 32 insertions(+), 4 deletions(-)
> create mode 100644 tirpc/tirpc-features.h.in
>
> diff --git a/.gitignore b/.gitignore
> index b7814a3..fad274f 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -34,6 +34,8 @@ libtirpc.pc
> lib*.a
> src/libtirpc.la
> src/libtirpc_la-*.lo
> +tirpc/stamp-h2
> +tirpc/tirpc-features.h
> # generic editor backup et al
> *~
> .stgitmail.txt
> diff --git a/Makefile.am b/Makefile.am
> index 2bf725c..2bce3b0 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -4,9 +4,11 @@ ACLOCAL_AMFLAGS = -I m4
> noinst_HEADERS = tirpc/reentrant.h \
> tirpc/getpeereid.h \
> tirpc/libc_private.h \
> - tirpc/un-namespace.h
> + tirpc/un-namespace.h \
> + tirpc/tirpc-features.h.in
>
> nobase_include_HEADERS = tirpc/netconfig.h \
> + tirpc/tirpc-features.h \
> tirpc/rpcsvc/crypt.x \
> tirpc/rpcsvc/crypt.h \
> tirpc/rpc/xdr.h \
> diff --git a/configure.ac b/configure.ac
> index 711b054..290c635 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -10,6 +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])
> GSSAPI_CFLAGS=`krb5-config --cflags gssapi`
> GSSAPI_LIBS=`krb5-config --libs gssapi`
> AC_SUBST([GSSAPI_CFLAGS])
> @@ -41,7 +42,7 @@ AC_ARG_ENABLE(symvers,
> AM_CONDITIONAL(SYMVERS, test "x$enable_symvers" = xyes)
>
> AC_PROG_CC
> -AC_CONFIG_HEADERS([config.h])
> +AC_CONFIG_HEADERS([config.h tirpc/tirpc-features.h])
> AC_PROG_LIBTOOL
> AC_HEADER_DIRENT
> AC_PREFIX_DEFAULT(/usr)
> diff --git a/src/svc_auth_gss.c b/src/svc_auth_gss.c
> index d95eae1..e0a5c6a 100644
> --- a/src/svc_auth_gss.c
> +++ b/src/svc_auth_gss.c
> @@ -34,8 +34,11 @@
>
> */
>
> -#include <sys/types.h>
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
>
> +#include <sys/types.h>
> #include <unistd.h>
> #include <stdio.h>
> #include <stdlib.h>
> diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h
> index 1dbb391..8f37454 100644
> --- a/tirpc/rpc/rpc.h
> +++ b/tirpc/rpc/rpc.h
> @@ -35,6 +35,8 @@
> #ifndef _TIRPC_RPC_H
> #define _TIRPC_RPC_H
>
> +#include <tirpc-features.h>
> +
> #include <rpc/types.h> /* some typedefs */
> #include <sys/socket.h>
> #include <netinet/in.h>
> @@ -60,7 +62,7 @@
> #include <rpc/auth_des.h> /* protocol for des style cred */
> #endif /* HAVE_AUTHDES */
>
> -#ifdef HAVE_RPCSEC_GSS
> +#ifdef HAVE_GSSAPI
> #include <rpc/auth_gss.h> /* RPCSEC_GSS */
> #endif
>
> diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
> index 44b38bf..dbd8cc9 100644
> --- a/tirpc/rpc/svc_auth.h
> +++ b/tirpc/rpc/svc_auth.h
> @@ -41,6 +41,10 @@
> #ifndef _RPC_SVC_AUTH_H
> #define _RPC_SVC_AUTH_H
>
> +#include <tirpc-features.h>
> +
> +#ifdef HAVE_GSSAPI
> +
> #include <rpc/rpcsec_gss.h>
>
> typedef struct {
> @@ -51,6 +55,8 @@ typedef struct {
> u_int seq_num;
> } svc_rpc_gss_parms_t;
>
> +#endif /* HAVE_GSSAPI */
> +
> /*
> * Interface to server-side authentication flavors.
> */
> @@ -63,8 +69,10 @@ 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
> new file mode 100644
> index 0000000..72e18bc
> --- /dev/null
> +++ b/tirpc/tirpc-features.h.in
> @@ -0,0 +1,10 @@
> +#ifndef _TIRPC_FEATURES_H
> +#define _TIRPC_FEATURES_H
> +
> +/* Define to 1 if DES authentication is enabled */
> +#undef HAVE_AUTHDES
> +
> +/* Define to 1 if GSSAPI is enabled */
> +#undef HAVE_GSSAPI
> +
> +#endif /* _TIRPC_FEATURES_H */
>

2015-05-08 08:17:20

by Thorsten Kukuk

[permalink] [raw]
Subject: Re: [PATCH V2] Fix Build w/gssapi disabled

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 <rpc/rpc_msg.h> /* protocol for rpc messages */
#include <rpc/auth_unix.h> /* 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 <rpc/auth_des.h> /* protocol for des style cred */
-#endif /* HAVE_AUTHDES */
+#endif /* TIRPC_AUTHDES */

-#ifdef HAVE_GSSAPI
+#ifdef TIRPC_GSSAPI
#include <rpc/auth_gss.h> /* 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 <gssapi/gssapi.h>
+
+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 <tirpc-features.h>
-
-#ifdef HAVE_GSSAPI
-
#include <rpc/rpcsec_gss.h>

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 */




--
Thorsten Kukuk, Senior Architect SLES & Common Code Base
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG N?rnberg)

2015-05-08 21:27:51

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH V2] Fix Build w/gssapi disabled

Hello Thorsten,

On 05/08/2015 04:17 AM, Thorsten Kukuk wrote:
> 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:
I applied the following patch to the top of the git tree
then I yum remove krb5-devel (which removes gssapi/gssapi.h)

After an 'sh autogen.sh' and ./configure --disable-gssapi
I'm getting the following compile errors
http://ur1.ca/kbq67
because gssapi.h does not exist..

What am I doing wrong??

steved.

2015-05-08 22:34:14

by Thorsten Kukuk

[permalink] [raw]
Subject: Re: [PATCH V2] Fix Build w/gssapi disabled

On Fri, May 08, Steve Dickson wrote:

> Hello Thorsten,
>
> On 05/08/2015 04:17 AM, Thorsten Kukuk wrote:
> > 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:
> I applied the following patch to the top of the git tree
> then I yum remove krb5-devel (which removes gssapi/gssapi.h)
>
> After an 'sh autogen.sh' and ./configure --disable-gssapi
> I'm getting the following compile errors
> http://ur1.ca/kbq67
> because gssapi.h does not exist..
>
> What am I doing wrong??

Sorry, somehow my patch was incomplete, this part did go
missing:

diff --git a/tirpc/rpc/rpcsec_gss.h b/tirpc/rpc/rpcsec_gss.h
index 217fc0d..f02de8a 100644
--- a/tirpc/rpc/rpcsec_gss.h
+++ b/tirpc/rpc/rpcsec_gss.h
@@ -35,8 +35,6 @@
#include <rpc/auth.h>
#include <rpc/clnt.h>

-#include <gssapi/gssapi.h>
-
typedef enum {
rpcsec_gss_svc_default = 0,
rpcsec_gss_svc_none = 1,



--
Thorsten Kukuk, Senior Architect SLES & Common Code Base
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG N?rnberg)