| 446 | } |
| 447 | |
| 448 | static int find_matching_rsync_acl(const rsync_acl *racl, SMB_ACL_TYPE_T type, |
| 449 | const item_list *racl_list) |
| 450 | { |
| 451 | static int access_match = -1, default_match = -1; |
| 452 | int *match = type == SMB_ACL_TYPE_ACCESS ? &access_match : &default_match; |
| 453 | size_t count = racl_list->count; |
| 454 | |
| 455 | /* If this is the first time through or we didn't match the last |
| 456 | * time, then start at the end of the list, which should be the |
| 457 | * best place to start hunting. */ |
| 458 | if (*match == -1) |
| 459 | *match = racl_list->count - 1; |
| 460 | while (count--) { |
| 461 | rsync_acl *base = racl_list->items; |
| 462 | if (rsync_acl_equal(base + *match, racl)) |
| 463 | return *match; |
| 464 | if (!(*match)--) |
| 465 | *match = racl_list->count - 1; |
| 466 | } |
| 467 | |
| 468 | *match = -1; |
| 469 | return *match; |
| 470 | } |
| 471 | |
| 472 | static int get_rsync_acl(const char *fname, rsync_acl *racl, |
| 473 | SMB_ACL_TYPE_T type, mode_t mode) |
no test coverage detected