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

Function recv_id_list

uidlist.c:460–495  ·  view source on GitHub ↗

recv a complete uid/gid mapping from the peer and map the uid/gid * in the file list to local names */

Source from the content-addressed store, hash-verified

458/* recv a complete uid/gid mapping from the peer and map the uid/gid
459 * in the file list to local names */
460void recv_id_list(int f, struct file_list *flist)
461{
462 id_t id;
463 int i;
464
465 if ((preserve_uid || preserve_acls) && numeric_ids <= 0) {
466 /* read the uid list */
467 while ((id = read_varint30(f)) != 0)
468 recv_user_name(f, id);
469 if (xmit_id0_names)
470 recv_user_name(f, 0);
471 }
472
473 if ((preserve_gid || preserve_acls) && numeric_ids <= 0) {
474 /* read the gid list */
475 while ((id = read_varint30(f)) != 0)
476 recv_group_name(f, id, NULL);
477 if (xmit_id0_names)
478 recv_group_name(f, 0, NULL);
479 }
480
481 /* Now convert all the uids/gids from sender values to our values. */
482#ifdef SUPPORT_ACLS
483 if (preserve_acls && (!numeric_ids || usermap || groupmap))
484 match_acl_ids();
485#endif
486 if (am_root && preserve_uid && (!numeric_ids || usermap)) {
487 for (i = 0; i < flist->used; i++)
488 F_OWNER(flist->files[i]) = match_uid(F_OWNER(flist->files[i]));
489 }
490 if (preserve_gid && (!am_root || !numeric_ids || groupmap)) {
491 for (i = 0; i < flist->used; i++) {
492 F_GROUP(flist->files[i]) = match_gid(F_GROUP(flist->files[i]), &flist->files[i]->flags);
493 }
494 }
495}
496
497void parse_name_map(char *map, BOOL usernames)
498{

Callers 1

recv_file_listFunction · 0.85

Calls 6

read_varint30Function · 0.85
recv_user_nameFunction · 0.85
recv_group_nameFunction · 0.85
match_acl_idsFunction · 0.85
match_uidFunction · 0.85
match_gidFunction · 0.85

Tested by

no test coverage detected