diff -X /home/cel/src/linux/dont-diff -Naurp 03-odirect-isem/net/sunrpc/auth_unix.c 04-call_encode/net/sunrpc/auth_unix.c --- 03-odirect-isem/net/sunrpc/auth_unix.c 2001-08-16 12:39:37.000000000 -0400 +++ 04-call_encode/net/sunrpc/auth_unix.c 2004-01-29 22:46:06.000000000 -0500 @@ -12,6 +12,7 @@ #include #include #include +#include #define NFS_NGROUPS 16 struct unx_cred { @@ -169,19 +170,14 @@ unx_marshal(struct rpc_task *task, u32 * struct rpc_clnt *clnt = task->tk_client; struct unx_cred *cred = (struct unx_cred *) task->tk_msg.rpc_cred; u32 *base, *hold; - int i, n; + int i; *p++ = htonl(RPC_AUTH_UNIX); base = p++; *p++ = htonl(jiffies/HZ); - /* - * Copy the UTS nodename captured when the client was created. - */ - n = clnt->cl_nodelen; - *p++ = htonl(n); - memcpy(p, clnt->cl_nodename, n); - p += (n + 3) >> 2; + /* Copy the UTS nodename captured when the client was created */ + p = xdr_encode_array(p, clnt->cl_nodename, clnt->cl_nodelen); /* Note: we don't use real uid if it involves raising priviledge */ if (ruid && cred->uc_uid != 0 && cred->uc_gid != 0) { diff -X /home/cel/src/linux/dont-diff -Naurp 03-odirect-isem/net/sunrpc/clnt.c 04-call_encode/net/sunrpc/clnt.c --- 03-odirect-isem/net/sunrpc/clnt.c 2003-11-28 13:26:21.000000000 -0500 +++ 04-call_encode/net/sunrpc/clnt.c 2004-01-29 21:51:03.000000000 -0500 @@ -524,9 +524,6 @@ call_encode(struct rpc_task *task) rcvbuf->page_len = 0; rcvbuf->len = bufsiz; - /* Zero buffer so we have automatic zero-padding of opaque & string */ - memset(task->tk_buffer, 0, bufsiz); - /* Encode header and provided arguments */ encode = rpcproc_encode(clnt, task->tk_msg.rpc_proc); if (!(p = call_header(task))) {