RE: NFS open/setuid/ftruncate problem

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Trond Myklebust <trond.myklebust@...>
Cc: linux-kernel@vger.kernel.org <linux-kernel@...>, linux-nfs@vger.kernel.org <linux-nfs@...>
Date: Wednesday, June 11, 2008 - 1:24 am

> From: Trond Myklebust <Trond.Myklebust@netapp.com>
Thanks, Trond. Is there any chance this patch could be
included in the linux kernel in the near future? For now,
I guess I'll workaround this problem by moving the ftruncate()
to before setuid().

-luoqi

PS: I haven't tried the patch, just browsing through, and I noticed
a typo, pointing out here to save some trouble for anyone who
wants to give it a try (I guess gcc would issue a warning too),

        /* Search for an existing open(O_WRITE) file */
-       ctx = nfs_find_open_context(inode, cred, FMODE_WRITE);
-       if (ctx != NULL)
-               state = ctx->state;
+       if (sattr->ia_valid && ATTR_FILE) {  <=== && should be &
+               ctx = nfs_file_open_context(sattr->ia_file);
+               if (ctx != NULL)
+                       state = ctx->state;
+       }
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
NFS open/setuid/ftruncate problem, Luoqi Chen, (Tue Jun 10, 6:05 pm)
Re: NFS open/setuid/ftruncate problem, Trond Myklebust, (Tue Jun 10, 7:47 pm)
RE: NFS open/setuid/ftruncate problem, Luoqi Chen, (Wed Jun 11, 1:24 am)
RE: NFS open/setuid/ftruncate problem, Trond Myklebust, (Wed Jun 11, 9:35 am)