PERFORCE change 162592 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Sat May 23 18:24:56 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=162592

Change 162592 by trasz at trasz_victim on 2009/05/23 18:24:10

	Get rid of some whitespace.

Affected files ...

.. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_acl_nfs4.c#45 edit

Differences ...

==== //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_acl_nfs4.c#45 (text+ko) ====

@@ -87,7 +87,6 @@
 
 /*
  * Return 0, iff access is allowed, 1 otherwise.
- *
  */
 static int
 _acl_denies(const struct acl *aclp, int access_mask, struct ucred *cred,
@@ -109,31 +108,25 @@
 		if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW &&
 		    entry->ae_entry_type != ACL_ENTRY_TYPE_DENY)
 			continue;
-
 		if (entry->ae_flags & ACL_ENTRY_INHERIT_ONLY)
 			continue;
-
 		switch (entry->ae_tag) {
 		case ACL_USER_OBJ:
 			if (file_uid != cred->cr_uid)
 				continue;
 			break;
-
 		case ACL_USER:
 			if (entry->ae_id != cred->cr_uid)
 				continue;
 			break;
-
 		case ACL_GROUP_OBJ:
 			if (!groupmember(file_gid, cred))
 				continue;
 			break;
-
 		case ACL_GROUP:
 			if (!groupmember(entry->ae_id, cred))
 				continue;
 			break;
-
 		default:
 			KASSERT(entry->ae_tag == ACL_EVERYONE,
 			    ("entry->ae_tag == ACL_EVERYONE"));
@@ -143,13 +136,11 @@
 			if (entry->ae_perm & access_mask) {
 				if (denied_explicitly != NULL)
 					*denied_explicitly = 1;
-
 				return (1);
 			}
 		}
 
 		access_mask &= ~(entry->ae_perm);
-
 		if (access_mask == 0)
 			return (0);
 	}
@@ -219,7 +210,6 @@
 
 	/*
 	 * No match.  Try to use privileges, if there are any.
-	 * Taken from kern/subr_acl_posix1e.c.
 	 */
 	if (is_directory) {
 		if ((accmode & VEXEC) && !priv_check_cred(cred,
@@ -540,9 +530,6 @@
 		 */
 		if (entry->ae_tag == ACL_GROUP &&
 		    entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW) {
-			/*
-			 * XXX: Verify.
-			 */
 			mode_t extramode, ownermode;
 			extramode = (mode >> 3) & 07;
 			ownermode = mode >> 6;
@@ -705,14 +692,12 @@
 				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 					mode |= S_IRUSR;
 			}
-
 			if ((entry->ae_perm & ACL_WRITE_DATA) &&
 			     ((seen & S_IWUSR) == 0)) {
 				seen |= S_IWUSR;
 				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 					mode |= S_IWUSR;
 			}
-
 			if ((entry->ae_perm & ACL_EXECUTE) &&
 			    ((seen & S_IXUSR) == 0)) {
 				seen |= S_IXUSR;
@@ -726,14 +711,12 @@
 				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 					mode |= S_IRGRP;
 			}
-
 			if ((entry->ae_perm & ACL_WRITE_DATA) &&
 			    ((seen & S_IWGRP) == 0)) {
 				seen |= S_IWGRP;
 				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 					mode |= S_IWGRP;
 			}
-
 			if ((entry->ae_perm & ACL_EXECUTE) &&
 			    ((seen & S_IXGRP) == 0)) {
 				seen |= S_IXGRP;
@@ -747,53 +730,45 @@
 					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 						mode |= S_IRUSR;
 				}
-
 				if ((seen & S_IRGRP) == 0) {
 					seen |= S_IRGRP;
 					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 						mode |= S_IRGRP;
 				}
-
 				if ((seen & S_IROTH) == 0) {
 					seen |= S_IROTH;
 					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 						mode |= S_IROTH;
 				}
 			}
-
 			if (entry->ae_perm & ACL_WRITE_DATA) {
 				if ((seen & S_IWUSR) == 0) {
 					seen |= S_IWUSR;
 					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 						mode |= S_IWUSR;
 				}
-
 				if ((seen & S_IWGRP) == 0) {
 					seen |= S_IWGRP;
 					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 						mode |= S_IWGRP;
 				}
-
 				if ((seen & S_IWOTH) == 0) {
 					seen |= S_IWOTH;
 					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 						mode |= S_IWOTH;
 				}
 			}
-
 			if (entry->ae_perm & ACL_EXECUTE) {
 				if ((seen & S_IXUSR) == 0) {
 					seen |= S_IXUSR;
 					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 						mode |= S_IXUSR;
 				}
-
 				if ((seen & S_IXGRP) == 0) {
 					seen |= S_IXGRP;
 					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
 						mode |= S_IXGRP;
 				}
-
 				if ((seen & S_IXOTH) == 0) {
 					seen |= S_IXOTH;
 					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
@@ -1049,24 +1024,14 @@
 		case ACL_USER_OBJ:
 		case ACL_GROUP_OBJ:
 		case ACL_EVERYONE:
-			if (entry->ae_id != ACL_UNDEFINED_ID) {
-#if 0
-				printf("ae_id is not ACL_UNDEFINED_ID, "
-				    "but it should be.\n");
-#endif
+			if (entry->ae_id != ACL_UNDEFINED_ID)
 				return (EINVAL);
-			}
 			break;
 
 		case ACL_USER:
 		case ACL_GROUP:
-			if (entry->ae_id == ACL_UNDEFINED_ID) {
-#if 0
-				printf("ae_id is ACL_UNDEFINED_ID, "
-				    "but it shouldn't be.\n");
-#endif
+			if (entry->ae_id == ACL_UNDEFINED_ID)
 				return (EINVAL);
-			}
 			break;
 
 		default:
@@ -1102,4 +1067,3 @@
 
 	return (0);
 }
-


More information about the p4-projects mailing list