diff options
author | Simon Rettberg | 2017-12-06 15:30:28 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-12-06 15:30:28 +0100 |
commit | 4e758eca20f257662ea089a03b074d4bb708f499 (patch) | |
tree | 5d841ea7d17177a30178dfb6956bee333772a07a | |
parent | Add missing header for memset (diff) | |
download | ldadp-4e758eca20f257662ea089a03b074d4bb708f499.tar.gz ldadp-4e758eca20f257662ea089a03b074d4bb708f499.tar.xz ldadp-4e758eca20f257662ea089a03b074d4bb708f499.zip |
Always send empty search replies for unknown queries, fixes sssd sudo queries
-rw-r--r-- | proxy.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -854,6 +854,7 @@ static BOOL proxy_clientSearchRequest(epoll_client_t *client, const unsigned lon } const BOOL ret = proxy_localSearchRequest(client, messageId, &req); free_ldapsearchrequest(&req); + plog(DEBUG_TRACE, "[Client] Result: %d\n", (int)ret); return ret; } // Forward @@ -1131,13 +1132,13 @@ static BOOL proxy_localSearchRequest(epoll_client_t *client, const unsigned long } else { plog(DEBUG_VERBOSE, "[Proxy] Sending empty posixGroup search result to client."); } - const size_t doneLen = fmt_ldapsearchresultdone(NULL, success, "", "", ""); - const size_t doneHeaderLen = fmt_ldapmessage(NULL, messageId, SearchResultDone, doneLen); - char buffer[doneLen + doneHeaderLen]; - fmt_ldapsearchresultdone(buffer + doneHeaderLen, success, "", "", ""); - fmt_ldapmessage(buffer, messageId, SearchResultDone, doneLen); - return client_send(client, buffer, doneHeaderLen + doneLen, FALSE); } - return FALSE; + // Always send SearchResultDone here, so if we have no match above it results in + // an empty reply. + const size_t doneLen = fmt_ldapsearchresultdone(NULL, success, "", "", ""); + const size_t doneHeaderLen = fmt_ldapmessage(NULL, messageId, SearchResultDone, doneLen); + char buffer[doneLen + doneHeaderLen]; + fmt_ldapsearchresultdone(buffer + doneHeaderLen, success, "", "", ""); + fmt_ldapmessage(buffer, messageId, SearchResultDone, doneLen); + return client_send(client, buffer, doneHeaderLen + doneLen, FALSE); } - |