fix build w/gssapi disabled
Subsystems (3)
PATCH 1/1 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
--- tirpc/rpc/svc_auth.h | 6 ++++++ 1 file changed, 6 insertions(+)
tirpc/rpc/svc_auth.h +6 -0
@@ -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) \
Signature · 1 line
2.4.0
Hi,
Quoted 8 lines · Mike Frysinger
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
Quoted 52 lines
Signed-off-by Mike Frysinger <[email protected]>--- tirpc/rpc/svc_auth.h | 6 ++++++ 1 file changed, 6 insertions(+)tirpc/rpc/svc_auth.h +6
-0@@ -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) \Signature · 13 lines
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
Signature · 3 lines
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)
Quoted 10 lines · Thorsten Kukuk
Quoted 8 lines · Mike Frysinger
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
Quoted 6 lines
This will not work since this headers will be installed in
/usr/includeand other appliations compiled against libtirpc will never defineHAVE_RPCSEC_GSS, thus never see this interfaces.We need something like the glibc
features.hfile, which will always be included and defines, how tirpc was configured.
this is what tirpc/rpc/rpc.h is already doing ...
-mike
Quoted 11 lines · Mike Frysinger
Quoted 10 lines · Thorsten Kukuk
Quoted 8 lines · Mike Frysinger
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
Quoted 8 lines
Quoted 6 lines
This will not work since this headers will be installed in
/usr/includeand other appliations compiled against libtirpc will never defineHAVE_RPCSEC_GSS, thus never see this interfaces.We need something like the glibc
features.hfile, which will always be included and defines, how tirpc was configured.this is what
tirpc/rpc/rpc.his already doing ...
Ok, I haven't seen that this is already broken :( Means we need a solution how to provide this defines asap.
Thorsten
Signature · 3 lines
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)
Hi,
Quoted 8 lines · Mike Frysinger
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:
Quoted 2 lines
tirpc/rpc/svc_auth.h +0
-0
[...]
tirpc/rpc/svc_auth.h typedef struct SVCAUTH { · line 74
Quoted 9 lines
tirpc/rpc/svc_auth.h +2
-0@@ -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:
Makefile.am +3 -1
@@ -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 \
configure.ac +2 -1
@@ -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)
tirpc/rpc/rpc.h +3 -1
@@ -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
tirpc/rpc/svc_auth.h +6 -0
@@ -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. */
tirpc/tirpc-features.h.in +10 -0
@@ -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 */
Signature · 3 lines
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)
Quoted 16 lines · Thorsten Kukuk
Quoted 8 lines · Mike Frysinger
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 directoryHere 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:
Quoted 2 lines
tirpc/rpc/svc_auth.h +0
-0[...]
Quoted 15 lines
tirpc/rpc/svc_auth.h typedef struct SVCAUTH { · line 74
Quoted 9 lines
tirpc/rpc/svc_auth.h +2
-0@@ -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
Quoted 33 lines · Mike Frysinger
Quoted 16 lines · Thorsten Kukuk
Quoted 8 lines · Mike Frysinger
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 directoryHere 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:
Quoted 2 lines
tirpc/rpc/svc_auth.h +0
-0[...]
Quoted 15 lines
tirpc/rpc/svc_auth.h typedef struct SVCAUTH { · line 74
Quoted 9 lines
tirpc/rpc/svc_auth.h +2
-0@@ -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?
Quoted 3 lines
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.
Hello,
Boy I had no idea --disable-gssapi was so prevalent... My apologies for breaking it...
Quoted 20 lines · Thorsten Kukuk
Hi,
Quoted 8 lines · Mike Frysinger
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 directoryHere 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:
Quoted 2 lines
tirpc/rpc/svc_auth.h +0
-0[...]
Quoted 15 lines
tirpc/rpc/svc_auth.h typedef struct SVCAUTH { · line 74
Quoted 9 lines
tirpc/rpc/svc_auth.h +2
-0@@ -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...
Quoted 2 lines
Else here is my patch:
Is this patch addition to Mike's patch?
steved.
Quoted 36 lines · Steve Dickson
Quoted 20 lines · Thorsten Kukuk
Hi,
Quoted 8 lines · Mike Frysinger
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 directoryHere 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:
Quoted 2 lines
tirpc/rpc/svc_auth.h +0
-0[...]
Quoted 15 lines
tirpc/rpc/svc_auth.h typedef struct SVCAUTH { · line 74
Quoted 9 lines
tirpc/rpc/svc_auth.h +2
-0@@ -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?
Quoted 7 lines
Maybe some type of place holders?? Since the gssapi is on by default, they would be knowing breaking it, if that matters...
Quoted 2 lines
Else here is my patch:
Is this patch addition to Mike's patch?
No, replacing it except the struct part.
Thorsten
Signature · 3 lines
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)
Quoted 3 lines · Thorsten Kukuk
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
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.
Quoted 7 lines · Steve Dickson
Quoted 3 lines · Thorsten Kukuk
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
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:
Quoted 6 lines
tirpc/rpc/svc_auth.h +0
-0
tirpc/rpc/svc_auth.h typedef struct SVCAUTH { · line 77
Quoted 9 lines
tirpc/rpc/svc_auth.h +2
-0@@ -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
tirpc/tirpc-features.h
Quoted 5 lines
tirpc/tirpc-features.h new file +0
-0
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
Signature · 3 lines
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)
Quoted 17 lines · Thorsten Kukuk
Quoted 7 lines · Steve Dickson
Quoted 3 lines · Thorsten Kukuk
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
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:
Quoted 4 lines
tirpc/rpc/svc_auth.h +0
-0
Quoted 14 lines
tirpc/rpc/svc_auth.h typedef struct SVCAUTH { · line 77
Quoted 10 lines
tirpc/rpc/svc_auth.h +2
-0@@ -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_GSSwill 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.
Quoted 11 lines
tirpc/tirpc-features.h
Quoted 6 lines
tirpc/tirpc-features.h new file +0
-0You should not
tirpc/tirpc-features.h, only tirpc/tirpc-features.h.intirpc/tirpc-features.hwill be created by configure, like libtirpc.pc andconfig.h.
Ok... I'll add tirpc/tirpc-features.h to the .gitignore
Thanks again!
steved.
Quoted 10 lines · Steve Dickson
Quoted 3 lines
Quoted 3 lines
This needs to be "#ifdef
HAVE_GSSAPI",HAVE_RPCSEC_GSSwill never be defined if the header is used outside of libtirpc sourcesWhen 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.
PATCH v2 1/1 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.
Re: [PATCH V2] Fix Build w/gssapi disabled
tirpc/tirpc-features.h.in line 10
Quoted 13 lines · Steve Dickson
tirpc/tirpc-features.h.in new file +10
-0@@ -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
Re: [PATCH V2] Fix Build w/gssapi disabled
Quoted 3 lines · Mike Frysinger
it is dangerous to export raw
HAVE_xxxdefines -- it can break packages that use autotools themselves. they need an appropriate prefix likeRPC_xxxorTIRPC_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:
configure.ac +2 -2
@@ -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])
tirpc/rpc/auth.h +6 -6
@@ -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 __cplusplusextern "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
tirpc/rpc/rpc.h +3 -3
@@ -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
tirpc/rpc/rpcsec_gss.h +15 -9
@@ -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 */
tirpc/rpc/svc_auth.h +0 -7
@@ -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) \
tirpc/tirpc-features.h.in +2 -2
@@ -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 */
Signature · 3 lines
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)
Re: [PATCH V2] Fix Build w/gssapi disabled
Hello Thorsten,
Quoted 11 lines · Thorsten Kukuk
Quoted 3 lines · Mike Frysinger
it is dangerous to export raw
HAVE_xxxdefines -- it can break packages that use autotools themselves. they need an appropriate prefix likeRPC_xxxorTIRPC_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.
Re: [PATCH V2] Fix Build w/gssapi disabled
Quoted 17 lines · Steve Dickson
Hello Thorsten,
Quoted 11 lines · Thorsten Kukuk
Quoted 3 lines · Mike Frysinger
it is dangerous to export raw
HAVE_xxxdefines -- it can break packages that use autotools themselves. they need an appropriate prefix likeRPC_xxxorTIRPC_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)
Quoted 6 lines
After an 'sh
autogen.sh' and ./configure --disable-gssapi I'm getting the following compile errors
http://ur1.ca/kbq67
becausegssapi.hdoes not exist..What am I doing wrong??
Sorry, somehow my patch was incomplete, this part did go missing:
tirpc/rpc/rpcsec_gss.h +0 -2
@@ -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,
Signature · 3 lines
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)
Re: [PATCH V2] Fix Build w/gssapi disabled
In reply to Steve DicksonQuoted 13 lines · Steve Dickson
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
6cc5a243f62fbe32fe5f24f4c549a42b1c2b4adcMon 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
Quoted 8 lines
A regression was introduced by commit
d5259e75that 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.
Quoted 153 lines
--- .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.gitignore +2
-0@@ -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.txtMakefile.am +3
-1@@ -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 \configure.ac +2
-1@@ -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)src/svc_auth_gss.c +4
-1@@ -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> tirpc/rpc/rpc.h +3
-1@@ -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 tirpc/rpc/svc_auth.h +8
-0@@ -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) \tirpc/tirpc-features.h.in new file +10
-0@@ -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 */