-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nfsv4-specific permissions checks to kernel (#2)
There are various places in which evaluation of permissions in the presence of an NFSv4 ACL is more nuanced than what is typical when evaluating traditional POSIX permissions. For example, a user may be permitted to delete a file if he has DELETE permissions on the file or DELETE_CHILD permissions on the parent directory. Traditional POSIX permissions will only check for MAY_WRITE | MAY_EXEC on parent directory. Several new inode permissions masks have been added to facilitate these NFSv4-specific checks corresponding to different NFSv4 permissions that grant abilities to make changes to files. For the purpose of this commit and the goal of providing rough a approximation of NFSv4 access checks, only write (and not read) access checks have been implemented. This is selectively done in a way to grant minimal compliance with permissions as defined in RFC-5661. The new permissions-related behavior is only applied when the inode sb_flag SB_NFS4ACL is present. In this case, the onus of full implementation of requisite features to satisfy the ACL behavior specified in RFC-5661 is delegated to the filesystem's inode permissions interface (i_op->permission). If possible we try to check for the convention POSIX permission first before trying the NFSv4-equivalent. For example, when writing an xattr, we check for WRITE_DATA before WRITE_NAMED_ATTRS because in the case of former with a trivial ACL we can avoid having to evaluate the full ACL, and instead merely look at POSIX mode.
- Loading branch information
1 parent
80cc84a
commit 15f5a04
Showing
4 changed files
with
173 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters