+/* Add a uid to the list of uids. Only called on receiving side. */
+static uid_t recv_add_uid(uid_t id, char *name)
+{
+ uid_t id2 = name ? map_uid(id, name) : id;
+ struct idlist *node;
+
+ node = add_to_list(&uidlist, (int)id, name, (int)id2);
+
+ if (verbose > 3) {
+ rprintf(FINFO, "uid %d(%s) maps to %d\n",
+ (int)id, name ? name : "", (int)id2);
+ }
+
+ return id2;
+}
+
+/* Add a gid to the list of gids. Only called on receiving side. */
+static gid_t recv_add_gid(gid_t id, char *name)
+{
+ gid_t id2 = name ? map_gid(id, name) : id;
+ struct idlist *node;
+
+ if (!am_root && !is_in_group(id2))
+ id2 = GID_NONE;
+ node = add_to_list(&gidlist, (int)id, name, (int)id2);
+
+ if (verbose > 3) {
+ rprintf(FINFO, "gid %d(%s) maps to %d\n",
+ (int)id, name ? name : "", (int)id2);
+ }
+
+ return id2;
+}
+