summaryrefslogtreecommitdiffstats
path: root/server/providers/ldap/sdap.h
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-08-04 11:57:20 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-04 13:37:51 -0400
commit4a2370f8450dafefc11f890c799660a7b99da3e7 (patch)
tree708e2170d67585f95468434aca793b3ae835e0a5 /server/providers/ldap/sdap.h
parent68f38d6713d4d0faec3364e4ce1fc0bbf1454f7d (diff)
downloadsssd-4a2370f8450dafefc11f890c799660a7b99da3e7.tar.gz
sssd-4a2370f8450dafefc11f890c799660a7b99da3e7.tar.xz
sssd-4a2370f8450dafefc11f890c799660a7b99da3e7.zip
Fix race condition in sdap code
Retrieving ldap results and storing users could sometimes results in race conditions where the final ldap result was retrieved before the store operations where finished resulting in the operations to be aborted before termination. Implement a serialization mechanism per operation.
Diffstat (limited to 'server/providers/ldap/sdap.h')
-rw-r--r--server/providers/ldap/sdap.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/providers/ldap/sdap.h b/server/providers/ldap/sdap.h
index 8466473e3..5afbcfc05 100644
--- a/server/providers/ldap/sdap.h
+++ b/server/providers/ldap/sdap.h
@@ -24,10 +24,14 @@
#include <ldap.h>
struct sdap_msg {
+ struct sdap_msg *next;
LDAPMessage *msg;
};
-typedef void (sdap_op_callback_t)(void *, int, struct sdap_msg *);
+struct sdap_op;
+
+typedef void (sdap_op_callback_t)(struct sdap_op *op,
+ struct sdap_msg *, int, void *);
struct sdap_handle;
@@ -40,6 +44,10 @@ struct sdap_op {
sdap_op_callback_t *callback;
void *data;
+
+ struct tevent_context *ev;
+ struct sdap_msg *list;
+ struct sdap_msg *last;
};
struct sdap_handle {