Imported Debian patch 4.0.5-6~numeezy
This commit is contained in:
committed by
Mario Fetka
parent
c44de33144
commit
10dfc9587b
@@ -40,8 +40,6 @@
|
||||
#include "ipa_extdom.h"
|
||||
#include "util.h"
|
||||
|
||||
#define DEFAULT_MAX_NSS_BUFFER (128*1024*1024)
|
||||
|
||||
Slapi_PluginDesc ipa_extdom_plugin_desc = {
|
||||
IPA_EXTDOM_FEATURE_DESC,
|
||||
"FreeIPA project",
|
||||
@@ -51,7 +49,6 @@ Slapi_PluginDesc ipa_extdom_plugin_desc = {
|
||||
|
||||
static char *ipa_extdom_oid_list[] = {
|
||||
EXOP_EXTDOM_OID,
|
||||
EXOP_EXTDOM_V1_OID,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -74,8 +71,8 @@ static int ipa_extdom_extop(Slapi_PBlock *pb)
|
||||
struct berval *req_val = NULL;
|
||||
struct berval *ret_val = NULL;
|
||||
struct extdom_req *req = NULL;
|
||||
struct extdom_res *res = NULL;
|
||||
struct ipa_extdom_ctx *ctx;
|
||||
enum extdom_version version;
|
||||
|
||||
ret = slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_OID, &oid);
|
||||
if (ret != 0) {
|
||||
@@ -85,11 +82,7 @@ static int ipa_extdom_extop(Slapi_PBlock *pb)
|
||||
}
|
||||
LOG("Received extended operation request with OID %s\n", oid);
|
||||
|
||||
if (strcasecmp(oid, EXOP_EXTDOM_OID) == 0) {
|
||||
version = EXTDOM_V0;
|
||||
} else if (strcasecmp(oid, EXOP_EXTDOM_V1_OID) == 0) {
|
||||
version = EXTDOM_V1;
|
||||
} else {
|
||||
if (strcasecmp(oid, EXOP_EXTDOM_OID) != 0) {
|
||||
return SLAPI_PLUGIN_EXTENDED_NOT_HANDLED;
|
||||
}
|
||||
|
||||
@@ -114,25 +107,21 @@ static int ipa_extdom_extop(Slapi_PBlock *pb)
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = check_request(req, version);
|
||||
ret = handle_request(ctx, req, &res);
|
||||
if (ret != LDAP_SUCCESS) {
|
||||
rc = LDAP_UNWILLING_TO_PERFORM;
|
||||
err_msg = "Error in request data.\n";
|
||||
rc = LDAP_OPERATIONS_ERROR;
|
||||
err_msg = "Failed to handle the request.\n";
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = handle_request(ctx, req, &ret_val);
|
||||
ret = pack_response(res, &ret_val);
|
||||
if (ret != LDAP_SUCCESS) {
|
||||
if (ret == LDAP_NO_SUCH_OBJECT) {
|
||||
rc = LDAP_NO_SUCH_OBJECT;
|
||||
} else {
|
||||
rc = LDAP_OPERATIONS_ERROR;
|
||||
err_msg = "Failed to handle the request.\n";
|
||||
}
|
||||
rc = LDAP_OPERATIONS_ERROR;
|
||||
err_msg = "Failed to pack the response.\n";
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = slapi_pblock_set(pb, SLAPI_EXT_OP_RET_OID, oid);
|
||||
ret = slapi_pblock_set(pb, SLAPI_EXT_OP_RET_OID, EXOP_EXTDOM_OID);
|
||||
if (ret != 0) {
|
||||
rc = LDAP_OPERATIONS_ERROR;
|
||||
err_msg = "Failed to set the OID for the response.\n";
|
||||
@@ -149,15 +138,12 @@ static int ipa_extdom_extop(Slapi_PBlock *pb)
|
||||
rc = LDAP_SUCCESS;
|
||||
|
||||
done:
|
||||
if (req->err_msg != NULL) {
|
||||
err_msg = req->err_msg;
|
||||
}
|
||||
free_req_data(req);
|
||||
free_resp_data(res);
|
||||
if (err_msg != NULL) {
|
||||
LOG("%s", err_msg);
|
||||
}
|
||||
slapi_send_ldap_result(pb, rc, NULL, err_msg, 0, NULL);
|
||||
ber_bvfree(ret_val);
|
||||
free_req_data(req);
|
||||
return SLAPI_PLUGIN_EXTENDED_SENT_RESULT;
|
||||
}
|
||||
|
||||
@@ -195,14 +181,6 @@ static int ipa_extdom_init_ctx(Slapi_PBlock *pb, struct ipa_extdom_ctx **_ctx)
|
||||
goto done;
|
||||
}
|
||||
|
||||
ctx->max_nss_buf_size = slapi_entry_attr_get_uint(e,
|
||||
"ipaExtdomMaxNssBufSize");
|
||||
if (ctx->max_nss_buf_size == 0) {
|
||||
ctx->max_nss_buf_size = DEFAULT_MAX_NSS_BUFFER;
|
||||
}
|
||||
LOG("Maximal nss buffer size set to [%zu]!\n", ctx->max_nss_buf_size);
|
||||
|
||||
ret = 0;
|
||||
|
||||
done:
|
||||
if (ret) {
|
||||
|
||||
Reference in New Issue
Block a user