Re: [PATCH] utimensat() non-conformances and fixes -- version 2

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Miklos Szeredi
Date: Friday, May 16, 2008 - 9:59 am

> This is a revised version of my earlier

The patch looks functionally correct.  But there are several things I
don't really like...


How about explicitly turning UTIME_NOW/UTIME_NOW into times = NULL at
the beginning of the function?  That would both simplify things and
also make it absolutely sure that the two cases are handled the same
way (which makes sense, and is also what the standard wants).


I don't like adding _more_ owner checks to this function.  It would be
better if we were removing them: some weird filesystems want to do
their own permission checking and so the owner checks should really be
moved into inode_change_ok().

One way to do that could be to add a pseudo attribute flag,
e.g. ATTR_TIMES_UPDATE, that tells the permission checking code to
check the owner, even when neither ATTR_[AM]TIME_SET flag is set.

Even the check for the owner in the !times case could be removed, by
adding ATTR_TIMES_UPDATE only if we don't have write permission on the
file.  That's a cleanup I'd really be happy with.

All this may also be done with the ATTR_FORCE flag, but that would
mean:

  - modifying lots of call sites
  - making it impossible to selectively check the permission if
    multiple attributes are being modified (don't know if any callers
    want that though).

Miklos
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] utimensat() non-conformances and fixes -- version 2, Michael Kerrisk, (Fri May 16, 1:31 am)
Re: [PATCH] utimensat() non-conformances and fixes -- vers ..., Miklos Szeredi, (Fri May 16, 9:59 am)
[PATCH] utimensat() non-conformances and fixes [v3], Michael Kerrisk, (Fri May 30, 8:34 am)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Miklos Szeredi, (Fri May 30, 9:37 am)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Michael Kerrisk, (Fri May 30, 11:24 am)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Miklos Szeredi, (Fri May 30, 12:22 pm)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Matthew Wilcox, (Fri May 30, 12:32 pm)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Michael Kerrisk, (Fri May 30, 12:43 pm)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Miklos Szeredi, (Fri May 30, 1:08 pm)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Andrew Morton, (Fri May 30, 1:17 pm)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Miklos Szeredi, (Fri May 30, 1:17 pm)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Michael Kerrisk, (Fri May 30, 10:28 pm)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Michael Kerrisk, (Fri May 30, 10:44 pm)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Michael Kerrisk, (Tue Jun 3, 4:05 am)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Miklos Szeredi, (Tue Jun 3, 4:13 am)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Michael Kerrisk, (Tue Jun 3, 4:27 am)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Michael Kerrisk, (Tue Jun 3, 4:39 am)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Michael Kerrisk, (Tue Jun 3, 4:52 am)
Re: [PATCH] utimensat() non-conformances and fixes [v3], Miklos Szeredi, (Tue Jun 3, 5:16 am)