about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1998-12-20 10:24:39 +0000
committerRoland McGrath <roland@gnu.org>1998-12-20 10:24:39 +0000
commitc5720a93963d3c47fdac1d41b0e2629e927ca63b (patch)
tree0334741fe736990dafb555283be663ec6659ad1d
parentea08b5bcb2d9dc9593b8576ffb7406cfb0480c3e (diff)
downloadglibc-c5720a93963d3c47fdac1d41b0e2629e927ca63b.tar.gz
glibc-c5720a93963d3c47fdac1d41b0e2629e927ca63b.tar.xz
glibc-c5720a93963d3c47fdac1d41b0e2629e927ca63b.zip
1998-12-20 Roland McGrath <roland@baalperazim.frob.com>
	* sunrpc/svc_unix.c, sunrpc/clnt_unix.c: Avoid using `struct cmsghdr'
	and `struct ucred' #ifndef SCM_CREDENTIALS.

	* sunrpc/publickey.c (getsecretkey): Use `&errno' instead of
	`__errno_location ()'; means the same, works for Hurd.

	* sysdeps/mach/hurd/Makefile (subdirs): Don't elide sunrpc.
-rw-r--r--ChangeLog10
-rw-r--r--sunrpc/clnt_unix.c6
-rw-r--r--sunrpc/svc_unix.c6
-rw-r--r--sysdeps/mach/hurd/Makefile3
4 files changed, 22 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index af56bfcbdd..5d74ad0363 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+1998-12-20  Roland McGrath  <roland@baalperazim.frob.com>
+
+	* sunrpc/svc_unix.c, sunrpc/clnt_unix.c: Avoid using `struct cmsghdr'
+	and `struct ucred' #ifndef SCM_CREDENTIALS.
+
+	* sunrpc/publickey.c (getsecretkey): Use `&errno' instead of
+	`__errno_location ()'; means the same, works for Hurd.
+
+	* sysdeps/mach/hurd/Makefile (subdirs): Don't elide sunrpc.
+
 1998-12-18  Ulrich Drepper  <drepper@cygnus.com>
 
 	* sysdeps/unix/sysv/sysv4/solaris2/bits/types.h: Include
diff --git a/sunrpc/clnt_unix.c b/sunrpc/clnt_unix.c
index 923dd8a070..240cdbbce4 100644
--- a/sunrpc/clnt_unix.c
+++ b/sunrpc/clnt_unix.c
@@ -434,17 +434,21 @@ clntunix_destroy (CLIENT *h)
   mem_free ((caddr_t) h, sizeof (CLIENT));
 }
 
+#ifdef SCM_CREDENTIALS
 struct cmessage {
   struct cmsghdr cmsg;
   struct ucred cmcred;
 };
+#endif
 
 static int
 __msgread (int sock, void *buf, size_t cnt)
 {
   struct iovec iov[1];
   struct msghdr msg;
+#ifdef SCM_CREDENTIALS
   struct cmessage cm;
+#endif
 
   iov[0].iov_base = buf;
   iov[0].iov_len = cnt;
@@ -453,8 +457,10 @@ __msgread (int sock, void *buf, size_t cnt)
   msg.msg_iovlen = 1;
   msg.msg_name = NULL;
   msg.msg_namelen = 0;
+#ifdef SCM_CREDENTIALS
   msg.msg_control = (caddr_t)&cm;
   msg.msg_controllen = sizeof(struct cmessage);
+#endif
   msg.msg_flags = 0;
 
 #ifdef SO_PASSCRED
diff --git a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c
index 7ada8cc86d..0ff26aaaba 100644
--- a/sunrpc/svc_unix.c
+++ b/sunrpc/svc_unix.c
@@ -280,6 +280,7 @@ svcunix_destroy (SVCXPRT *xprt)
   mem_free ((caddr_t) xprt, sizeof (SVCXPRT));
 }
 
+#ifdef SCM_CREDENTIALS
 struct cmessage {
   struct cmsghdr cmsg;
   struct ucred cmcred;
@@ -289,6 +290,7 @@ struct cmessage {
    and the rpcgen generated *_svc functions for the daemon are also not
    thread safe and uses static global variables, it doesn't matter. */
 static struct cmessage cm;
+#endif
 
 static int
 __msgread (int sock, void *buf, size_t cnt)
@@ -303,8 +305,10 @@ __msgread (int sock, void *buf, size_t cnt)
   msg.msg_iovlen = 1;
   msg.msg_name = NULL;
   msg.msg_namelen = 0;
+#ifdef SCM_CREDENTIALS
   msg.msg_control = (caddr_t) &cm;
   msg.msg_controllen = sizeof (struct cmessage);
+#endif
   msg.msg_flags = 0;
 
 #ifdef SO_PASSCRED
@@ -443,8 +447,10 @@ svcunix_recv (SVCXPRT *xprt, struct rpc_msg *msg)
       cd->x_id = msg->rm_xid;
       /* set up verifiers */
       msg->rm_call.cb_verf.oa_flavor = AUTH_UNIX;
+#ifdef SCM_CREDENTIALS
       msg->rm_call.cb_verf.oa_base = (caddr_t) &cm;
       msg->rm_call.cb_verf.oa_length = sizeof (cm);
+#endif
       return TRUE;
     }
   cd->strm_stat = XPRT_DIED;	/* XXXX */
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index f87f530d52..c88110ea1d 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -18,9 +18,6 @@
 
 ifdef in-Makerules
 
-subdirs := $(filter-out sunrpc,$(subdirs)) # XXX skip broken dirs
-# See hurd/Makefile for commands that install some crucial sunrpc headers.
-
 # Look for header files in hurd/ under the top-level library source directory.
 # Look for generated header files where they get created.
 includes += -I$(..)hurd -I$(common-objpfx)hurd/