PERFORCE change 146902 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Fri Aug 8 09:57:53 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=146902
Change 146902 by trasz at trasz_traszkan on 2008/08/08 09:57:28
Style fixes.
Affected files ...
.. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_acl_nfs4.c#17 edit
Differences ...
==== //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_acl_nfs4.c#17 (text+ko) ====
@@ -89,13 +89,13 @@
*
*/
static int
-_acl_denies(const struct acl *aclp, int needed_bits, struct ucred *cred,
+_acl_denies(const struct acl *aclp, int access_mask, struct ucred *cred,
int file_uid, int file_gid, int *denied_explicitly)
{
int i;
const struct acl_entry *entry;
- if (denied_explicitly)
+ if (denied_explicitly != NULL)
*denied_explicitly = 0;
for (i = 0; i < aclp->acl_cnt; i++) {
@@ -135,17 +135,17 @@
}
if (entry->ae_extended == ACL_EXTENDED_DENY) {
- if (entry->ae_perm & needed_bits) {
- if (denied_explicitly)
+ if (entry->ae_perm & access_mask) {
+ if (denied_explicitly != NULL)
*denied_explicitly = 1;
return (1);
}
}
- needed_bits &= ~(entry->ae_perm);
+ access_mask &= ~(entry->ae_perm);
- if (needed_bits == 0)
+ if (access_mask == 0)
return (0);
}
@@ -157,7 +157,7 @@
struct acl *aclp, vaccess_t acc_mode, struct ucred *cred, int *privused)
{
vaccess_t priv_granted = 0;
- int denied, explicitly_denied, needed_bits, is_directory,
+ int denied, explicitly_denied, access_mask, is_directory,
must_be_owner = 0;
if (privused != NULL)
@@ -166,7 +166,7 @@
if (acc_mode & VADMIN)
must_be_owner = 1;
- needed_bits = _access_mask_from_mode(acc_mode);
+ access_mask = _access_mask_from_mode(acc_mode);
if (type == VDIR)
is_directory = 1;
@@ -180,19 +180,19 @@
* from undoing the change.
*/
if (file_uid == cred->cr_uid)
- needed_bits &= ~(ACL_READ_ACL | ACL_WRITE_ACL |
+ access_mask &= ~(ACL_READ_ACL | ACL_WRITE_ACL |
ACL_READ_ATTRIBUTES | ACL_WRITE_ATTRIBUTES);
/*
* Ignore append permission for regular files; use write
* permission instead.
*/
- if (!is_directory && (needed_bits & ACL_APPEND_DATA)) {
- needed_bits &= ~ACL_APPEND_DATA;
- needed_bits |= ACL_WRITE_DATA;
+ if (!is_directory && (access_mask & ACL_APPEND_DATA)) {
+ access_mask &= ~ACL_APPEND_DATA;
+ access_mask |= ACL_WRITE_DATA;
}
- denied = _acl_denies(aclp, needed_bits, cred, file_uid, file_gid,
+ denied = _acl_denies(aclp, access_mask, cred, file_uid, file_gid,
&explicitly_denied);
if (must_be_owner) {
More information about the p4-projects
mailing list