|
@@ -1300,14 +1300,36 @@ compute_idletimeout( slapdFrontendConfig_t *fecfg, Connection *conn )
|
|
|
if ( slapi_reslimit_get_integer_limit( conn, idletimeout_reslimit_handle,
|
|
if ( slapi_reslimit_get_integer_limit( conn, idletimeout_reslimit_handle,
|
|
|
&idletimeout ) != SLAPI_RESLIMIT_STATUS_SUCCESS ) {
|
|
&idletimeout ) != SLAPI_RESLIMIT_STATUS_SUCCESS ) {
|
|
|
/*
|
|
/*
|
|
|
- * no limit associated with binder/connection or some other error
|
|
|
|
|
- * occurred. use the default idle timeout.
|
|
|
|
|
|
|
+ * No limit associated with binder/connection or some other error
|
|
|
|
|
+ * occurred. If the user is anonymous and anonymous limits are
|
|
|
|
|
+ * set, attempt to set the bind based resource limits. We do this
|
|
|
|
|
+ * here since a BIND operation is not required prior to other
|
|
|
|
|
+ * operations. We want to set the anonymous limits early on so
|
|
|
|
|
+ * that they are put into effect if a BIND is never sent. If
|
|
|
|
|
+ * this is not an anonymous user and no bind-based limits are set,
|
|
|
|
|
+ * use the default idle timeout.
|
|
|
*/
|
|
*/
|
|
|
- if ( conn->c_isroot ) {
|
|
|
|
|
|
|
+ char *anon_dn = config_get_anon_limits_dn();
|
|
|
|
|
+
|
|
|
|
|
+ if ((conn->c_dn == NULL) && anon_dn && (strlen(anon_dn) > 0)) {
|
|
|
|
|
+ Slapi_DN *anon_sdn = slapi_sdn_new_dn_byref( anon_dn );
|
|
|
|
|
+
|
|
|
|
|
+ reslimit_update_from_dn( conn, anon_sdn );
|
|
|
|
|
+
|
|
|
|
|
+ if ( slapi_reslimit_get_integer_limit( conn,
|
|
|
|
|
+ idletimeout_reslimit_handle, &idletimeout ) !=
|
|
|
|
|
+ SLAPI_RESLIMIT_STATUS_SUCCESS ) {
|
|
|
|
|
+ idletimeout = fecfg->idletimeout;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ slapi_sdn_free( &anon_sdn );
|
|
|
|
|
+ } else if ( conn->c_isroot ) {
|
|
|
idletimeout = 0; /* no limit for Directory Manager */
|
|
idletimeout = 0; /* no limit for Directory Manager */
|
|
|
} else {
|
|
} else {
|
|
|
idletimeout = fecfg->idletimeout;
|
|
idletimeout = fecfg->idletimeout;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ slapi_ch_free_string( &anon_dn );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return( idletimeout );
|
|
return( idletimeout );
|