From fa6ba86900abc9b023adf4ce642aba5eb0a35500 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Mon, 28 Mar 2011 09:30:38 +0000 Subject: nfs: capture attrs of create request in cs->stbuf for later use when attrs coming in as part of create request contain modes other than mode, they were getting discarded previously and a setattr was getting performed on a 0-filled iatt structure. This would result in EPERM at the access control translator as non-root users cannot chown a file to uid 0. Not seen with Linux NFS client as it (very likely) relies upon auth-unix to set the ownership of the file or sends an explicit setattr after the create. Signed-off-by: Anand Avati Signed-off-by: Vijay Bellur BUG: 2553 (NFS file create with Mac client and UNCHECKED mode returns "Operation not permitted") URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2553 --- xlators/nfs/server/src/nfs3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 6bf4fffb516..0f2c284ecaf 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -2512,7 +2512,7 @@ nfs3_create (rpcsvc_request_t *req, struct nfs3_fh *dirfh, char *name, nfs3_handle_call_state_init (nfs3, cs, req, vol, stat, nfs3err); cs->cookieverf = cverf; - cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, NULL, + cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, &cs->stbuf, &cs->mode); cs->createmode = mode; cs->parent = *dirfh; -- cgit