mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Do not lookup up the domain too early if only the SID is known
Request with a SID as input parameter do not contain the domain name, hence is must be tried to resolve the SID first before the corresponding domain can be looked up. https://fedorahosted.org/freeipa/ticket/3596
This commit is contained in:
parent
aa467af614
commit
631b3cf7cd
@ -332,10 +332,13 @@ int handle_request(struct ipa_extdom_ctx *ctx, struct extdom_req *req,
|
||||
enum idmap_error_code err;
|
||||
char *sid_str;
|
||||
|
||||
ret = get_domain_info(ctx, req->data.name.domain_name, &domain_info);
|
||||
if (ret != 0) {
|
||||
return LDAP_OPERATIONS_ERROR;
|
||||
if (req->input_type != INP_SID) {
|
||||
ret = get_domain_info(ctx, req->data.name.domain_name, &domain_info);
|
||||
if (ret != 0) {
|
||||
return LDAP_OPERATIONS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (req->input_type == INP_POSIX_UID || req->input_type == INP_POSIX_GID) {
|
||||
if (req->input_type == INP_POSIX_UID) {
|
||||
id = req->data.posix_uid.uid;
|
||||
@ -374,6 +377,13 @@ int handle_request(struct ipa_extdom_ctx *ctx, struct extdom_req *req,
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (req->input_type == INP_SID) {
|
||||
ret = get_domain_info(ctx, domain_name, &domain_info);
|
||||
if (ret != 0) {
|
||||
return LDAP_OPERATIONS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
ret = create_response(req, domain_info, domain_name, name, &sid,
|
||||
name_type, res);
|
||||
if (ret != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user