summaryrefslogtreecommitdiffstats
path: root/daemons
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2013-04-24 14:44:54 +0200
committerRob Crittenden <rcritten@redhat.com>2013-05-02 16:57:12 -0400
commit631b3cf7cd85d310773e84569bf29b37ff5cec1b (patch)
treee01b2d32adbb83149a04558fc895e12627e83658 /daemons
parentaa467af61429721d50b08c90d0de446ed9da5084 (diff)
downloadfreeipa-631b3cf7cd85d310773e84569bf29b37ff5cec1b.tar.gz
freeipa-631b3cf7cd85d310773e84569bf29b37ff5cec1b.tar.xz
freeipa-631b3cf7cd85d310773e84569bf29b37ff5cec1b.zip
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
Diffstat (limited to 'daemons')
-rw-r--r--daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
index 660ed04c2..e532807aa 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
@@ -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) {