Re: [parch 4/4] vfs: utimensat(): fix write access check for futimens()

From: Miklos Szeredi
Date: Wed Jun 04 2008 - 01:55:44 EST


> 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.

Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/