Re: [parch 3/4] vfs: utimensat(): fix error checking for {UTIME_NOW,UTIME_OMIT}case

From: Miklos Szeredi
Date: Wed Jun 04 2008 - 00:55:31 EST


> > + } else if ((times[0].tv_nsec == UTIME_NOW &&
> > + times[1].tv_nsec == UTIME_OMIT)
> > + ||
> > + (times[0].tv_nsec == UTIME_OMIT &&
> > + times[1].tv_nsec == UTIME_NOW)) {
>

> +
> + if (!is_owner_or_cap(inode))
> + goto mnt_drop_write_and_out;

And in fact a little comment wouldn't hurt explaining what exactly is
going on here with the permission checking.

The "/* Don't worry, the checks are done in inode_change_ok() */" is
really reassuring, but unfortunately not exactly the truth (and never
was).

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/