https://bugs.openldap.org/show_bug.cgi?id=10105
Issue ID: 10105 Summary: slapd logging fails to add newline with large search filters Product: OpenLDAP Version: 2.6.6 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: quanah@openldap.org Target Milestone: ---
When using slapd logging rather than syslog, it fails to write a newline if the search filter is extremely long. Found this when examining the logs where the search filter has 500 users in it, in the form of:
"(&(objectClass=userobject)(|(uid=abc)(uid=xyz)....)"
In the slapd log, the filter gets truncated and the next log line is appended, so we end up with
...(uid=joe.hSep 27 18:21:09 hostname slapd[6373]: conn=1234 op=123 SEARCH RESULT tag=101 err=0 qtime=0.xxxx etime=0.xxx nentries=500 text=
https://bugs.openldap.org/show_bug.cgi?id=10105
--- Comment #1 from Ondřej Kuzník ondra@mistotebe.net --- Seems to be coming from here: https://git.openldap.org/openldap/openldap/-/blob/master/libraries/liblber/d...
Either we need to nul-terminate the buffer or (re)allocate it as/when needed.
https://bugs.openldap.org/show_bug.cgi?id=10105
--- Comment #2 from Howard Chu hyc@openldap.org --- I've reproduced this adding
logfile testrun/logf logfile-format syslog-utc
to the test002 config, and sending a search request like so:
#!/bin/sh
filter="(&(objectclass=person)(|" i=100 while [ $i -lt 600 ]; do filter="$filter(uid=$i)" i=`expr $i + 1` done filter="$filter))" echo $filter ../clients/tools/ldapsearch -x -H ldap://:9011 -b dc=example,dc=com "$filter"
The log output is truncated after "(uid=543)(uid="
https://bugs.openldap.org/show_bug.cgi?id=10105
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |CONFIRMED
--- Comment #3 from Howard Chu hyc@openldap.org --- (In reply to Ondřej Kuzník from comment #1)
Seems to be coming from here: https://git.openldap.org/openldap/openldap/-/blob/master/libraries/liblber/ debug.c#L44
Either we need to nul-terminate the buffer or (re)allocate it as/when needed.
The *printf functions always NUL-terminate already. The visual problem here is that the trailing NL is missing.
https://bugs.openldap.org/show_bug.cgi?id=10105
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CONFIRMED |IN_PROGRESS
--- Comment #4 from Howard Chu hyc@openldap.org --- https://git.openldap.org/openldap/openldap/-/merge_requests/653
https://bugs.openldap.org/show_bug.cgi?id=10105
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.5.17 Keywords|needs_review |
https://bugs.openldap.org/show_bug.cgi?id=10105
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@openldap.org |hyc@openldap.org
https://bugs.openldap.org/show_bug.cgi?id=10105
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |TEST Status|IN_PROGRESS |RESOLVED
--- Comment #5 from Quanah Gibson-Mount quanah@openldap.org --- head:
• 5c7b096b by Howard Chu at 2023-10-02T18:53:23+01:00 ITS#10105 liblber lutil_debug: ensure msg ends with NL
https://bugs.openldap.org/show_bug.cgi?id=10105
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED
--- Comment #6 from Quanah Gibson-Mount quanah@openldap.org --- RE26:
• 807a7cf7 by Howard Chu at 2024-01-11T17:57:58+00:00 ITS#10105 liblber lutil_debug: ensure msg ends with NL
• 889e945d by Howard Chu at 2024-01-11T17:59:02+00:00 ITS#10105 liblber lutil_debug: ensure msg ends with NL
https://bugs.openldap.org/show_bug.cgi?id=10105
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED