| 315 | } |
| 316 | |
| 317 | gid_t match_gid(gid_t gid, uint16 *flags_ptr) |
| 318 | { |
| 319 | static struct idlist *last = NULL; |
| 320 | struct idlist *list; |
| 321 | |
| 322 | if (last && id_eq_gid(last->id, gid)) |
| 323 | list = last; |
| 324 | else { |
| 325 | for (list = gidlist; list; list = list->next) { |
| 326 | if (id_eq_gid(list->id, gid)) |
| 327 | break; |
| 328 | } |
| 329 | if (!list) |
| 330 | list = recv_add_id(&gidlist, gidmap, gid, NULL); |
| 331 | last = list; |
| 332 | } |
| 333 | |
| 334 | if (flags_ptr && list->flags & FLAG_SKIP_GROUP) |
| 335 | *flags_ptr |= FLAG_SKIP_GROUP; |
| 336 | return list->id2; |
| 337 | } |
| 338 | |
| 339 | /* Add a uid to the list of uids. Only called on sending side. */ |
| 340 | const char *add_uid(uid_t uid) |
no test coverage detected