]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Give different response when cookie is being ignored
authorNick Porter <nick@portercomputing.co.uk>
Thu, 23 May 2024 17:14:28 +0000 (18:14 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 23 May 2024 17:18:16 +0000 (18:18 +0100)
So we don't also give the "Missing cookie" error

src/listen/ldap_sync/rfc4533.c

index 032bde3334a67a132cf4f4cebb05130c3f06841b..e1f8eeabf5bc74e8b3bcad13b2464a6d9a629a74 100644 (file)
@@ -171,6 +171,7 @@ int rfc4533_sync_init(fr_ldap_connection_t *conn, size_t sync_no, proto_ldap_syn
  * @return
  *     - 0 success, a cookie was parsed successfully.
  *     - -1 parse error.
+ *     - -2 same as existing cookie.
  */
 static int sync_new_cookie(bool *new_cookie, sync_state_t *sync, BerElement *ber)
 {
@@ -205,7 +206,7 @@ static int sync_new_cookie(bool *new_cookie, sync_state_t *sync, BerElement *ber
                        if (memcmp(sync->cookie, cookie.bv_val, cookie.bv_len) == 0) {
                                WARN("Ignoring new cookie \"%pV\": Identical to old cookie",
                                     fr_box_strvalue_len((char const *)sync->cookie, cookie_len));
-                               return 0;
+                               return -2;
                        }
                }
        }