MCPcopy Create free account
hub / github.com/F-Stack/f-stack / acl_copyout

Function acl_copyout

freebsd/kern/vfs_acl.c:164–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164static int
165acl_copyout(const struct acl *kernel_acl, void *user_acl, acl_type_t type)
166{
167 uint32_t am;
168 int error;
169 struct oldacl old;
170
171 switch (type) {
172 case ACL_TYPE_ACCESS_OLD:
173 case ACL_TYPE_DEFAULT_OLD:
174 error = acl_copy_acl_into_oldacl(kernel_acl, &old);
175 if (error != 0)
176 break;
177
178 error = copyout(&old, user_acl, sizeof(old));
179 break;
180
181 default:
182 error = fueword32((char *)user_acl +
183 offsetof(struct acl, acl_maxcnt), &am);
184 if (error == -1)
185 return (EFAULT);
186 if (am != ACL_MAX_ENTRIES)
187 return (EINVAL);
188
189 error = copyout(kernel_acl, user_acl, sizeof(*kernel_acl));
190 }
191
192 return (error);
193}
194
195/*
196 * Convert "old" type - ACL_TYPE_{ACCESS,DEFAULT}_OLD - into its "new"

Callers 1

vacl_get_aclFunction · 0.85

Calls 3

acl_copy_acl_into_oldaclFunction · 0.85
fueword32Function · 0.85
copyoutFunction · 0.50

Tested by

no test coverage detected