MCPcopy Create free account
hub / github.com/RsyncProject/rsync / find_matching_rsync_acl

Function find_matching_rsync_acl

acls.c:448–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448static 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
472static int get_rsync_acl(const char *fname, rsync_acl *racl,
473 SMB_ACL_TYPE_T type, mode_t mode)

Callers 2

send_rsync_aclFunction · 0.85
cache_rsync_aclFunction · 0.85

Calls 1

rsync_acl_equalFunction · 0.85

Tested by

no test coverage detected