summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_unix.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
commit78c388aed2b7184182c08428db1de6c872d815f5 (patch)
tree4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /net/sunrpc/auth_unix.c
parenteb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff)
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'net/sunrpc/auth_unix.c')
-rw-r--r--net/sunrpc/auth_unix.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index e3025334d..2e22c6461 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -10,7 +10,6 @@
#include <linux/malloc.h>
#include <linux/socket.h>
#include <linux/in.h>
-#include <linux/utsname.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/auth.h>
@@ -28,13 +27,7 @@ struct unx_cred {
#define UNX_CRED_EXPIRE (60 * HZ)
-#ifndef DONT_FILLIN_HOSTNAME
-/* # define UNX_MAXNODENAME (sizeof(system_utsname.nodename)-1) */
-# define UNX_MAXNODENAME 32
-# define UNX_WRITESLACK (21 + (UNX_MAXNODENAME >> 2))
-#else
-# define UNX_WRITESLACK 20
-#endif
+#define UNX_WRITESLACK (21 + (UNX_MAXNODENAME >> 2))
#ifdef RPC_DEBUG
# define RPCDBG_FACILITY RPCDBG_AUTH
@@ -170,6 +163,7 @@ unx_match(struct rpc_task * task, struct rpc_cred *rcred)
static u32 *
unx_marshal(struct rpc_task *task, u32 *p, int ruid)
{
+ struct rpc_clnt *clnt = task->tk_client;
struct unx_cred *cred = (struct unx_cred *) task->tk_cred;
u32 *base, *hold;
int i, n;
@@ -177,20 +171,15 @@ unx_marshal(struct rpc_task *task, u32 *p, int ruid)
*p++ = htonl(RPC_AUTH_UNIX);
base = p++;
*p++ = htonl(jiffies/HZ);
-#ifndef DONT_FILLIN_HOSTNAME
+
/*
- * Problem: The UTS name could change under us. We can't lock
- * here to handle this. On the other hand we can't really
- * go building a bad RPC!
+ * Copy the UTS nodename captured when the client was created.
*/
- if ((n = strlen((char *) system_utsname.nodename)) > UNX_MAXNODENAME)
- n = UNX_MAXNODENAME;
+ n = clnt->cl_nodelen;
*p++ = htonl(n);
- memcpy(p, system_utsname.nodename, n);
+ memcpy(p, clnt->cl_nodename, n);
p += (n + 3) >> 2;
-#else
- *p++ = 0;
-#endif
+
if (ruid) {
*p++ = htonl((u32) cred->uc_uid);
*p++ = htonl((u32) cred->uc_gid);