misc/154113: [patch] [libc] Missing ZFS NFSv4 ACL read_set, modify_set, write_set, full_set

Shawn Webb lattera at gmail.com
Tue Jan 18 15:00:23 UTC 2011


>Number:         154113
>Category:       misc
>Synopsis:       [patch] [libc] Missing ZFS NFSv4 ACL read_set, modify_set, write_set, full_set
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 18 15:00:21 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Shawn Webb
>Release:        8.2-RC1
>Organization:
HotlinkHR
>Environment:
FreeBSD  8.2-RC1 FreeBSD 8.2-RC1 #0: Wed Dec 22 17:34:20 UTC 2010     root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The `setfacl` command is missing read_set, modify_set, write_set, and full_set ZFS NFSv4 ACL sets. The proposed patch implements them.
>How-To-Repeat:

>Fix:
Patch included and attached.

Patch attached with submission follows:

--- releng_8_2/src/lib/libc/posix1e/acl_support_nfs4.c	2010-12-21 10:09:25.000000000 -0700
+++ src/lib/libc/posix1e/acl_support_nfs4.c	2011-01-11 10:51:11.000000000 -0700
@@ -144,13 +144,38 @@
 
 	while (str != NULL) {
 		flag = strsep(&str, "/:");
-
 		found = 0;
-		for (i = 0; flags[i].name != NULL; i++) {
-			if (strcmp(flags[i].name, flag) == 0) {
+
+		if (flags == a_access_masks && strcmp("full_set", flag) == 0) {
+			for (i = 0; flags[i].name != NULL; i++)
 				*var |= flags[i].flag;
-				found = 1;
-				ever_found = 1;
+			found = 1;
+			ever_found = 1;
+		}
+		else if (flags == a_access_masks && strcmp("read_set", flag) == 0) {
+			*var |= (ACL_READ_DATA | ACL_READ_ATTRIBUTES | ACL_READ_NAMED_ATTRS | ACL_READ_ACL);
+			found = 1;
+			ever_found = 1;
+		}
+		else if (flags == a_access_masks && strcmp("write_set", flag) == 0) {
+			*var |= (ACL_WRITE_DATA | ACL_APPEND_DATA | ACL_WRITE_ATTRIBUTES | ACL_WRITE_NAMED_ATTRS);
+			found = 1;
+			ever_found = 1;
+		}
+		else if (flags == a_access_masks && strcmp("modify_set", flag) == 0) {
+			for (i = 0; flags[i].name != NULL; i++)
+				if (flags[i].flag != ACL_WRITE_ACL || flags[i].flag != ACL_WRITE_OWNER)
+					*var |= flags[i].flag;
+			found = 1;
+			ever_found = 1;
+		}
+		else {
+			for (i = 0; flags[i].name != NULL; i++) {
+				if (strcmp(flags[i].name, flag) == 0) {
+					*var |= flags[i].flag;
+					found = 1;
+					ever_found = 1;
+				}
 			}
 		}
 


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list