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

Function rsync_acl_equal_enough

acls.c:205–224  ·  view source on GitHub ↗

Are the extended (non-permission-bit) entries equal? If so, the rest of * the ACL will be handled by the normal mode-preservation code. This is * only meaningful for access ACLs! Note: the 1st arg is a fully-populated * rsync_acl, but the 2nd parameter can be a condensed rsync_acl, which means * that it might have several of its permission objects set to NO_ENTRY. */

Source from the content-addressed store, hash-verified

203 * rsync_acl, but the 2nd parameter can be a condensed rsync_acl, which means
204 * that it might have several of its permission objects set to NO_ENTRY. */
205static BOOL rsync_acl_equal_enough(const rsync_acl *racl1,
206 const rsync_acl *racl2, mode_t m)
207{
208 if ((racl1->mask_obj ^ racl2->mask_obj) & NO_ENTRY)
209 return False; /* One has a mask and the other doesn't */
210
211 /* When there's a mask, the group_obj becomes an extended entry. */
212 if (racl1->mask_obj != NO_ENTRY) {
213 /* A condensed rsync_acl with a mask can only have no
214 * group_obj when it was identical to the mask. This
215 * means that it was also identical to the group attrs
216 * from the mode. */
217 if (racl2->group_obj == NO_ENTRY) {
218 if (racl1->group_obj != ((m >> 3) & 7))
219 return False;
220 } else if (racl1->group_obj != racl2->group_obj)
221 return False;
222 }
223 return ida_entries_equal(&racl1->names, &racl2->names);
224}
225
226static void rsync_acl_free(rsync_acl *racl)
227{

Callers 1

set_aclFunction · 0.85

Calls 1

ida_entries_equalFunction · 0.85

Tested by

no test coverage detected