All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jan Tulak <jtulak@redhat.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] xfs_io: allow open file permissions to be changed
Date: Tue, 4 Dec 2018 07:14:14 +1100	[thread overview]
Message-ID: <20181203201414.GE6311@dastard> (raw)
In-Reply-To: <CACj3i73vnbe7P_HcdjGyBjThSZ-hMUCvTuVCzfMHMO_W7m2rxA@mail.gmail.com>

On Mon, Dec 03, 2018 at 11:17:05AM +0100, Jan Tulak wrote:
> On Sun, Dec 2, 2018 at 9:54 PM Dave Chinner <david@fromorbit.com> wrote:
> >
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > I need to be able to open a file read-write, then change the
> > permissions on the file to read-only to check that copy_file_range
> > returns EPERM correctly in that case. This can't be done as root,
> > because root ignores file permissions, but as a normal user we can't
> > open a 0444 file for writing and so can't actually test writing to
> > a read-only file without some method of "open read-write, change
> > permissions to read-only, try to write to file through open
> > read-write file".
> >
> > So, allow adding or removing write permissions on an open file.
> >
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> 
> Should there be a man page update as well? Other commands from open.c
> have a corresponding man section, but:
> $ grep -c chmod man/man8/xfs_io.8
> 0

I forgot that, thanks. So many other things to deal with.

> And I wonder if the two permissions (0444 and 0664) are enough, or we
> might want to add other modes as well. But maybe that can be added
> when the need comes... Otherwise it looks good.

If we need more than "make read-only" or "make read-write" then we
can do something more. But for pretty much all the cases where fine
grained permissions are needed, the chmod command itself should
suffice....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-12-03 20:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-02 20:53 [PATCH 0/2] xfs_io: additions for testing copy_range Dave Chinner
2018-12-02 20:53 ` [PATCH 1/2] io: open pipes in non-blocking mode Dave Chinner
2018-12-03 10:07   ` Jan Tulak
2018-12-03 16:20   ` Darrick J. Wong
2018-12-03 20:16     ` Dave Chinner
2018-12-05  3:52       ` Eric Sandeen
2018-12-02 20:53 ` [PATCH 2/2] xfs_io: allow open file permissions to be changed Dave Chinner
2018-12-03 10:17   ` Jan Tulak
2018-12-03 20:14     ` Dave Chinner [this message]
2018-12-03 16:24   ` Darrick J. Wong
2018-12-05  4:02   ` [PATCH 2/2 V2] " Dave Chinner
2018-12-05  4:23     ` Eric Sandeen
2018-12-05  4:04   ` [PATCH 2/2] " Eric Sandeen
2018-12-03  0:20 ` [PATCH 3/2] xfs_io: copy_file_range length is a size_t Dave Chinner
2018-12-03 10:08   ` Jan Tulak
2018-12-03 16:27   ` Darrick J. Wong

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=20181203201414.GE6311@dastard \
    --to=david@fromorbit.com \
    --cc=jtulak@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.