summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/slap.h
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-06-23 10:36:52 -0600
committerRich Megginson <rmeggins@redhat.com>2010-06-23 11:45:22 -0600
commitf70152942727368aa0ce378bdfd54c6bad32e69d (patch)
treec281e502023c121f996439c080cd4869d3896a75 /ldap/servers/slapd/slap.h
parentbeb23fe4b5cc15a692a2282b27a49deedb502eda (diff)
downloadds-f70152942727368aa0ce378bdfd54c6bad32e69d.tar.gz
ds-f70152942727368aa0ce378bdfd54c6bad32e69d.tar.xz
ds-f70152942727368aa0ce378bdfd54c6bad32e69d.zip
Bug 604453 - SASL Stress and Server crash: Program quits with the assertion failure in PR_Poll
https://bugzilla.redhat.com/show_bug.cgi?id=604453 Resolves: bug 604453 Bug Description: SASL Stress and Server crash: Program quits with the assertion failure in PR_Poll Reviewed by: nhosoi (Thanks!) Branch: master Fix Description: When the server pushes the SASL IO layer on to the connection it must do so when there are no other references to the connection. The only way to do this without introducing more locking is to have the saslbind code just register the intent to push SASL IO at the next available time. This cannot be done in the sasl bind code (or any operation code for that matter) because connection_threadmain() will enable the connection for reading (and polling) after reading the PDU and before calling the operation function. Therefore, during the operation function, the connection may be being actively polled, so we must not access the conn c_prfd. The best place to push the IO layer is in connection_threadmain, after the server has notified that there is read ready on the connection, but before we have actually attempted to read anything. At this point, connection_threadmain is the only thread that will be accessing the connection, and if we push or pop the IO layer before calling the read function, we are guaranteed to have the correct IO layer to use. The code has been made generic enough to allow for use by the startTLS code if the need arises. I also added some more locking in the saslbind code, and changed the sasl IO code to more closely resemble the way that the NSS code deals with IO layer push/pop. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no (cherry picked from commit c28fcadfc7812108573e40f13624e11a5a8609e5)
Diffstat (limited to 'ldap/servers/slapd/slap.h')
-rw-r--r--ldap/servers/slapd/slap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 7e60ca55..c5ea51cd 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -1290,6 +1290,8 @@ typedef struct op {
* represents a connection from an ldap client
*/
+typedef int (*Conn_IO_Layer_cb)(struct conn*, void *data);
+
struct Conn_Private;
typedef struct Conn_private Conn_private;
@@ -1345,6 +1347,11 @@ typedef struct conn {
int c_sort_result_code; /* sort result put in response */
time_t c_timelimit; /* time limit for this connection */
/* PAGED_RESULTS ENDS */
+ /* IO layer push/pop */
+ Conn_IO_Layer_cb c_push_io_layer_cb; /* callback to push an IO layer on the conn->c_prfd */
+ Conn_IO_Layer_cb c_pop_io_layer_cb; /* callback to pop an IO layer off of the conn->c_prfd */
+ void *c_io_layer_cb_data; /* callback data */
+
} Connection;
#define CONN_FLAG_SSL 1 /* Is this connection an SSL connection or not ?
* Used to direct I/O code when SSL is handled differently