idmap.c | 12 ++---------- nfs4xdr.c | 8 ++++---- 2 files changed, 6 insertions(+), 14 deletions(-) diff -u --recursive --new-file --show-c-function linux-2.6.1-09-fix_nfs4client/fs/nfs/idmap.c linux-2.6.1-10-fix_idmap/fs/nfs/idmap.c --- linux-2.6.1-09-fix_nfs4client/fs/nfs/idmap.c 2004-01-03 12:27:54.000000000 -0500 +++ linux-2.6.1-10-fix_idmap/fs/nfs/idmap.c 2004-01-03 12:29:01.000000000 -0500 @@ -146,7 +146,8 @@ nfs_idmap_id(struct nfs_server *server, struct idmap *idmap = server->idmap; struct idmap_msg *im; DECLARE_WAITQUEUE(wq, current); - int ret = -1, hashtype = IDMAP_HASH_TYPE_NAME, xnamelen = namelen; + int ret = -1, hashtype = IDMAP_HASH_TYPE_NAME; + u_int xnamelen = namelen; if (idmap == NULL) return (-1); @@ -169,15 +170,6 @@ nfs_idmap_id(struct nfs_server *server, memset(im, 0, sizeof(*im)); memcpy(im->im_name, name, namelen); - /* Make sure the string is NULL terminated */ - if (namelen != xnamelen) { - /* We cannot fit a NULL character */ - if (namelen == IDMAP_NAMESZ) { - ret = -1; - goto out; - } - im->im_name[namelen] = '\0'; - } im->im_type = type; im->im_conv = IDMAP_CONV_NAMETOID; diff -u --recursive --new-file --show-c-function linux-2.6.1-09-fix_nfs4client/fs/nfs/nfs4xdr.c linux-2.6.1-10-fix_idmap/fs/nfs/nfs4xdr.c --- linux-2.6.1-09-fix_nfs4client/fs/nfs/nfs4xdr.c 2004-01-01 21:25:49.000000000 -0500 +++ linux-2.6.1-10-fix_idmap/fs/nfs/nfs4xdr.c 2004-01-03 12:29:01.000000000 -0500 @@ -241,8 +241,8 @@ encode_attrs(struct xdr_stream *xdr, str { char owner_name[256]; char owner_group[256]; - int owner_namelen = 0; - int owner_grouplen = 0; + int owner_namelen = sizeof(owner_name); + int owner_grouplen = sizeof(owner_group); uint32_t *p; uint32_t *q; int len; @@ -1476,7 +1476,7 @@ decode_getattr(struct xdr_stream *xdr, s READ_BUF(dummy32); len += (XDR_QUADLEN(dummy32) << 2); if ((status = nfs_idmap_id(server, IDMAP_TYPE_USER, - (char *)p, len, &nfp->uid)) == -1) { + (char *)p, dummy32, &nfp->uid)) == -1) { dprintk("read_attrs: gss_get_num failed!\n"); /* goto out; */ nfp->uid = -2; @@ -1494,7 +1494,7 @@ decode_getattr(struct xdr_stream *xdr, s READ_BUF(dummy32); len += (XDR_QUADLEN(dummy32) << 2); if ((status = nfs_idmap_id(server, IDMAP_TYPE_GROUP, - (char *)p, len, &nfp->gid)) == -1) { + (char *)p, dummy32, &nfp->gid)) == -1) { dprintk("read_attrs: gss_get_num failed!\n"); nfp->gid = -2; /* goto out; */