Skip to contentSkip to conversation

Further nfs-utils clean ups

PATCH In review Chuck Lever 2 participants 8 messages Mar 5, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Further nfs-utils clean ups

Hi Steve-

Here are six more patches that clean up various issues to prepare for the widespread use of TI-RPC in nfs-utils.

We discovered a type width mismatch issue between our legacy RPC headers and the TI-RPC run-time that will be addressed in a subsequent patch series by using TI-RPC to build all of nfs-utils. This issue should be addressed before the next release of nfs-utils is published.

The idea will be to build nfs-utils with either glibc's legacy RPC implementation and the legacy RPC headers (as it is today in 1.1.3), or with libtirpc and TI-RPC's headers, based on the setting of --enable-tirpc (which defaults to --disable-tirpc).

This further insulates ongoing IPv6 work from folks who need to use today's up-to-date version of nfs-utils, while easily allowing us to test a version built with complete TI-RPC integration.

---

Chuck Lever (6):
gssd: include gssapi/gssapi.h before write_bytes.h
gssd: Use same style for including config.h that rest of nfs-utils uses mount.nfs: squelch compiler warning for TI-RPC builds
nfs-utils: Provide type-checked version of svc_getcaller()
configure: Remove CPPFLAGS substitution
nfs-utils: Replace getservbyname(3)

 configure.ac                   |    1 
 support/include/nfsrpc.h       |    6 --
 support/include/rpcmisc.h      |    9 +++
 support/nfs/getport.c          |  105 ++++++++++++++++++++++++----------------
 support/nfs/rpc_socket.c       |   46 ------------------
 utils/gssd/context.c           |    5 ++
 utils/gssd/context_heimdal.c   |    4 +-
 utils/gssd/context_lucid.c     |   10 ++--
 utils/gssd/context_mit.c       |    4 +-
 utils/gssd/context_spkm3.c     |    5 ++
 utils/gssd/err_util.c          |    4 ++
 utils/gssd/gss_clnt_send_err.c |    4 ++
 utils/gssd/gss_oids.c          |    4 ++
 utils/gssd/gss_util.c          |    6 ++
 utils/gssd/gssd.c              |    4 +-
 utils/gssd/gssd_main_loop.c    |    5 ++
 utils/gssd/gssd_proc.c         |    6 ++
 utils/gssd/krb5_util.c         |    6 ++
 utils/gssd/svcgssd.c           |    4 +-
 utils/gssd/svcgssd_main_loop.c |    4 ++
 utils/gssd/svcgssd_mech2file.c |    4 +-
 utils/gssd/svcgssd_proc.c      |    4 ++
 utils/mount/network.c          |    5 +-
 utils/mountd/mount_dispatch.c  |    7 ++-
 utils/mountd/mountd.c          |   20 +++-----
 utils/statd/callback.c         |    9 ++-
 utils/statd/monitor.c          |    5 ++
 utils/statd/simu.c             |   12 ++++-
 utils/statd/statd.c            |    6 ++
 29 files changed, 179 insertions(+), 135 deletions(-)
Signature · 1 line
Chuck Lever

A message that is not in the archive (sent off-list or not yet received): 20090304234711.28749.7018.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org

#2 lore raw

PATCH 1/6 nfs-utils: Replace getservbyname(3)

The getservbyname(3) function is not re-entrant, and anyway, the man page says it is obsolete. Replace it with a call to getaddrinfo(3).

---

 support/include/nfsrpc.h |    6 ---
 support/nfs/getport.c    |  105 ++++++++++++++++++++++++++++------------------
 support/nfs/rpc_socket.c |   46 --------------------
 3 files changed, 63 insertions(+), 94 deletions(-)
support/include/nfsrpc.h +0 -6
index 1529d44..097debb 100644
@@ -54,12 +54,6 @@
 extern rpcprog_t	nfs_getrpcbyname(const rpcprog_t, const char *table[]);
 
 /*
- * Look up a port number in /etc/services for an RPC program
- */
-extern unsigned short	nfs_getportbynumber(const rpcprog_t program,
-				const unsigned short transport);
-
-/*
  * Acquire an RPC CLIENT *
  */
 extern CLIENT		*nfs_get_rpcclient(const struct sockaddr *,
support/nfs/getport.c +63 -42

131 lines not on this page · raw message

support/nfs/rpc_socket.c +0 -46

49 lines not on this page · raw message

#3 lore raw

PATCH 2/6 configure: Remove CPPFLAGS substitution

In reply to a message not in the archive

At least on my systems, the AM_CPPFLAGS substitution at the end of configure.ac is not needed. It adds an extra copy of "-I../../support/includes" to each compile step.

---

 configure.ac |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
configure.ac +0 -1
index 4fd111f..b2c8190 100644
@@ -382,7 +382,6 @@ esac
 
 my_am_cflags="-Wall -Wstrict-prototypes $ARCHFLAGS -pipe"
 
-AC_SUBST([AM_CPPFLAGS], ["-I\${top_srcdir}/support/include"])
 AC_SUBST([AM_CFLAGS], ["$my_am_cflags"])
 
 # Make sure that $ACLOCAL_FLAGS are used during a rebuild
#4 lore raw

PATCH 3/6 nfs-utils: Provide type-checked version of svc_getcaller()

In reply to a message not in the archive

TI-RPC's version of the svc_getcaller() macro points to a sockaddr_in6, not a sockaddr_in, though for AF_INET callers, an AF_INET address resides there. To squelch compiler warnings when the TI-RPC version of the svc_req structure is used, add inline helpers with appropriate type casting.

Note that tcp_wrappers support only AF_INET addresses for now.

---

 support/include/rpcmisc.h     |    9 +++++++++
 utils/mountd/mount_dispatch.c |    7 ++++---
 utils/mountd/mountd.c         |   20 +++++++-------------
 utils/statd/callback.c        |    9 ++++++---
 utils/statd/monitor.c         |    5 ++++-
 utils/statd/simu.c            |   12 ++++++++++--
 utils/statd/statd.c           |    6 ++++--
 7 files changed, 44 insertions(+), 24 deletions(-)
support/include/rpcmisc.h +9 -0
index 5814a63..f551a85 100644
@@ -53,5 +53,14 @@ extern int	_rpcpmstart;
 extern int	_rpcfdtype;
 extern int	_rpcsvcdirty;
 
+static inline struct sockaddr_in *nfs_getrpccaller_in(SVCXPRT *xprt)
+{
+	return (struct sockaddr_in *)svc_getcaller(xprt);
+}
+
+static inline struct sockaddr *nfs_getrpccaller(SVCXPRT *xprt)
+{
+	return (struct sockaddr *)svc_getcaller(xprt);
+}
 
 #endif /* RPCMISC_H */
utils/mountd/mount_dispatch.c +4 -3
index f00c0c5..199fcec 100644
@@ -70,11 +70,12 @@ mount_dispatch(struct svc_req *rqstp, SVCXPRT *transp)
 {
 	union mountd_arguments 	argument;
 	union mountd_results	result;
-
 #ifdef HAVE_TCP_WRAPPER
+	struct sockaddr_in *sin = nfs_getrpccaller_in(transp);
+
 	/* remote host authorization check */
-	if (!check_default("mountd", svc_getcaller(transp),
-			   rqstp->rq_proc, MOUNTPROG)) {
+	if (sin->sin_family == AF_INET &&
+	    !check_default("mountd", sin, rqstp->rq_proc, MOUNTPROG)) {
 		svcerr_auth (transp, AUTH_FAILED);
 		return;
 	}
utils/mountd/mountd.c +7 -13
index deeaa07..8084359 100644
@@ -202,8 +202,7 @@ mount_mnt_1_svc(struct svc_req *rqstp, dirpath *path, fhstatus *res)
 bool_t
 mount_dump_1_svc(struct svc_req *rqstp, void *argp, mountlist *res)
 {
-	struct sockaddr_in *addr =
-		(struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
+	struct sockaddr_in *addr = nfs_getrpccaller_in(rqstp->rq_xprt);
 
 	xlog(D_CALL, "dump request from %s.", inet_ntoa(addr->sin_addr));
 	*res = mountlist_list();
@@ -214,8 +213,7 @@ mount_dump_1_svc(struct svc_req *rqstp, void *argp, mountlist *res)
 bool_t
 mount_umnt_1_svc(struct svc_req *rqstp, dirpath *argp, void *resp)
 {
-	struct sockaddr_in *sin
-		= (struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
+	struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt);
 	nfs_export	*exp;
 	char		*p = *argp;
 	char		rpath[MAXPATHLEN+1];
@@ -242,15 +240,14 @@ mount_umntall_1_svc(struct svc_req *rqstp, void *argp, void *resp)
 	/* Reload /etc/xtab if necessary */
 	auth_reload();
 
-	mountlist_del_all((struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt));
+	mountlist_del_all(nfs_getrpccaller_in(rqstp->rq_xprt));
 	return 1;
 }
 
 bool_t
 mount_export_1_svc(struct svc_req *rqstp, void *argp, exports *resp)
 {
-	struct sockaddr_in *addr =
-		(struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
+	struct sockaddr_in *addr = nfs_getrpccaller_in(rqstp->rq_xprt);
 
 	xlog(D_CALL, "export request from %s.", inet_ntoa(addr->sin_addr));
 	*resp = get_exportlist();
@@ -261,8 +258,7 @@ mount_export_1_svc(struct svc_req *rqstp, void *argp, exports *resp)
 bool_t
 mount_exportall_1_svc(struct svc_req *rqstp, void *argp, exports *resp)
 {
-	struct sockaddr_in *addr =
-		(struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
+	struct sockaddr_in *addr = nfs_getrpccaller_in(rqstp->rq_xprt);
 
 	xlog(D_CALL, "exportall request from %s.", inet_ntoa(addr->sin_addr));
 	*resp = get_exportlist();
@@ -284,8 +280,7 @@ mount_exportall_1_svc(struct svc_req *rqstp, void *argp, exports *resp)
 bool_t
 mount_pathconf_2_svc(struct svc_req *rqstp, dirpath *path, ppathcnf *res)
 {
-	struct sockaddr_in *sin
-		= (struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
+	struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt);
 	struct stat	stb;
 	nfs_export	*exp;
 	char		rpath[MAXPATHLEN+1];
@@ -383,8 +378,7 @@ static struct nfs_fh_len *
 get_rootfh(struct svc_req *rqstp, dirpath *path, nfs_export **expret,
 		mountstat3 *error, int v3)
 {
-	struct sockaddr_in *sin =
-		(struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
+	struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt);
 	struct stat	stb, estb;
 	nfs_export	*exp;
 	struct nfs_fh_len *fh;
utils/statd/callback.c +6 -3
index 505fdb3..8885238 100644
@@ -9,10 +9,13 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
+#include <arpa/inet.h>
+
+#include "rpcmisc.h"
 #include "misc.h"
 #include "statd.h"
 #include "notlist.h"
-#include <arpa/inet.h>
 
 /* Callback notify list. */
 /* notify_list *cbnl = NULL; ... never used */
@@ -29,8 +32,8 @@ sm_notify_1_svc(struct stat_chge *argp, struct svc_req *rqstp)
 {
 	notify_list    *lp, *call;
 	static char    *result = NULL;
-	char *ip_addr = xstrdup(inet_ntoa(svc_getcaller(rqstp->rq_xprt)
-					  ->sin_addr));
+	struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt);
+	char *ip_addr = xstrdup(inet_ntoa(sin->sin_addr));
 
 	dprintf(N_DEBUG, "Received SM_NOTIFY from %s, state: %d",
 				argp->mon_name, argp->state);
utils/statd/monitor.c +4 -1
index 24c2531..169cd78 100644
@@ -20,6 +20,8 @@
 #include <errno.h>
 #include <arpa/inet.h>
 #include <dirent.h>
+
+#include "rpcmisc.h"
 #include "misc.h"
 #include "statd.h"
 #include "notlist.h"
@@ -36,9 +38,10 @@ notify_list *		rtnl = NULL;	/* Run-time notify list. */
 static int
 caller_is_localhost(struct svc_req *rqstp)
 {
+	struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt);
 	struct in_addr	caller;
 
-	caller = svc_getcaller(rqstp->rq_xprt)->sin_addr;
+	caller = sin->sin_addr;
 	if (caller.s_addr != htonl(INADDR_LOOPBACK)) {
 		note(N_WARNING,
 			"Call to statd from non-local host %s",
utils/statd/simu.c +10 -2
index 25e8bad..a7ecb85 100644
@@ -7,8 +7,10 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include <arpa/inet.h>
 
+#include "rpcmisc.h"
 #include "statd.h"
 #include "notlist.h"
 
@@ -21,17 +23,23 @@ extern void my_svc_exit (void);
 void *
 sm_simu_crash_1_svc (void *argp, struct svc_req *rqstp)
 {
+  struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt);
   static char *result = NULL;
   struct in_addr caller;
 
-  caller = svc_getcaller(rqstp->rq_xprt)->sin_addr;
+  if (sin->sin_family != AF_INET) {
+    note(N_WARNING, "Call to statd from non-AF_INET address");
+    goto failure;
+  }
+
+  caller = sin->sin_addr;
   if (caller.s_addr != htonl(INADDR_LOOPBACK)) {
     note(N_WARNING, "Call to statd from non-local host %s",
       inet_ntoa(caller));
     goto failure;
   }
 
-  if (ntohs(svc_getcaller(rqstp->rq_xprt)->sin_port) >= 1024) {
+  if (ntohs(sin->sin_port) >= 1024) {
     note(N_WARNING, "Call to statd-simu-crash from unprivileged port");
     goto failure;
   }
utils/statd/statd.c +4 -2
index 321f7a9..6da2ab2 100644
@@ -88,9 +88,11 @@ extern void simulator (int, char **);
 static void 
 sm_prog_1_wrapper (struct svc_req *rqstp, register SVCXPRT *transp)
 {
+	struct sockaddr_in *sin = nfs_getrpccaller_in(transp);
+
 	/* remote host authorization check */
-	if (!check_default("statd", svc_getcaller(transp),
-				 rqstp->rq_proc, SM_PROG)) {
+	if (sin->sin_family == AF_INET &&
+	    !check_default("statd", sin, rqstp->rq_proc, SM_PROG)) {
 		svcerr_auth (transp, AUTH_FAILED);
 		return;
 	}
#5 lore raw

PATCH 4/6 mount.nfs: squelch compiler warning for TI-RPC builds

In reply to a message not in the archive

The printf format string in nfs_pp_debug() assumes the @program and @version arguments are unsigned long, because the legacy RPC headers define both rpcprog_t and rpcvers_t as unsigned long types.

However, the TI-RPC headers define both types as uint32_t, which requires a different printf format type. If we replace the legacy headers with TI-RPC headers, this type mismatch generates compiler warnings that are nothing but noise.

We are about to provide a switch at ./configure time to allow the use of either the legacy RPC headers or the TI-RPC headers, so we need a printf format that works in both cases.

To squelch the compiler warnings that occur when using the TI-RPC headers, cast both arguments in the fprintf statement to the widest of the two types ("unsigned long" or "uint32_t").

---

 utils/mount/network.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
utils/mount/network.c +3 -2
index b41388e..bcd0c0f 100644
@@ -546,8 +546,9 @@ static void nfs_pp_debug(const struct sockaddr *sap, const socklen_t salen,
 		strcat(buf, "unknown host");
 	}
 
-	fprintf(stderr, _("%s: trying %s prog %ld vers %ld prot %s port %d\n"),
-			progname, buf, program, version,
+	fprintf(stderr, _("%s: trying %s prog %lu vers %lu prot %s port %d\n"),
+			progname, buf, (unsigned long)program,
+			(unsigned long)version,
 			(protocol == IPPROTO_UDP ? _("UDP") : _("TCP")),
 			port);
 }
#6 lore raw

PATCH 5/6 gssd: Use same style for including config.h that rest of nfs-utils uses

In reply to a message not in the archive

Clean up.

---

 utils/gssd/context.c           |    5 ++++-
 utils/gssd/context_heimdal.c   |    4 +++-
 utils/gssd/context_lucid.c     |    4 +++-
 utils/gssd/context_mit.c       |    4 +++-
 utils/gssd/context_spkm3.c     |    5 ++++-
 utils/gssd/err_util.c          |    4 ++++
 utils/gssd/gss_clnt_send_err.c |    4 ++++
 utils/gssd/gss_oids.c          |    4 ++++
 utils/gssd/gss_util.c          |    6 +++++-
 utils/gssd/gssd.c              |    4 +++-
 utils/gssd/gssd_main_loop.c    |    5 +++++
 utils/gssd/gssd_proc.c         |    6 +++++-
 utils/gssd/krb5_util.c         |    6 +++++-
 utils/gssd/svcgssd.c           |    4 +++-
 utils/gssd/svcgssd_main_loop.c |    4 ++++
 utils/gssd/svcgssd_mech2file.c |    4 +++-
 utils/gssd/svcgssd_proc.c      |    4 ++++
 17 files changed, 66 insertions(+), 11 deletions(-)
utils/gssd/context.c +4 -1
index 0ca7079..1e50bbf 100644
@@ -28,7 +28,10 @@
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <syslog.h>
 #include <string.h>
utils/gssd/context_heimdal.c +3 -1
index fc241e3..ddf064d 100644
@@ -28,7 +28,9 @@
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
 
 #ifndef HAVE_LUCID_CONTEXT_SUPPORT
 #ifdef HAVE_HEIMDAL
utils/gssd/context_lucid.c +3 -1
index 94403af..3243d53 100644
@@ -28,7 +28,9 @@
  * SUCH DAMAGES.
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
 
 #ifdef HAVE_LUCID_CONTEXT_SUPPORT
 
utils/gssd/context_mit.c +3 -1
index e76a8b1..709a903 100644
@@ -28,7 +28,9 @@
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
 
 #ifndef HAVE_LUCID_CONTEXT_SUPPORT
 #ifdef HAVE_KRB5
utils/gssd/context_spkm3.c +4 -1
index 5b387bd..b927475 100644
@@ -28,7 +28,10 @@
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <syslog.h>
 #include <string.h>
utils/gssd/err_util.c +4 -0
index 2583e06..fe09eda 100644
@@ -28,6 +28,10 @@
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
utils/gssd/gss_clnt_send_err.c +4 -0
index 5260b53..4800a01 100644
@@ -30,6 +30,10 @@
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/types.h>
utils/gssd/gss_oids.c +4 -0
index c569b0c..a59c4a6 100644
@@ -28,6 +28,10 @@
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #include <sys/types.h>
 #include <gssapi/gssapi.h>
 
utils/gssd/gss_util.c +5 -1
index 2d66be9..99aceb3 100644
@@ -57,7 +57,11 @@
  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  * PERFORMANCE OF THIS SOFTWARE.
  */
-#include "config.h"
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #include <errno.h>
 #include <stdio.h>
 #include <ctype.h>
utils/gssd/gssd.c +3 -1
index 6d8f3b9..f6949db 100644
@@ -36,7 +36,9 @@
 
 */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
 
 #include <sys/param.h>
 #include <sys/socket.h>
utils/gssd/gssd_main_loop.c +5 -0
index b9f3a06..917b662 100644
@@ -28,9 +28,14 @@
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
+
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/poll.h>
utils/gssd/gssd_proc.c +5 -1
index 91fc8d2..d0d3f7f 100644
@@ -38,10 +38,14 @@
 
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
-#include "config.h"
+
 #include <sys/param.h>
 #include <rpc/rpc.h>
 #include <sys/stat.h>
utils/gssd/krb5_util.c +5 -1
index d4ee631..8923b3b 100644
@@ -91,10 +91,14 @@
 
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
-#include "config.h"
+
 #include <sys/param.h>
 #include <rpc/rpc.h>
 #include <sys/stat.h>
utils/gssd/svcgssd.c +3 -1
index 4aa157d..f97dcd3 100644
@@ -37,7 +37,9 @@
 
 */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
 
 #include <sys/param.h>
 #include <sys/types.h>
utils/gssd/svcgssd_main_loop.c +4 -0
index 280816d..2b4111c 100644
@@ -28,6 +28,10 @@
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/poll.h>
utils/gssd/svcgssd_mech2file.c +3 -1
index 22c3ed8..65de8d0 100644
@@ -34,7 +34,9 @@
 
 */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
 
 #include <gssapi/gssapi.h>
 #include <string.h>
utils/gssd/svcgssd_proc.c +4 -0
index 1d13532..b390bea 100644
@@ -33,6 +33,10 @@
 
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif	/* HAVE_CONFIG_H */
+
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <rpc/rpc.h>
#7 lore raw

PATCH 6/6 gssd: include gssapi/gssapi.h before write_bytes.h

In reply to a message not in the archive

In gssd/context_lucid.c, ensure that gss_buffer_desc and gss_OID_desc are defined before write_bytes.h, which uses these definitions, is included. With TI-RPC, these definitions are not provided by rpc/rpc.h.

It appears that <gssapi/gssapi_krb5.h> already includes krb5.h and gssapi.h (on my system, anyway) so let's drop those includes.

Ideally write_bytes.h itself should include the needed headers, but some source files that use Heimdal include a different, Heimdal- compatible, header to get these definitions.

---

 utils/gssd/context_lucid.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
utils/gssd/context_lucid.c +3 -3
index 3243d53..af7de58 100644
@@ -42,17 +42,17 @@
 #include <stdio.h>
 #include <syslog.h>
 #include <string.h>
+
+#include <gssapi/gssapi_krb5.h>
+
 #include "gss_util.h"
 #include "gss_oids.h"
 #include "err_util.h"
 #include "context.h"
 
-#include <krb5.h>
-#include <gssapi/gssapi.h>
 #ifndef OM_uint64
 typedef uint64_t OM_uint64;
 #endif
-#include <gssapi/gssapi_krb5.h>
 
 static int
 write_lucid_keyblock(char **p, char *end, gss_krb5_lucid_key_t *key)
#8 lore raw
In reply to a message not in the archive
Quoted 10 lines · Chuck Lever

Hi Steve-

Here are six more patches that clean up various issues to prepare for the widespread use of TI-RPC in nfs-utils.

We discovered a type width mismatch issue between our legacy RPC headers and the TI-RPC run-time that will be addressed in a subsequent patch series by using TI-RPC to build all of nfs-utils. This issue should be addressed before the next release of nfs-utils is published.

Quoted 9 lines

The idea will be to build nfs-utils with either glibc's legacy RPC implementation and the legacy RPC headers (as it is today in 1.1.3), or with libtirpc and TI-RPC's headers, based on the setting of --enable-tirpc (which defaults to --disable-tirpc).

This further insulates ongoing IPv6 work from folks who need to use today's up-to-date version of nfs-utils, while easily allowing us to test a version built with complete TI-RPC integration.

Committed...

steved.