]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_io: allow open file permissions to be changed
authorDave Chinner <dchinner@redhat.com>
Wed, 12 Dec 2018 17:42:40 +0000 (11:42 -0600)
committerEric Sandeen <sandeen@redhat.com>
Wed, 12 Dec 2018 17:42:40 +0000 (11:42 -0600)
commit2c8482aaa7f3fdeb2f177223af8cf515c88a2f11
tree2ee21a45c313912c500b0708ff4724bb81d5aa87
parent1a05efba96ec634d974f4b68439fa66cf89061dc
xfs_io: allow open file permissions to be changed

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>
[sandeen: Move man page entry to FILE section]
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
io/open.c
man/man8/xfs_io.8