r->out.result = MAPI_E_SUCCESS;
/* Search for an existing session and increment ref_count, otherwise create it */
- for (session = nsp_session; session; session = session->next) {
+ for (session = nsp_session; !found && session; session = session->next) {
if ((mpm_session_cmp(session->session, dce_call) == true)) {
mpm_session_increment_ref_count(session->session);
found = true;
session->session = mpm_session_init((TALLOC_CTX *)nsp_session, dce_call);
OPENCHANGE_RETVAL_IF(!session->session, MAPI_E_NOT_ENOUGH_RESOURCES, emsabp_ctx);
+ DEBUG(0, (" session is %p\n", session->session));
+
mpm_session_set_private_data(session->session, (void *) emsabp_ctx);
mpm_session_set_destructor(session->session, emsabp_destructor);
{
struct dcesrv_handle *h;
struct exchange_nsp_session *session;
- bool ret;
+ bool ret, found;
DEBUG(5, ("exchange_nsp: NspiUnbind (0x1)\n"));
/* Step 1. Retrieve handle and free if emsabp context and session are available */
h = dcesrv_handle_fetch(dce_call->context, r->in.handle, DCESRV_HANDLE_ANY);
if (h) {
- for (session = nsp_session; session; session = session->next) {
- if ((mpm_session_cmp(session->session, dce_call) == true)) {
+ found = false;
+ for (session = nsp_session; !found && session; session = session->next) {
+ found = mpm_session_cmp(session->session, dce_call);
+ if (found) {
ret = mpm_session_release(session->session);
if (ret == true) {
DLIST_REMOVE(nsp_session, session);
return MAPI_E_LOGON_FAILED;
}
- for (session = nsp_session; session; session = session->next) {
+ for (session = nsp_session; !found && session; session = session->next) {
if ((mpm_session_cmp(session->session, dce_call)) == true) {
emsabp_ctx = (struct emsabp_context *)session->session->private_data;
found = true;
return MAPI_E_LOGON_FAILED;
}
- for (session = nsp_session; session; session = session->next) {
- if ((mpm_session_cmp(session->session, dce_call)) == true) {
+ for (session = nsp_session; !found && session; session = session->next) {
+ found = mpm_session_cmp(session->session, dce_call);
+ if (found == true) {
emsabp_ctx = (struct emsabp_context *)session->session->private_data;
- found = true;
}
}
return MAPI_E_LOGON_FAILED;
}
- for (session = nsp_session; session; session = session->next) {
+ for (session = nsp_session; !found && session; session = session->next) {
+ DEBUG(0, (" comparing session %p with dce_call %p\n",
+ session->session, dce_call));
if ((mpm_session_cmp(session->session, dce_call)) == true) {
emsabp_ctx = (struct emsabp_context *)session->session->private_data;
found = true;
return MAPI_E_LOGON_FAILED;
}
- for (session = nsp_session; session; session = session->next) {
- if ((mpm_session_cmp(session->session, dce_call)) == true) {
+ for (session = nsp_session; !found && session; session = session->next) {
+ found = mpm_session_cmp(session->session, dce_call);
+ if (found) {
emsabp_ctx = (struct emsabp_context *)session->session->private_data;
- found = true;
}
}
return MAPI_E_LOGON_FAILED;
}
- for (session = nsp_session; session; session = session->next) {
- if ((mpm_session_cmp(session->session, dce_call)) == true) {
+ for (session = nsp_session; !found && session; session = session->next) {
+ found = mpm_session_cmp(session->session, dce_call);
+ if (found == true) {
emsabp_ctx = (struct emsabp_context *)session->session->private_data;
found = true;
}
return MAPI_E_LOGON_FAILED;
}
- for (session = nsp_session; session; session = session->next) {
- if ((mpm_session_cmp(session->session, dce_call)) == true) {
+ for (session = nsp_session; !found && session; session = session->next) {
+ found = mpm_session_cmp(session->session, dce_call);
+ if (found == true) {
emsabp_ctx = (struct emsabp_context *)session->session->private_data;
found = true;
}
const struct ndr_interface_table *table;
uint16_t opnum;
+ DEBUG (0, ("dcesrv_exchange_nsp_dispatch\n"));
+
table = (const struct ndr_interface_table *) dce_call->context->iface->private_data;
opnum = dce_call->pkt.u.request.opnum;
*/
static NTSTATUS dcesrv_exchange_nsp_init(struct dcesrv_context *dce_ctx)
{
+ DEBUG (0, ("dcesrv_exchange_nsp_init\n"));
/* Initialize exchange_nsp session */
nsp_session = talloc_zero(dce_ctx, struct exchange_nsp_session);
if (!nsp_session) return NT_STATUS_NO_MEMORY;
static NTSTATUS dcesrv_exchange_nsp_unbind(struct server_id server_id, uint32_t context_id)
{
struct exchange_nsp_session *session;
+ bool found = false;
+
+ DEBUG (0, ("dcesrv_exchange_nsp_unbind\n"));
- for (session = nsp_session; session; session = session->next) {
- if ((mpm_session_cmp_sub(session->session, server_id, context_id) == true)) {
+ for (session = nsp_session; !found && session; session = session->next) {
+ found = mpm_session_cmp_sub(session->session, server_id, context_id);
+ if (found == true) {
mpm_session_release(session->session);
DLIST_REMOVE(nsp_session, session);
DEBUG(6, ("[%s:%d]: Session found and released\n", __FUNCTION__, __LINE__));