Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
orbea -
OpenLDAP
Commits
56823973
Commit
56823973
authored
Mar 03, 2021
by
Ondřej Kuzník
Browse files
ITS#8345 Remove LDIF_KLUDGE and defer defaults to _wrap()
parent
455dd54b
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ldif.h
View file @
56823973
...
...
@@ -33,7 +33,7 @@ LDAP_BEGIN_DECL
/* This is NOT a bogus extern declaration (unlike ldap_debug) */
LDAP_LDIF_V
(
int
)
ldif_debug
;
#define LDIF_LINE_WIDTH 7
6
/* default maximum length of LDIF lines */
#define LDIF_LINE_WIDTH 7
8
/* default maximum length of LDIF lines */
#define LDIF_LINE_WIDTH_MAX ((ber_len_t)-1)
/* maximum length of LDIF lines */
#define LDIF_LINE_WIDTH_WRAP(wrap) ((wrap) == 0 ? LDIF_LINE_WIDTH : (wrap))
...
...
@@ -50,9 +50,7 @@ LDAP_LDIF_V (int) ldif_debug;
* first newline + base64 value + continued lines. Each continued line
* needs room for a newline and a leading space character.
*/
#define LDIF_SIZE_NEEDED(nlen,vlen) \
((nlen) + 4 + LDIF_BASE64_LEN(vlen) \
+ ((LDIF_BASE64_LEN(vlen) + (nlen) + 3) / (LDIF_LINE_WIDTH-1) * 2 ))
#define LDIF_SIZE_NEEDED(nlen,vlen) LDIF_SIZE_NEEDED_WRAP(nlen, vlen, 0)
#define LDIF_SIZE_NEEDED_WRAP(nlen,vlen,wrap) \
((nlen) + 4 + LDIF_BASE64_LEN(vlen) \
...
...
libraries/libldap/ldif.c
View file @
56823973
...
...
@@ -432,9 +432,6 @@ ldif_must_b64_encode( LDAP_CONST char *s )
return
0
;
}
/* compatibility with U-Mich off by two bug */
#define LDIF_KLUDGE 2
/* NOTE: only preserved for binary compatibility */
void
ldif_sput
(
...
...
@@ -444,7 +441,7 @@ ldif_sput(
LDAP_CONST
char
*
val
,
ber_len_t
vlen
)
{
ldif_sput_wrap
(
out
,
type
,
name
,
val
,
vlen
,
LDIF_LINE_WIDTH
+
LDIF_KLUDGE
);
ldif_sput_wrap
(
out
,
type
,
name
,
val
,
vlen
,
0
);
}
void
...
...
@@ -468,7 +465,7 @@ ldif_sput_wrap(
ber_len_t
i
;
if
(
!
wrap
)
wrap
=
LDIF_LINE_WIDTH
+
LDIF_KLUDGE
;
wrap
=
LDIF_LINE_WIDTH
;
/* prefix */
switch
(
type
)
{
...
...
@@ -664,7 +661,7 @@ ldif_put(
LDAP_CONST
char
*
val
,
ber_len_t
vlen
)
{
return
ldif_put_wrap
(
type
,
name
,
val
,
vlen
,
LDIF_LINE_WIDTH
);
return
ldif_put_wrap
(
type
,
name
,
val
,
vlen
,
0
);
}
char
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment