Lines Matching refs:res

174 	char *res = NULL;
189 if ((res = malloc(outlen)) == NULL)
191 outs = res;
196 if ((res = realloc(res, outlen + inbytesleft)) == NULL)
200 outs = res + outlen - outbytesleft;
207 free(res);
208 res = NULL;
212 res[outlen - outbytesleft] = '\0';
214 return (res);
1224 lookup_wksids_sid2pid(idmap_mapping *req, idmap_id_res *res, int *is_wksid)
1235 req->id1.idmap_id_u.sid.rid, res->id.idtype);
1238 res->id.idtype);
1288 if (res->id.idtype == IDMAP_POSIXID) {
1289 res->id.idtype = wksid->is_wuser ? IDMAP_UID : IDMAP_GID;
1311 switch (res->id.idtype) {
1313 res->id.idmap_id_u.uid = wksid->pid;
1316 res->id.idmap_id_u.gid = wksid->pid;
1323 res->direction = wksid->direction;
1324 res->info.how.map_type = IDMAP_MAP_TYPE_KNOWN_SID;
1325 res->info.src = IDMAP_MAP_SRC_HARD_CODED;
1340 lookup_wksids_pid2sid(idmap_mapping *req, idmap_id_res *res, int is_user)
1348 if (res->id.idtype == IDMAP_SID) {
1349 res->id.idtype = wksid->is_wuser ? IDMAP_USID : IDMAP_GSID;
1351 res->id.idmap_id_u.sid.rid = wksid->rid;
1354 res->id.idmap_id_u.sid.prefix =
1358 res->id.idmap_id_u.sid.prefix =
1363 if (res->id.idmap_id_u.sid.prefix == NULL) {
1390 res->direction = wksid->direction;
1391 res->info.how.map_type = IDMAP_MAP_TYPE_KNOWN_SID;
1392 res->info.src = IDMAP_MAP_SRC_HARD_CODED;
1501 lookup_cache_sid2pid(sqlite *cache, idmap_mapping *req, idmap_id_res *res)
1522 switch (res->id.idtype) {
1594 res->id.idtype = IDMAP_UID;
1595 res->id.idmap_id_u.uid = pid;
1597 res->id.idtype = IDMAP_GID;
1598 res->id.idmap_id_u.gid = pid;
1616 res->direction = IDMAP_DIRECTION_BI;
1628 res->direction =
1632 res->direction = IDMAP_DIRECTION_W2U;
1648 res->info.src = IDMAP_MAP_SRC_CACHE;
1649 res->info.how.map_type = strtoul(values[6], &end, 10);
1650 switch (res->info.how.map_type) {
1652 res->info.how.idmap_how_u.ad.dn =
1654 res->info.how.idmap_how_u.ad.attr =
1656 res->info.how.idmap_how_u.ad.value =
1661 res->info.how.idmap_how_u.nldap.dn =
1663 res->info.how.idmap_how_u.nldap.attr =
1665 res->info.how.idmap_how_u.nldap.value =
1670 res->info.how.idmap_how_u.rule.windomain =
1672 res->info.how.idmap_how_u.rule.winname =
1674 res->info.how.idmap_how_u.rule.unixname =
1676 res->info.how.idmap_how_u.rule.is_nt4 =
1678 res->info.how.idmap_how_u.rule.is_user =
1680 res->info.how.idmap_how_u.rule.is_wuser =
1694 res->info.how.idmap_how_u.idmu.dn =
1696 res->info.how.idmap_how_u.idmu.attr =
1698 res->info.how.idmap_how_u.idmu.value =
1820 lookup_name_cache(sqlite *cache, idmap_mapping *req, idmap_id_res *res)
1847 TRACE(req, res, "Not found in name cache");
1849 TRACE(req, res, "Name cache lookup error=%d", retcode);
1879 TRACE(req, res, "Found in name cache");
1896 idmap_id_res *res;
1950 res = &result->ids.ids_val[i];
1951 how = &res->info.how;
1966 if (res->retcode != IDMAP_ERR_RETRIABLE_NET_ERR)
1979 if (res->id.idtype == IDMAP_UID &&
1983 } else if (res->id.idtype == IDMAP_GID &&
1998 idmap_how_clear(&res->info.how);
1999 res->info.src = IDMAP_MAP_SRC_NEW;
2016 idmap_how_clear(&res->info.how);
2017 res->info.src = IDMAP_MAP_SRC_NEW;
2036 &res->retcode);
2051 &res->retcode);
2060 if (res->id.idmap_id_u.sid.prefix != NULL &&
2063 res->retcode = IDMAP_SUCCESS;
2067 if (res->id.idmap_id_u.sid.prefix != NULL) {
2077 qs, res->id.idmap_id_u.sid.prefix,
2078 &res->id.idmap_id_u.sid.rid,
2083 NULL, NULL, &res->retcode);
2098 &res->id.idmap_id_u.sid.prefix,
2099 &res->id.idmap_id_u.sid.rid,
2102 &res->retcode);
2111 if (res->id.idtype == IDMAP_USID)
2113 else if (res->id.idtype == IDMAP_GSID)
2122 idmap_how_clear(&res->info.how);
2123 res->info.src = IDMAP_MAP_SRC_NEW;
2130 &res->id.idmap_id_u.sid.prefix,
2131 &res->id.idmap_id_u.sid.rid,
2133 &req->id2.idtype, &res->retcode);
2142 if (res->id.idtype == IDMAP_USID)
2144 else if (res->id.idtype == IDMAP_GSID)
2149 idmap_how_clear(&res->info.how);
2150 res->info.src = IDMAP_MAP_SRC_NEW;
2157 &res->id.idmap_id_u.sid.prefix,
2158 &res->id.idmap_id_u.sid.rid,
2160 &req->id2.idtype, &res->retcode);
2224 res = &result->ids.ids_val[i];
2253 res->retcode = retcode;
2257 if (res->retcode == IDMAP_ERR_NOTFOUND) {
2259 idmap_how_clear(&res->info.how);
2263 if (res->retcode == IDMAP_ERR_NOTFOUND) {
2264 TRACE(req, res, "Not found in AD");
2267 if (res->retcode != IDMAP_SUCCESS) {
2268 TRACE(req, res, "AD lookup error=%d",
2269 res->retcode);
2275 if (res->id.idtype == IDMAP_POSIXID)
2276 res->id.idtype = IDMAP_UID;
2283 res->id.idtype == IDMAP_UID) {
2284 res->id.idmap_id_u.uid = posix_id;
2285 res->direction = IDMAP_DIRECTION_BI;
2286 res->info.how.map_type =
2288 res->info.src = IDMAP_MAP_SRC_NEW;
2294 if (res->id.idtype == IDMAP_POSIXID)
2295 res->id.idtype = IDMAP_GID;
2302 res->id.idtype == IDMAP_GID) {
2303 res->id.idmap_id_u.gid = posix_id;
2304 res->direction = IDMAP_DIRECTION_BI;
2305 res->info.how.map_type =
2307 res->info.src = IDMAP_MAP_SRC_NEW;
2313 res->retcode = IDMAP_ERR_SID;
2316 TRACE(req, res, "Found in AD");
2317 if (res->retcode == IDMAP_SUCCESS &&
2320 res->id.idmap_id_u.uid == IDMAP_SENTINEL_PID) &&
2321 NLDAP_MODE(res->id.idtype, state)) {
2326 if (res->retcode != IDMAP_SUCCESS) {
2327 if ((!(IDMAP_FATAL_ERROR(res->retcode))) &&
2328 res->id.idmap_id_u.sid.prefix == NULL &&
2334 * res->retcode to success).
2339 if (res->retcode ==
2342 res->retcode = IDMAP_SUCCESS;
2343 TRACE(req, res,
2346 TRACE(req, res,
2348 res->retcode = IDMAP_SUCCESS;
2351 TRACE(req, res, "AD lookup error");
2359 if (res->id.idtype == IDMAP_SID)
2360 res->id.idtype = type;
2364 res->retcode = IDMAP_ERR_SID;
2367 TRACE(req, res, "Found in AD");
2386 idmap_id_res *res;
2395 res = &result->ids.ids_val[i];
2399 res->retcode != IDMAP_SUCCESS)
2403 res->retcode = IDMAP_ERR_RETRIABLE_NET_ERR;
2414 res = &result->ids.ids_val[i];
2418 res->retcode = IDMAP_ERR_NO_ACTIVEDIRECTORY;
2452 res = &result->ids.ids_val[j];
2456 res->retcode = IDMAP_ERR_DOMAIN_NOTFOUND;
2492 * res->id.idtype =
2496 * res->id..[uid or gid] =
2500 * res->retcode =
2502 * res->direction =
2512 * type and is used to initialize res->id.idtype.
2535 idmap_id_res *res)
2541 res->id.idtype = req->id2.idtype;
2542 res->id.idmap_id_u.uid = IDMAP_SENTINEL_PID;
2543 res->direction = IDMAP_DIRECTION_UNDEF;
2577 retcode = lookup_wksids_sid2pid(req, res, &wksid);
2580 TRACE(req, res, "Hardwired mapping");
2583 TRACE(req, res,
2590 TRACE(req, res, "Well-known account");
2592 TRACE(req, res, "Not a well-known account");
2595 retcode = lookup_localsid2pid(req, res);
2597 TRACE(req, res, "Local SID");
2600 TRACE(req, res,
2604 TRACE(req, res, "Not a local SID");
2630 TRACE(req, res, "Added default domain");
2634 retcode = lookup_cache_sid2pid(state->cache, req, res);
2636 TRACE(req, res, "Found in mapping cache");
2639 TRACE(req, res, "Mapping cache lookup error=%d", retcode);
2642 TRACE(req, res, "Not found in mapping cache");
2658 retcode = lookup_name_cache(state->cache, req, res);
2660 if (res->id.idtype == IDMAP_POSIXID) {
2662 res->id.idtype = IDMAP_UID;
2664 res->id.idtype = IDMAP_GID;
2683 TRACE(req, res, "Found with LSA");
2685 TRACE(req, res, "Not found with LSA");
2687 TRACE(req, res, "LSA error %d", retcode);
2707 TRACE(req, res, "Found with LSA");
2709 TRACE(req, res, "Not found with LSA");
2711 TRACE(req, res, "LSA error %d", retcode);
2734 AD_OR_MIXED_MODE(res->id.idtype, state)) ||
2735 (!wksid && res->id.idmap_id_u.uid == IDMAP_SENTINEL_PID &&
2740 } else if (NLDAP_MODE(res->id.idtype, state)) {
2747 res->retcode = idmap_stat4prot(retcode);
2752 if (ARE_WE_DONE(req->direction) && res->retcode != IDMAP_SUCCESS)
2753 res->id.idmap_id_u.uid = UID_NOBODY;
2764 generate_localsid(idmap_mapping *req, idmap_id_res *res, int is_user,
2767 free(res->id.idmap_id_u.sid.prefix);
2768 res->id.idmap_id_u.sid.prefix = NULL;
2774 if (is_user && res->id.idtype == IDMAP_GSID)
2776 if (!is_user && res->id.idtype == IDMAP_USID)
2789 res->id.idmap_id_u.sid.prefix =
2791 if (res->id.idmap_id_u.sid.prefix == NULL) {
2797 res->id.idmap_id_u.sid.rid =
2800 res->direction = IDMAP_DIRECTION_BI;
2801 if (res->id.idtype == IDMAP_SID)
2802 res->id.idtype = is_user ? IDMAP_USID : IDMAP_GSID;
2805 res->info.how.map_type = IDMAP_MAP_TYPE_LOCAL_SID;
2806 res->info.src = IDMAP_MAP_SRC_ALGORITHMIC;
2819 lookup_localsid2pid(idmap_mapping *req, idmap_id_res *res)
2846 switch (res->id.idtype) {
2850 res->id.idmap_id_u.uid = rid - LOCALRID_UID_MIN;
2855 res->id.idmap_id_u.gid = rid - LOCALRID_GID_MIN;
2859 res->id.idmap_id_u.gid = rid - LOCALRID_GID_MIN;
2860 res->id.idtype = IDMAP_GID;
2862 res->id.idmap_id_u.uid = rid - LOCALRID_UID_MIN;
2863 res->id.idtype = IDMAP_UID;
2871 res->info.how.map_type = IDMAP_MAP_TYPE_LOCAL_SID;
2872 res->info.src = IDMAP_MAP_SRC_ALGORITHMIC;
3010 idmap_mapping *req, idmap_id_res *res)
3019 idmap_namerule *rule = &res->info.how.idmap_how_u.rule;
3042 switch (res->id.idtype) {
3051 res->id.idtype = is_user ? IDMAP_UID : IDMAP_GID;
3092 TRACE(req, res, "Matching rule: %s@%s -> %s",
3110 TRACE(req, res, "Mapping inhibited");
3128 &res->id);
3133 TRACE(req, res,
3139 TRACE(req, res,
3150 TRACE(req, res, "Looking up %s error=%d",
3155 TRACE(req, res, "No matching rule");
3172 res->direction =
3176 res->direction = IDMAP_DIRECTION_W2U;
3183 TRACE(req, res, "UNIX name found");
3187 res->direction);
3193 TRACE(req, res, "Rule processing error, code=%d", retcode);
3200 res->info.how.map_type = IDMAP_MAP_TYPE_RULE_BASED;
3201 res->info.src = IDMAP_MAP_SRC_NEW;
3338 idmap_mapping *req, idmap_id_res *res)
3343 res->direction = IDMAP_DIRECTION_BI;
3345 if (IDMAP_ID_IS_EPHEMERAL(res->id.idmap_id_u.uid)) {
3346 res->info.how.map_type = IDMAP_MAP_TYPE_EPHEMERAL;
3347 res->info.src = IDMAP_MAP_SRC_CACHE;
3354 res->id.idmap_id_u.uid = next_pid;
3355 res->info.how.map_type = IDMAP_MAP_TYPE_EPHEMERAL;
3356 res->info.src = IDMAP_MAP_SRC_NEW;
3360 if (res->id.idtype == IDMAP_UID) {
3363 res->id.idmap_id_u.uid = next_pid;
3367 res->id.idmap_id_u.gid = next_pid;
3370 res->info.how.map_type = IDMAP_MAP_TYPE_EPHEMERAL;
3371 res->info.src = IDMAP_MAP_SRC_NEW;
3381 idmap_mapping *req, idmap_id_res *res)
3388 return (res->retcode);
3391 retcode = res->retcode;
3403 if (res->id.idtype == IDMAP_POSIXID) {
3404 res->id.idtype = IDMAP_UID;
3405 TRACE(req, res, "Assume unresolvable SID is user");
3406 } else if (res->id.idtype == IDMAP_UID) {
3407 TRACE(req, res, "Must map unresolvable SID to user");
3408 } else if (res->id.idtype == IDMAP_GID) {
3409 TRACE(req, res, "Must map unresolvable SID to group");
3423 if (!IDMAP_ID_IS_EPHEMERAL(res->id.idmap_id_u.uid) &&
3424 res->id.idmap_id_u.uid != IDMAP_SENTINEL_PID) {
3432 retcode2 = ns_lookup_bypid(res->id.idmap_id_u.uid,
3433 res->id.idtype == IDMAP_UID, &req->id2name);
3435 TRACE(req, res,
3439 TRACE(req, res, "Found UNIX name");
3451 assert(res->id.idtype != IDMAP_POSIXID);
3452 if (AD_MODE(res->id.idtype, state))
3453 res->direction = IDMAP_DIRECTION_BI;
3454 else if (NLDAP_MODE(res->id.idtype, state))
3455 res->direction = IDMAP_DIRECTION_BI;
3456 else if (MIXED_MODE(res->id.idtype, state))
3457 res->direction = IDMAP_DIRECTION_W2U;
3496 if ((AD_MODE(res->id.idtype, state) ||
3497 MIXED_MODE(res->id.idtype, state)) &&
3503 res->id.idtype == IDMAP_GID) ||
3505 res->id.idtype == IDMAP_UID))) {
3506 TRACE(req, res, "Ignoring UNIX name found in AD");
3509 res->id.idmap_id_u.uid = IDMAP_SENTINEL_PID;
3512 if (res->id.idmap_id_u.uid == IDMAP_SENTINEL_PID) {
3514 NULL, &res->id);
3527 TRACE(req, res,
3531 TRACE(req, res, "UNIX lookup");
3538 if (res->info.how.map_type != IDMAP_MAP_TYPE_UNKNOWN)
3539 idmap_how_clear(&res->info.how);
3545 retcode = name_based_mapping_sid2pid(state, req, res);
3547 TRACE(req, res, "Rule-based mapping");
3550 TRACE(req, res, "Rule-based mapping error=%d", retcode);
3556 retcode = dynamic_ephemeral_mapping(state, req, res);
3558 TRACE(req, res, "Ephemeral mapping");
3561 TRACE(req, res, "Ephemeral mapping error=%d", retcode);
3566 res->retcode = idmap_stat4prot(retcode);
3567 if (res->retcode != IDMAP_SUCCESS) {
3569 res->id.idmap_id_u.uid = UID_NOBODY;
3578 idmap_mapping *req, idmap_id_res *res)
3596 if (res->retcode != IDMAP_SUCCESS)
3599 assert(res->direction != IDMAP_DIRECTION_UNDEF);
3601 assert(res->id.idtype != IDMAP_SID);
3620 TRACE(req, res, "Found UNIX name");
3622 TRACE(req, res, "Getting UNIX name error=%d", retcode2);
3625 assert(res->info.how.map_type != IDMAP_MAP_TYPE_UNKNOWN);
3626 switch (res->info.how.map_type) {
3628 map_dn = res->info.how.idmap_how_u.ad.dn;
3629 map_attr = res->info.how.idmap_how_u.ad.attr;
3630 map_value = res->info.how.idmap_how_u.ad.value;
3634 map_dn = res->info.how.idmap_how_u.nldap.dn;
3635 map_attr = res->info.how.idmap_how_u.nldap.attr;
3636 map_value = res->info.how.idmap_how_u.nldap.value;
3640 map_windomain = res->info.how.idmap_how_u.rule.windomain;
3641 map_winname = res->info.how.idmap_how_u.rule.winname;
3642 map_unixname = res->info.how.idmap_how_u.rule.unixname;
3643 map_is_nt4 = res->info.how.idmap_how_u.rule.is_nt4;
3653 map_dn = res->info.how.idmap_how_u.idmu.dn;
3654 map_attr = res->info.how.idmap_how_u.idmu.attr;
3655 map_value = res->info.how.idmap_how_u.idmu.value;
3675 res->id.idmap_id_u.sid.prefix, res->id.idmap_id_u.sid.rid,
3678 (res->id.idtype == IDMAP_USID) ? 1 : 0,
3680 (res->direction == 0) ? "1" : NULL,
3681 res->info.how.map_type, map_dn, map_attr, map_value,
3708 res->id.idmap_id_u.sid.prefix, res->id.idmap_id_u.sid.rid,
3710 res->id.idtype, state->name_cache_timeout);
3728 idmap_mapping *req, idmap_id_res *res)
3746 if (res->retcode != IDMAP_SUCCESS)
3757 !IDMAP_ID_IS_EPHEMERAL(res->id.idmap_id_u.uid)) {
3779 assert(res->direction != IDMAP_DIRECTION_UNDEF);
3780 assert(res->id.idmap_id_u.uid != IDMAP_SENTINEL_PID);
3782 switch (res->info.how.map_type) {
3784 map_dn = res->info.how.idmap_how_u.ad.dn;
3785 map_attr = res->info.how.idmap_how_u.ad.attr;
3786 map_value = res->info.how.idmap_how_u.ad.value;
3790 map_dn = res->info.how.idmap_how_u.nldap.dn;
3791 map_attr = res->info.how.idmap_how_u.ad.attr;
3792 map_value = res->info.how.idmap_how_u.nldap.value;
3796 map_windomain = res->info.how.idmap_how_u.rule.windomain;
3797 map_winname = res->info.how.idmap_how_u.rule.winname;
3798 map_unixname = res->info.how.idmap_how_u.rule.unixname;
3799 map_is_nt4 = res->info.how.idmap_how_u.rule.is_nt4;
3806 map_dn = res->info.how.idmap_how_u.idmu.dn;
3807 map_attr = res->info.how.idmap_how_u.idmu.attr;
3808 map_value = res->info.how.idmap_how_u.idmu.value;
3826 res->id.idmap_id_u.uid, req->id2name,
3827 (res->id.idtype == IDMAP_UID) ? 1 : 0,
3830 (res->direction == 0) ? "1" : NULL,
3831 res->info.how.map_type, map_dn, map_attr, map_value,
3878 lookup_cache_pid2sid(sqlite *cache, idmap_mapping *req, idmap_id_res *res,
3945 switch (res->id.idtype) {
3952 if (res->id.idtype == IDMAP_USID &&
3956 } else if (res->id.idtype == IDMAP_GSID &&
3961 res->id.idtype = idtype;
3963 res->id.idmap_id_u.sid.rid =
3965 res->id.idmap_id_u.sid.prefix = strdup(values[0]);
3966 if (res->id.idmap_id_u.sid.prefix == NULL) {
3973 res->direction =
3977 res->direction = IDMAP_DIRECTION_U2W;
4003 res->info.src = IDMAP_MAP_SRC_CACHE;
4004 res->info.how.map_type = strtoul(values[6], &end, 10);
4005 switch (res->info.how.map_type) {
4007 res->info.how.idmap_how_u.ad.dn =
4009 res->info.how.idmap_how_u.ad.attr =
4011 res->info.how.idmap_how_u.ad.value =
4016 res->info.how.idmap_how_u.nldap.dn =
4018 res->info.how.idmap_how_u.nldap.attr =
4020 res->info.how.idmap_how_u.nldap.value =
4025 res->info.how.idmap_how_u.rule.windomain =
4027 res->info.how.idmap_how_u.rule.winname =
4029 res->info.how.idmap_how_u.rule.unixname =
4031 res->info.how.idmap_how_u.rule.is_nt4 =
4033 res->info.how.idmap_how_u.rule.is_user =
4035 res->info.how.idmap_how_u.rule.is_wuser =
4049 res->info.how.idmap_how_u.idmu.dn =
4051 res->info.how.idmap_how_u.idmu.attr =
4053 res->info.how.idmap_how_u.idmu.value =
4408 int is_user, idmap_mapping *req, idmap_id_res *res)
4421 idmap_namerule *rule = &res->info.how.idmap_how_u.rule;
4426 assert(res->id.idmap_id_u.sid.prefix == NULL); /* No SID either */
4458 TRACE(req, res, "Matching rule: %s -> %s@%s",
4482 TRACE(req, res, "Mapping inhibited");
4493 want_wuser = res->id.idtype == IDMAP_USID ? 1
4494 : res->id.idtype == IDMAP_GSID ? 0
4500 TRACE(req, res,
4505 TRACE(req, res,
4514 &res->id.idmap_id_u.sid.prefix,
4515 &res->id.idmap_id_u.sid.rid,
4516 &res->id.idtype, req, 0);
4522 TRACE(req, res,
4527 TRACE(req, res,
4533 TRACE(req, res,
4547 TRACE(req, res, "No matching rule");
4562 res->direction =
4566 res->direction = IDMAP_DIRECTION_U2W;
4575 TRACE(req, res, "Windows name found");
4582 res->info.how.map_type = IDMAP_MAP_TYPE_RULE_BASED;
4583 res->info.src = IDMAP_MAP_SRC_NEW;
4610 * res->id.idtype =
4618 * res->retcode =
4620 * res->direction =
4630 * type and is used to initialize res->id.idtype.
4650 idmap_id_res *res, int is_user)
4657 res->id.idtype = req->id2.idtype;
4658 res->direction = IDMAP_DIRECTION_UNDEF;
4675 TRACE(req, res, "Getting UNIX ID error=%d", retcode);
4679 TRACE(req, res, "Found UNIX ID");
4683 retcode = lookup_wksids_pid2sid(req, res, is_user);
4685 TRACE(req, res, "Hardwired mapping");
4688 TRACE(req, res,
4694 retcode = lookup_cache_pid2sid(state->cache, req, res, is_user);
4696 TRACE(req, res, "Found in mapping cache");
4699 TRACE(req, res,
4703 TRACE(req, res, "Not found in mapping cache");
4708 TRACE(req, res, "Shouldn't have an ephemeral ID here");
4738 TRACE(req, res,
4743 TRACE(req, res, "Found UNIX name");
4766 res->retcode = idmap_stat4prot(retcode);
4767 if (ARE_WE_DONE(req->direction) && res->retcode != IDMAP_SUCCESS) {
4769 retcode2 = generate_localsid(req, res, is_user, TRUE);
4771 TRACE(req, res, "Generate local SID");
4773 TRACE(req, res,
4782 idmap_id_res *res, int is_user)
4790 return (res->retcode);
4793 retcode = res->retcode;
4809 if (res->id.idmap_id_u.sid.prefix == NULL) {
4810 TRACE(req, res, "Windows name but no SID");
4815 res->direction = IDMAP_DIRECTION_BI;
4817 res->direction = IDMAP_DIRECTION_BI;
4819 res->direction = IDMAP_DIRECTION_BI;
4821 res->direction = IDMAP_DIRECTION_W2U;
4823 } else if (res->id.idmap_id_u.sid.prefix != NULL) {
4832 if (res->info.how.map_type != IDMAP_MAP_TYPE_UNKNOWN)
4833 idmap_how_clear(&res->info.how);
4840 TRACE(req, res,
4844 TRACE(req, res, "Found UNIX name");
4849 TRACE(req, res,
4854 TRACE(req, res, "Found UNIX ID");
4859 req, res);
4861 retcode = generate_localsid(req, res, is_user, FALSE);
4863 TRACE(req, res, "Generated local SID");
4865 TRACE(req, res,
4872 res->retcode = idmap_stat4prot(retcode);
4873 if (res->retcode != IDMAP_SUCCESS) {
4880 retcode2 = generate_localsid(req, res, is_user, TRUE);
4882 TRACE(req, res, "Generate local SID");
4884 TRACE(req, res,
4887 res->id.idtype = is_user ? IDMAP_USID : IDMAP_GSID;