summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-06 15:30:28 +0100
committerSimon Rettberg2017-12-06 15:30:28 +0100
commit4e758eca20f257662ea089a03b074d4bb708f499 (patch)
tree5d841ea7d17177a30178dfb6956bee333772a07a
parentAdd missing header for memset (diff)
downloadldadp-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.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/proxy.c b/proxy.c
index ad7496d..0eba792 100644
--- a/proxy.c
+++ b/proxy.c
@@ -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);
}
-