moved from Incoming to Contrib
Full_Name: Pierangelo Masarati Version: HEAD/re24 OS: irrelevant URL: ftp://ftp.openldap.org/incoming/pierangelo-masarati-2010-09-09-ldif-wrap.1.patch Submission from: (NULL) (129.72.165.135) Submitted by: ando The subject should be self-explanatory. It is only exploited by slapcat, via the -o ldif-wrap=<n> option (<n> < 0: default; <n> == 0: no wrap; <n> > 0: wrap value); extending ldapsearch is trivial. I'm *NOT* going to commit this unless there is unanimous consensus ;) Enjoy. p.
masarati@aero.polimi.it wrote: > Full_Name: Pierangelo Masarati > Version: HEAD/re24 > OS: irrelevant > URL: ftp://ftp.openldap.org/incoming/pierangelo-masarati-2010-09-09-ldif-wrap.1.patch > Submission from: (NULL) (129.72.165.135) > Submitted by: ando > > > The subject should be self-explanatory. It is only exploited by slapcat, via > the -o ldif-wrap=<n> option (<n> < 0: default;<n> == 0: no wrap;<n> > 0: wrap > value); extending ldapsearch is trivial. > > I'm *NOT* going to commit this unless there is unanimous consensus ;) Not thrilled with the magic constant 2^31-1. Seems like you should have just used "if ( wrap && len > wrap )" instead of a word-size-dependent magic. -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/
<ftp://ftp.openldap.org/incoming/pierangelo-masarati-2010-09-09-ldif-wrap.2.patch> :)
hyc@symas.com writes: > Not thrilled with the magic constant 2^31-1. Seems like you should have just > used "if ( wrap && len > wrap )" instead of a word-size-dependent magic. The code just needs to be a little less clever:-) Pass -1 to a 'ber_len_t wrap'. The constant (ber_len_t)-1 will prevent wrapping: "if (len > (ber_len_t)-1)" always fails. But if we are going to have smarter LDIF output, I'm more interested in an option to avoid base64 encoding of valid UTF-8 strings. Also one to force base64-encoding for caller-specified attributes. Or just a bitflag to ldif_sput() after the caller checks the attribute type. -- Hallvard
> hyc@symas.com writes: >> Not thrilled with the magic constant 2^31-1. Seems like you should have >> just >> used "if ( wrap && len > wrap )" instead of a word-size-dependent magic. > > The code just needs to be a little less clever:-) Pass -1 to a > 'ber_len_t wrap'. The constant (ber_len_t)-1 will prevent wrapping: > "if (len > (ber_len_t)-1)" always fails. Thanks. > But if we are going to have smarter LDIF output, I'm more interested in > an option to avoid base64 encoding of valid UTF-8 strings. Also one > to force base64-encoding for caller-specified attributes. Or just > a bitflag to ldif_sput() after the caller checks the attribute type. See ldif_must_b64_encode_register() :) We already use it to force encoding of olcRootPW and other password-like attrs in proxy backends. p.
> hyc@symas.com writes: >> Not thrilled with the magic constant 2^31-1. Seems like you should have >> just >> used "if ( wrap && len > wrap )" instead of a word-size-dependent magic. > > The code just needs to be a little less clever:-) Pass -1 to a > 'ber_len_t wrap'. The constant (ber_len_t)-1 will prevent wrapping: > "if (len > (ber_len_t)-1)" always fails. <ftp://ftp.openldap.org/incoming/pierangelo-masarati-2010-09-09-ldif-wrap.3.patch> Includes documentation. Thanks for checking this. p.
changed notes changed state Open to Test
moved from Contrib to Development
changed notes changed state Test to Release
changed notes changed state Release to Closed
Added to HEAD Added to RE24