Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed parameter passing error when calling zfs_acl_chmod #15907

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

yyhran
Copy link
Contributor

@yyhran yyhran commented Feb 19, 2024

Motivation and Context

When I created the regular file using nfsv4 acl, I found that the owner has D permission. This permission is not useful for the regular file, and it should not appear on the regular file.

root@Quartz:/pool_t1# touch test
root@Quartz:/pool_t1# nfs4xdr_getfacl test
# File: test
# owner: 0
# group: 0
# mode: 0o100644
# trivial_acl: true
# ACL flags: none
            owner@:rw-pD-aARWcCos:-------:allow
            group@:r-----a-R-c--s:-------:allow
         everyone@:r-----a-R-c--s:-------:allow

Description

The first argument of the zfs_acl_chmod should be is_dir instead of the file_mode. But zfs_acl_ids_create directly passes the mode of the file to zfs_acl_chmod. Use the S_ISDIR to obtain the file type by mode.

How Has This Been Tested?

After fixed, I got the right permission

root@Quartz:/pool_t1# touch test2
root@Quartz:/pool_t1# nfs4xdr_getfacl test2
# File: test2
# owner: 0
# group: 0
# mode: 0o100644
# trivial_acl: true
# ACL flags: none
            owner@:rw-p--aARWcCos:-------:allow
            group@:r-----a-R-c--s:-------:allow
         everyone@:r-----a-R-c--s:-------:allow

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching and better yet fixing this. LGTM and brings this this check in-sync with the FreeBSD code.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Feb 26, 2024
@behlendorf behlendorf merged commit 5600dff into openzfs:master Feb 26, 2024
23 of 26 checks passed
@yyhran yyhran deleted the zfs_acl_chmod branch March 3, 2024 13:10
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
Follow up to 99495ba which
accidentally introduce this regression.

Reviewed by: Brian Behlendorf <[email protected]>
Signed-off-by: Quartz <[email protected]>
Closes openzfs#15907
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
Follow up to 99495ba which
accidentally introduce this regression.

Reviewed by: Brian Behlendorf <[email protected]>
Signed-off-by: Quartz <[email protected]>
Closes openzfs#15907
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
Follow up to 99495ba which
accidentally introduce this regression.

Reviewed by: Brian Behlendorf <[email protected]>
Signed-off-by: Quartz <[email protected]>
Closes openzfs#15907
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants