| |
@@ -188,11 +188,31 @@
|
| |
/* Check whether the Start TLS request can be accepted. */
|
| |
if (connection_operations_pending(conn, pb_op,
|
| |
1 /* check for ops where result not yet sent */)) {
|
| |
- slapi_log_err(SLAPI_LOG_PLUGIN, "start_tls",
|
| |
- "Other operations are still pending on the connection.\n");
|
| |
- ldaprc = LDAP_OPERATIONS_ERROR;
|
| |
- ldapmsg = "Other operations are still pending on the connection.";
|
| |
- goto unlock_and_return;
|
| |
+ for (Operation *op = conn->c_ops; op != NULL; op = op->o_next) {
|
| |
+ if (op == pb_op) {
|
| |
+ continue;
|
| |
+ }
|
| |
+ if ((op->o_msgid == -1) && (op->o_tag == LBER_DEFAULT)) {
|
| |
+ /* while processing start-tls extop we also received a new incoming operation
|
| |
+ * As this operation will not processed until start-tls completes.
|
| |
+ * Be fair do not consider this operation as a pending one
|
| |
+ */
|
| |
+ slapi_log_err(SLAPI_LOG_CONNS, "start_tls",
|
| |
+ "New incoming operation blocked by start-tls, Continue start-tls (conn=%"PRIu64").\n",
|
| |
+ conn->c_connid);
|
| |
+ continue;
|
| |
+ } else {
|
| |
+ /* It is problematic, this pending operation is processed and
|
| |
+ * start-tls can push new network layer while the operation
|
| |
+ * send result. Safest to abort start-tls
|
| |
+ */
|
| |
+ slapi_log_err(SLAPI_LOG_CONNS, "start_tls",
|
| |
+ "Other operations are still pending on the connection.\n");
|
| |
+ ldaprc = LDAP_OPERATIONS_ERROR;
|
| |
+ ldapmsg = "Other operations are still pending on the connection.";
|
| |
+ goto unlock_and_return;
|
| |
+ }
|
| |
+ }
|
| |
}
|
| |
|
| |
|
| |
Bug Description:
startTls pushes a network layer on top of the connection.
So when processing startTLS, there should not be a pending operation
else there is a risk that the operation sends back data on moving
network layer.
When startTls detects a pending operation it aborts startTls.
However if a new operation is received while processing startTls,
the operation is pending but can not be read because startTls
holds c_mutex.
Fix Description:
In case of unread pending operation, relax the control
and just log an information message.
https://pagure.io/389-ds-base/issue/51035
Reviewed by: ?
Platforms tested: F30
Flag Day: no
Doc impact: no