lkml.org 
[lkml]   [2008]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [parch 4/4] vfs: utimensat(): fix write access check for futimens()
On Wed, Jun 4, 2008 at 7:54 AM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> At which point the "if (f)" and the "else" branches become equivalent
>> (the nameidata isn't interesting in the other case either). So that
>> could be written as:
>>
>> if (!is_owner_or_cap(inode)) {
>> error = permission(inode, MAY_WRITE, NULL);
>> if (error)
>> goto mnt_drop_write_and_out;
>> }
>
> And also the IS_IMMUTABLE() check can be removed, since it's checked
> by permission(MAY_WRITE) anyway.

I'm not sure that that is true, because immutability applies
regardless of capabilities or ownership, right?

--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html


\
 
 \ /
  Last update: 2008-06-04 10:45    [W:0.058 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site