]> granicus.if.org Git - zfs/commit
Fix NFS sticky bit permission denied error
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 4 Dec 2017 19:55:57 +0000 (11:55 -0800)
committerTony Hutter <hutter2@llnl.gov>
Tue, 5 Dec 2017 01:22:47 +0000 (17:22 -0800)
commit1030f807ba1ded7eeceb3d1dfe950e155a7563f4
treebe42beb030e563d099db3a2fb7f31b87270e6bde
parentd45702bcfa1cdc0ef22534f38c98b44cfa0734ec
Fix NFS sticky bit permission denied error

When zfs_sticky_remove_access() was originally adapted for Linux
a typo was made which altered the intended behavior.  As described
in the block comment, the intended behavior is that permission
should be granted when the entry is a regular file and you have
write access.  That is, S_ISREG should have been used instead of
S_ISDIR.

Restricting permission to regular files made good sense for older
systems where setting the bit on executable files would instruct
the system to save the program's text segment on the swap device.

On modern systems this behavior has been replaced by the sticky
bit acting as a restricted deletion flag and the plain file
restriction has been relaxed.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6889
Closes #6910
module/zfs/zfs_dir.c