From: Nick Porter Date: Thu, 23 May 2024 17:14:28 +0000 (+0100) Subject: Give different response when cookie is being ignored X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea6313df193b4c6a6b9e10148c3e4f92392a2b5f;p=thirdparty%2Ffreeradius-server.git Give different response when cookie is being ignored So we don't also give the "Missing cookie" error --- diff --git a/src/listen/ldap_sync/rfc4533.c b/src/listen/ldap_sync/rfc4533.c index 032bde3334a..e1f8eeabf5b 100644 --- a/src/listen/ldap_sync/rfc4533.c +++ b/src/listen/ldap_sync/rfc4533.c @@ -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; } } }