Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_acl_nfs4.c
Show First 20 Lines • Show All 529 Lines • ▼ Show 20 Lines | for (i = 0; i < aclp->acl_cnt; i++) { | ||||
amode = mode >> 3; | amode = mode >> 3; | ||||
/* | /* | ||||
* If ACE4_IDENTIFIER_GROUP is not set, and the "who" field | * If ACE4_IDENTIFIER_GROUP is not set, and the "who" field | ||||
* in ACE matches the owner of the file, we shift amode three | * in ACE matches the owner of the file, we shift amode three | ||||
* more bits, in order to have the owner permission bits | * more bits, in order to have the owner permission bits | ||||
* placed in the three low order bits of amode. | * placed in the three low order bits of amode. | ||||
*/ | */ | ||||
if (entry->ae_tag == ACL_USER && entry->ae_id == file_owner_id) | if (entry->ae_tag == ACL_USER && | ||||
entry->ae_id == (uid_t)file_owner_id) | |||||
amode = amode >> 3; | amode = amode >> 3; | ||||
if (entry->ae_perm & ACL_READ_DATA) { | if (entry->ae_perm & ACL_READ_DATA) { | ||||
if (amode & READ) | if (amode & READ) | ||||
previous->ae_perm &= ~ACL_READ_DATA; | previous->ae_perm &= ~ACL_READ_DATA; | ||||
else | else | ||||
previous->ae_perm |= ACL_READ_DATA; | previous->ae_perm |= ACL_READ_DATA; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 747 Lines • ▼ Show 20 Lines | acl_nfs4_is_trivial(const struct acl *aclp, int file_owner_id) | ||||
*/ | */ | ||||
tmpaclp->acl_cnt = 0; | tmpaclp->acl_cnt = 0; | ||||
acl_nfs4_sync_acl_from_mode_draft(tmpaclp, tmpmode, file_owner_id); | acl_nfs4_sync_acl_from_mode_draft(tmpaclp, tmpmode, file_owner_id); | ||||
trivial = _acls_are_equal(aclp, tmpaclp); | trivial = _acls_are_equal(aclp, tmpaclp); | ||||
acl_free(tmpaclp); | acl_free(tmpaclp); | ||||
return (trivial); | return (trivial); | ||||
} | } | ||||
#endif /* _KERNEL */ | |||||
int | int | ||||
acl_nfs4_check(const struct acl *aclp, int is_directory) | acl_nfs4_check(const struct acl *aclp, int is_directory) | ||||
{ | { | ||||
int i; | int i; | ||||
const struct acl_entry *entry; | const struct acl_entry *entry; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | if (!is_directory) { | ||||
ACL_ENTRY_NO_PROPAGATE_INHERIT | ACL_ENTRY_INHERIT_ONLY)) | ACL_ENTRY_NO_PROPAGATE_INHERIT | ACL_ENTRY_INHERIT_ONLY)) | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
#ifdef _KERNEL | |||||
static int | static int | ||||
acl_nfs4_modload(module_t module, int what, void *arg) | acl_nfs4_modload(module_t module, int what, void *arg) | ||||
{ | { | ||||
int ret; | int ret; | ||||
ret = 0; | ret = 0; | ||||
switch (what) { | switch (what) { | ||||
Show All 33 Lines |