Issue 8116 - [PATCH] ldapsearch: print 'SyncInfo Received' as a comment.
Summary: [PATCH] ldapsearch: print 'SyncInfo Received' as a comment.
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-28 20:26 UTC by Thomas Cort
Modified: 2020-01-30 18:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Thomas Cort 2015-04-28 20:26:33 UTC
Full_Name: Thomas Cort
Version: HEAD
OS: Mac OS X 10.10.3
URL: ftp://ftp.openldap.org/incoming/thomas-cort-150428.patch
Submission from: (NULL) (96.46.34.154)


When the -Esync command line option is used and a Sync Info
Message (RFC4533) is received, ldapsearch simply prints
'SyncInfo Received' to STDOUT. This causes LDIF parsers and
other tools which consume ldapsearch output to break on invalid
input.

Change this informational message to be conveyed as a comment.
Additionally, hide the message when comments are disabled (-LL or
-LLL).

I uploaded the patch to ftp.openldap.org as thomas-cort-150428.patch

The attached patch file is derived from OpenLDAP Software. All of the
modifications to OpenLDAP Software represented in the following patch(es) were
developed by Thomas Cort <linuxgeek@gmail.com>. I have not assigned rights
and/or interest in this work to any party.

I, Thas C Cort, hereby place the following modifications to OpenLDAP Software
(and only these modifications) into the public domain. Hence, these
modifications may be freely used and/or redistributed for any purpose with or
without attribution and/or other notice.
Comment 1 Howard Chu 2015-04-29 17:04:15 UTC
linuxgeek@gmail.com wrote:
> Full_Name: Thomas Cort
> Version: HEAD
> OS: Mac OS X 10.10.3
> URL: ftp://ftp.openldap.org/incoming/thomas-cort-150428.patch
> Submission from: (NULL) (96.46.34.154)
>
>
> When the -Esync command line option is used and a Sync Info
> Message (RFC4533) is received, ldapsearch simply prints
> 'SyncInfo Received' to STDOUT. This causes LDIF parsers and
> other tools which consume ldapsearch output to break on invalid
> input.
>
> Change this informational message to be conveyed as a comment.
> Additionally, hide the message when comments are disabled (-LL or
> -LLL).

If we're going to the trouble of patching this bit of code, I wonder if 
it would be worthwhile to actually print the contents of the syncinfo as 
well. Maybe a hex dump.
>
> I uploaded the patch to ftp.openldap.org as thomas-cort-150428.patch
>
> The attached patch file is derived from OpenLDAP Software. All of the
> modifications to OpenLDAP Software represented in the following patch(es) were
> developed by Thomas Cort <linuxgeek@gmail.com>. I have not assigned rights
> and/or interest in this work to any party.
>
> I, Thas C Cort, hereby place the following modifications to OpenLDAP Software
> (and only these modifications) into the public domain. Hence, these
> modifications may be freely used and/or redistributed for any purpose with or
> without attribution and/or other notice.
>
>


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 Quanah Gibson-Mount 2017-09-11 16:50:35 UTC
changed notes
Comment 3 Ondřej Kuzník 2017-10-31 17:05:29 UTC
On Wed, Apr 29, 2015 at 05:04:27PM +0000, hyc@symas.com wrote:
> linuxgeek@gmail.com wrote:
>> When the -Esync command line option is used and a Sync Info
>> Message (RFC4533) is received, ldapsearch simply prints
>> 'SyncInfo Received' to STDOUT. This causes LDIF parsers and
>> other tools which consume ldapsearch output to break on invalid
>> input.
>>
>> Change this informational message to be conveyed as a comment.
>> Additionally, hide the message when comments are disabled (-LL or
>> -LLL).
> 
> If we're going to the trouble of patching this bit of code, I wonder if 
> it would be worthwhile to actually print the contents of the syncinfo as 
> well. Maybe a hex dump.

It has just been useful to be able to observe and experiment with
syncrepl from ldapsearch so I went ahead and implemented this. The patch
is available at branch ITS8116 here:
https://github.com/mistotebe/openldap/tree/ITS8116

-- 
Ondřej Kuzník
Senior Software Engineer
Symas Corporation                       http://www.symas.com
Packaged, certified, and supported LDAP solutions powered by OpenLDAP

Comment 4 Quanah Gibson-Mount 2018-11-01 18:11:35 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Enhancements
Comment 5 Quanah Gibson-Mount 2020-01-25 00:56:56 UTC
changed notes
changed state Test to Release
Comment 6 OpenLDAP project 2020-01-30 18:32:12 UTC
Fixed in master
Bandaid fix in RE24 (2.4.49)
Comment 7 Quanah Gibson-Mount 2020-01-30 18:32:12 UTC
changed notes
changed state Release to Closed