Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
b9e2fd0d
Commit
b9e2fd0d
authored
17 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
ldap_control*_dup() is no longer private; add ldap_pvt_put_control
parent
ee8431b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ldap_pvt.h
+4
-7
4 additions, 7 deletions
include/ldap_pvt.h
libraries/libldap/controls.c
+32
-26
32 additions, 26 deletions
libraries/libldap/controls.c
with
36 additions
and
33 deletions
include/ldap_pvt.h
+
4
−
7
View file @
b9e2fd0d
...
...
@@ -194,13 +194,10 @@ LDAP_F (void) ldap_pvt_hex_unescape LDAP_P(( char *s ));
LDAP_HEXLOWER(c) || LDAP_HEXUPPER(c))
/* controls.c */
struct
ldapcontrol
;
LDAP_F
(
struct
ldapcontrol
*
)
ldap_control_dup
LDAP_P
((
const
struct
ldapcontrol
*
ctrl
));
LDAP_F
(
struct
ldapcontrol
**
)
ldap_controls_dup
LDAP_P
((
struct
ldapcontrol
*
const
*
ctrls
));
LDAP_F
(
int
)
ldap_pvt_put_control
LDAP_P
((
const
struct
ldapcontrol
*
c
,
BerElement
*
ber
));
LDAP_F
(
int
)
ldap_pvt_get_controls
LDAP_P
((
BerElement
*
be
,
struct
ldapcontrol
***
ctrlsp
));
...
...
This diff is collapsed.
Click to expand it.
libraries/libldap/controls.c
+
32
−
26
View file @
b9e2fd0d
...
...
@@ -51,6 +51,36 @@
* }
*/
int
ldap_pvt_put_control
(
const
LDAPControl
*
c
,
BerElement
*
ber
)
{
if
(
ber_printf
(
ber
,
"{s"
/*}*/
,
c
->
ldctl_oid
)
==
-
1
)
{
return
LDAP_ENCODING_ERROR
;
}
if
(
c
->
ldctl_iscritical
/* only if true */
&&
(
ber_printf
(
ber
,
"b"
,
(
ber_int_t
)
c
->
ldctl_iscritical
)
==
-
1
)
)
{
return
LDAP_ENCODING_ERROR
;
}
if
(
!
BER_BVISNULL
(
&
c
->
ldctl_value
)
/* only if we have a value */
&&
(
ber_printf
(
ber
,
"O"
,
&
c
->
ldctl_value
)
==
-
1
)
)
{
return
LDAP_ENCODING_ERROR
;
}
if
(
ber_printf
(
ber
,
/*{*/
"N}"
)
==
-
1
)
{
return
LDAP_ENCODING_ERROR
;
}
return
LDAP_SUCCESS
;
}
/*
* ldap_int_put_controls
*/
...
...
@@ -97,32 +127,8 @@ ldap_int_put_controls(
}
for
(
c
=
ctrls
;
*
c
!=
NULL
;
c
++
)
{
if
(
ber_printf
(
ber
,
"{s"
/*}*/
,
(
*
c
)
->
ldctl_oid
)
==
-
1
)
{
ld
->
ld_errno
=
LDAP_ENCODING_ERROR
;
return
ld
->
ld_errno
;
}
if
(
(
*
c
)
->
ldctl_iscritical
/* only if true */
&&
(
ber_printf
(
ber
,
"b"
,
(
ber_int_t
)
(
*
c
)
->
ldctl_iscritical
)
==
-
1
)
)
{
ld
->
ld_errno
=
LDAP_ENCODING_ERROR
;
return
ld
->
ld_errno
;
}
if
(
(
*
c
)
->
ldctl_value
.
bv_val
!=
NULL
/* only if we have a value */
&&
(
ber_printf
(
ber
,
"O"
,
&
((
*
c
)
->
ldctl_value
)
)
==
-
1
)
)
{
ld
->
ld_errno
=
LDAP_ENCODING_ERROR
;
return
ld
->
ld_errno
;
}
if
(
ber_printf
(
ber
,
/*{*/
"N}"
)
==
-
1
)
{
ld
->
ld_errno
=
LDAP_ENCODING_ERROR
;
ld
->
ld_errno
=
ldap_pvt_put_control
(
*
c
,
ber
);
if
(
ld
->
ld_errno
!=
LDAP_SUCCESS
)
{
return
ld
->
ld_errno
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment