this function is a definite candidate for a faster algorithm */
| 295 | |
| 296 | /* this function is a definite candidate for a faster algorithm */ |
| 297 | uid_t match_uid(uid_t uid) |
| 298 | { |
| 299 | static struct idlist *last = NULL; |
| 300 | struct idlist *list; |
| 301 | |
| 302 | if (last && id_eq_uid(last->id, uid)) |
| 303 | return last->id2; |
| 304 | |
| 305 | for (list = uidlist; list; list = list->next) { |
| 306 | if (id_eq_uid(list->id, uid)) |
| 307 | break; |
| 308 | } |
| 309 | |
| 310 | if (!list) |
| 311 | list = recv_add_id(&uidlist, uidmap, uid, NULL); |
| 312 | last = list; |
| 313 | |
| 314 | return list->id2; |
| 315 | } |
| 316 | |
| 317 | gid_t match_gid(gid_t gid, uint16 *flags_ptr) |
| 318 | { |
no test coverage detected