* At one time, "struct ACL" was extended in order to add support for NFSv4 * ACLs. Instead of creating compatibility versions of all the ACL-related * syscalls, they were left intact. It's possible to find out what the code * calling these syscalls (libc) expects basing on "type" argument - if it's * either ACL_TYPE_ACCESS_OLD or ACL_TYPE_DEFAULT_OLD (which previously were * known as ACL_TY
| 138 | * format. |
| 139 | */ |
| 140 | static int |
| 141 | acl_copyin(const void *user_acl, struct acl *kernel_acl, acl_type_t type) |
| 142 | { |
| 143 | int error; |
| 144 | struct oldacl old; |
| 145 | |
| 146 | switch (type) { |
| 147 | case ACL_TYPE_ACCESS_OLD: |
| 148 | case ACL_TYPE_DEFAULT_OLD: |
| 149 | error = copyin(user_acl, &old, sizeof(old)); |
| 150 | if (error != 0) |
| 151 | break; |
| 152 | acl_copy_oldacl_into_acl(&old, kernel_acl); |
| 153 | break; |
| 154 | |
| 155 | default: |
| 156 | error = copyin(user_acl, kernel_acl, sizeof(*kernel_acl)); |
| 157 | if (kernel_acl->acl_maxcnt != ACL_MAX_ENTRIES) |
| 158 | return (EINVAL); |
| 159 | } |
| 160 | |
| 161 | return (error); |
| 162 | } |
| 163 | |
| 164 | static int |
| 165 | acl_copyout(const struct acl *kernel_acl, void *user_acl, acl_type_t type) |
no test coverage detected