linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <mszeredi@redhat.com>
To: Jan Stancek <jstancek@redhat.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	viro <viro@zeniv.linux.org.uk>,
	guaneryu@gmail.com, Cyril Hrubis <chrubis@suse.cz>,
	ltp@lists.linux.it,
	"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Subject: Re: utimensat EACCES vs. EPERM in 4.8+
Date: Mon, 16 Jan 2017 16:53:13 +0100	[thread overview]
Message-ID: <CAOssrKfb1-C8c=9bAPiairh+Lyf=w28r+RjSXTLQcQZ-=eWMRA@mail.gmail.com> (raw)
In-Reply-To: <18a5b416-ad6a-e679-d993-af7ffa0dcc10@redhat.com>

On Mon, Jan 16, 2017 at 4:46 PM, Jan Stancek <jstancek@redhat.com> wrote:
> Hi,
>
> we seem to have a conflict between kernel and man pages.
> From utimensat man page:
>
> EACCES times is NULL, or both tv_nsec values are UTIME_NOW, and either:
>        *  the effective user ID of the caller does not match the owner of the
>           file, the caller does not  have  write  access  to  the file, and the
>           caller is not privileged (Linux: does not have either the CAP_FOWNER
>           or the CAP_DAC_OVERRIDE capability); or,
>        *  the file is marked immutable (see chattr(1)).
>
> But following 2 commits gradually replaced EACCES with EPERM.
>
> commit 337684a1746f93ae107e05d90977b070bb7e39d8
> Author: Eryu Guan <guaneryu@gmail.com>
> Date:   Tue Aug 2 19:58:28 2016 +0800
>     fs: return EPERM on immutable inode

I agree with Eryu that consistently returning EPERM for immutable is
better than sometimes returning EACCESS and sometimes EPERM.

So I think the man page should be fixed.

> commit f2b20f6ee842313a0d681dbbf7f87b70291a6a3b
> Author: Miklos Szeredi <mszeredi@redhat.com>
> Date:   Fri Sep 16 12:44:20 2016 +0200
>     vfs: move permission checking into notify_change() for utimes(NULL)

Actually this later commit didn't change the error value, it just
moved code around.

Thanks,
Miklos

  reply	other threads:[~2017-01-16 15:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 15:46 utimensat EACCES vs. EPERM in 4.8+ Jan Stancek
2017-01-16 15:53 ` Miklos Szeredi [this message]
2017-01-17  0:04   ` Michael Kerrisk (man-pages)
2017-01-17  4:50     ` Carlos O'Donell
2017-01-17  7:51     ` Jan Stancek
2017-01-17  7:57       ` Cyril Hrubis
2017-01-17  9:39         ` Miklos Szeredi
2017-01-17 15:43           ` Cyril Hrubis
2017-01-18  8:23           ` Michael Kerrisk (man-pages)
2017-01-31 12:09             ` Cyril Hrubis
2017-01-17  4:41 ` Theodore Ts'o
2017-01-17 19:35   ` J. Bruce Fields
2017-01-17 21:04     ` Theodore Ts'o
2017-01-18  8:17       ` Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOssrKfb1-C8c=9bAPiairh+Lyf=w28r+RjSXTLQcQZ-=eWMRA@mail.gmail.com' \
    --to=mszeredi@redhat.com \
    --cc=chrubis@suse.cz \
    --cc=guaneryu@gmail.com \
    --cc=jstancek@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ltp@lists.linux.it \
    --cc=mtk.manpages@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).