]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9853 Allow inheriting lastbind precision from the frontend
authorOndřej Kuzník <ondra@mistotebe.net>
Wed, 7 Sep 2022 14:01:15 +0000 (15:01 +0100)
committerOndřej Kuzník <ondra@mistotebe.net>
Wed, 7 Sep 2022 14:01:15 +0000 (15:01 +0100)
doc/man/man5/slapd-config.5
doc/man/man5/slapd.conf.5
servers/slapd/bind.c

index c83acb9137c3caa7f8d2b11d4a3149f8658c3870..af16c5e51f9fa76cdea73072e53a9019b5525926 100644 (file)
@@ -1508,7 +1508,9 @@ will be updated. More than
 .B integer
 seconds must have passed since the last successful bind. In a
 replicated environment with frequent bind activity it may be
-useful to set this to a large value.
+useful to set this to a large value. On a backend, if set to
+.B 0
+(the default), the value set on the frontend is used.
 .TP
 .B olcLimits: <selector> <limit> [<limit> [...]]
 Specify time and size limits based on the operation's initiator or
index c7344b234e61001cb3c28096da228a0334dff774..fdebcbdd55b3c8f7e6bc336f2b688c652086af85 100644 (file)
@@ -1411,7 +1411,9 @@ will be updated. More than
 .B integer
 seconds must have passed since the last successful bind. In a
 replicated environment with frequent bind activity it may be
-useful to set this to a large value.
+useful to set this to a large value. On a backend, if set to
+.B 0
+(the default), the value set on the frontend is used.
 .TP
 .B limits <selector> <limit> [<limit> [...]]
 Specify time and size limits based on the operation's initiator or
index 19598f11a1365d2a0ac79c75bd89967576612bbe..ca04e4bc4d0e6ad468acbde625f83fefadfdc218 100644 (file)
@@ -424,6 +424,11 @@ fe_op_lastbind( Operation *op )
        if ( (a = attr_find( e->e_attrs, slap_schema.si_ad_pwdLastSuccess )) != NULL ) {
                struct lutil_tm tm;
                struct lutil_timet tt;
+               unsigned int precision = op->o_bd->be_lastbind_precision;
+
+               if ( precision == 0 ) {
+                       precision = frontendDB->be_lastbind_precision;
+               }
 
                if ( lutil_parsetime( a->a_nvals[0].bv_val, &tm ) == 0 ) {
                        lutil_tm2time( &tm, &tt );
@@ -437,8 +442,7 @@ fe_op_lastbind( Operation *op )
                 * TODO: If the recorded bind time is within configurable precision,
                 * it doesn't need to be updated (save a write for nothing)
                 */
-               if ( bindtime != (time_t)-1 &&
-                               op->o_time <= bindtime + op->o_bd->be_lastbind_precision ) {
+               if ( bindtime != (time_t)-1 && op->o_time <= bindtime + precision ) {
                        be_entry_release_r( op, e );
                        return LDAP_SUCCESS;
                }