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

Function send_rsync_acl

acls.c:607–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607static void send_rsync_acl(int f, rsync_acl *racl, SMB_ACL_TYPE_T type,
608 item_list *racl_list)
609{
610 int ndx = find_matching_rsync_acl(racl, type, racl_list);
611
612 /* Send 0 (-1 + 1) to indicate that literal ACL data follows. */
613 write_varint(f, ndx + 1);
614
615 if (ndx < 0) {
616 rsync_acl *new_racl = EXPAND_ITEM_LIST(racl_list, rsync_acl, 1000);
617 uchar flags = 0;
618
619 if (racl->user_obj != NO_ENTRY)
620 flags |= XMIT_USER_OBJ;
621 if (racl->group_obj != NO_ENTRY)
622 flags |= XMIT_GROUP_OBJ;
623 if (racl->mask_obj != NO_ENTRY)
624 flags |= XMIT_MASK_OBJ;
625 if (racl->other_obj != NO_ENTRY)
626 flags |= XMIT_OTHER_OBJ;
627 if (racl->names.count)
628 flags |= XMIT_NAME_LIST;
629
630 write_byte(f, flags);
631
632 if (flags & XMIT_USER_OBJ)
633 write_varint(f, racl->user_obj);
634 if (flags & XMIT_GROUP_OBJ)
635 write_varint(f, racl->group_obj);
636 if (flags & XMIT_MASK_OBJ)
637 write_varint(f, racl->mask_obj);
638 if (flags & XMIT_OTHER_OBJ)
639 write_varint(f, racl->other_obj);
640 if (flags & XMIT_NAME_LIST)
641 send_ida_entries(f, &racl->names);
642
643 /* Give the allocated data to the new list object. */
644 *new_racl = *racl;
645 *racl = empty_rsync_acl;
646 }
647}
648
649/* Send the ACL from the stat_x structure down the indicated file descriptor.
650 * This also frees the ACL data. */

Callers 1

send_aclFunction · 0.85

Calls 4

find_matching_rsync_aclFunction · 0.85
write_varintFunction · 0.85
write_byteFunction · 0.85
send_ida_entriesFunction · 0.85

Tested by

no test coverage detected