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
96e8fafb
Commit
96e8fafb
authored
25 years ago
by
Hallvard Furuseth
Browse files
Options
Downloads
Patches
Plain Diff
constify use of invalue in <ber/ldap>_set_option()
parent
2cc187ff
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
libraries/liblber/options.c
+5
-4
5 additions, 4 deletions
libraries/liblber/options.c
libraries/libldap/options.c
+15
-15
15 additions, 15 deletions
libraries/libldap/options.c
with
20 additions
and
19 deletions
libraries/liblber/options.c
+
5
−
4
View file @
96e8fafb
...
...
@@ -76,7 +76,8 @@ ber_set_option(
&&
(
option
==
LBER_OPT_MEMORY_FNS
)
&&
(
invalue
!=
NULL
))
{
BerMemoryFunctions
*
f
=
(
BerMemoryFunctions
*
)
invalue
;
const
BerMemoryFunctions
*
f
=
(
const
BerMemoryFunctions
*
)
invalue
;
/* make sure all functions are provided */
if
(
!
(
f
->
bmf_malloc
&&
f
->
bmf_calloc
...
...
@@ -107,7 +108,7 @@ ber_set_option(
if
(
item
==
NULL
)
{
if
(
option
==
LBER_OPT_BER_DEBUG
)
{
ber_int_debug
=
*
(
int
*
)
invalue
;
ber_int_debug
=
*
(
const
int
*
)
invalue
;
return
LBER_OPT_SUCCESS
;
}
else
if
(
option
==
LBER_OPT_LOG_PRINT_FN
)
{
...
...
@@ -124,12 +125,12 @@ ber_set_option(
switch
(
option
)
{
case
LBER_OPT_BER_OPTIONS
:
assert
(
BER_VALID
(
ber
)
);
ber
->
ber_options
=
*
(
int
*
)
invalue
;
ber
->
ber_options
=
*
(
const
int
*
)
invalue
;
return
LBER_OPT_SUCCESS
;
case
LBER_OPT_BER_DEBUG
:
assert
(
BER_VALID
(
ber
)
);
ber
->
ber_debug
=
*
(
int
*
)
invalue
;
ber
->
ber_debug
=
*
(
const
int
*
)
invalue
;
return
LBER_OPT_SUCCESS
;
default:
...
...
This diff is collapsed.
Click to expand it.
libraries/libldap/options.c
+
15
−
15
View file @
96e8fafb
...
...
@@ -330,19 +330,19 @@ ldap_set_option(
break
;
case
LDAP_OPT_DEREF
:
lo
->
ldo_deref
=
*
(
int
*
)
invalue
;
lo
->
ldo_deref
=
*
(
const
int
*
)
invalue
;
return
LDAP_OPT_SUCCESS
;
case
LDAP_OPT_SIZELIMIT
:
lo
->
ldo_sizelimit
=
*
(
int
*
)
invalue
;
lo
->
ldo_sizelimit
=
*
(
const
int
*
)
invalue
;
return
LDAP_OPT_SUCCESS
;
case
LDAP_OPT_TIMELIMIT
:
lo
->
ldo_timelimit
=
*
(
int
*
)
invalue
;
lo
->
ldo_timelimit
=
*
(
const
int
*
)
invalue
;
return
LDAP_OPT_SUCCESS
;
case
LDAP_OPT_PROTOCOL_VERSION
:
{
int
vers
=
*
(
int
*
)
invalue
;
int
vers
=
*
(
const
int
*
)
invalue
;
if
(
vers
<
LDAP_VERSION_MIN
||
vers
>
LDAP_VERSION_MAX
)
{
/* not supported */
break
;
...
...
@@ -351,7 +351,8 @@ ldap_set_option(
}
return
LDAP_OPT_SUCCESS
;
case
LDAP_OPT_SERVER_CONTROLS
:
{
LDAPControl
**
controls
=
(
LDAPControl
**
)
invalue
;
LDAPControl
*
const
*
controls
=
(
LDAPControl
*
const
*
)
invalue
;
ldap_controls_free
(
lo
->
ldo_sctrls
);
...
...
@@ -360,8 +361,7 @@ ldap_set_option(
return
LDAP_OPT_SUCCESS
;
}
lo
->
ldo_sctrls
=
ldap_controls_dup
(
(
LDAPControl
**
)
invalue
);
lo
->
ldo_sctrls
=
ldap_controls_dup
(
controls
);
if
(
lo
->
ldo_sctrls
==
NULL
)
{
/* memory allocation error ? */
...
...
@@ -370,7 +370,8 @@ ldap_set_option(
}
return
LDAP_OPT_SUCCESS
;
case
LDAP_OPT_CLIENT_CONTROLS
:
{
LDAPControl
**
controls
=
(
LDAPControl
**
)
invalue
;
LDAPControl
*
const
*
controls
=
(
LDAPControl
*
const
*
)
invalue
;
ldap_controls_free
(
lo
->
ldo_cctrls
);
...
...
@@ -379,8 +380,7 @@ ldap_set_option(
return
LDAP_OPT_SUCCESS
;
}
lo
->
ldo_cctrls
=
ldap_controls_dup
(
(
LDAPControl
**
)
invalue
);
lo
->
ldo_cctrls
=
ldap_controls_dup
(
controls
);
if
(
lo
->
ldo_cctrls
==
NULL
)
{
/* memory allocation error ? */
...
...
@@ -389,7 +389,7 @@ ldap_set_option(
}
return
LDAP_OPT_SUCCESS
;
case
LDAP_OPT_HOST_NAME
:
{
char
*
host
=
(
char
*
)
invalue
;
const
char
*
host
=
(
const
char
*
)
invalue
;
if
(
lo
->
ldo_defhost
!=
NULL
)
{
LDAP_FREE
(
lo
->
ldo_defhost
);
...
...
@@ -419,7 +419,7 @@ ldap_set_option(
}
return
LDAP_OPT_SUCCESS
;
case
LDAP_OPT_ERROR_NUMBER
:
{
int
err
=
*
(
int
*
)
invalue
;
int
err
=
*
(
const
int
*
)
invalue
;
if
(
ld
==
NULL
)
{
/* need a struct ldap */
...
...
@@ -430,7 +430,7 @@ ldap_set_option(
}
return
LDAP_OPT_SUCCESS
;
case
LDAP_OPT_ERROR_STRING
:
{
char
*
err
=
(
char
*
)
invalue
;
const
char
*
err
=
(
const
char
*
)
invalue
;
if
(
ld
==
NULL
)
{
/* need a struct ldap */
...
...
@@ -445,7 +445,7 @@ ldap_set_option(
}
return
LDAP_OPT_SUCCESS
;
case
LDAP_OPT_MATCHED_DN
:
{
char
*
err
=
(
char
*
)
invalue
;
const
char
*
err
=
(
const
char
*
)
invalue
;
if
(
ld
==
NULL
)
{
/* need a struct ldap */
...
...
@@ -464,7 +464,7 @@ ldap_set_option(
break
;
case
LDAP_OPT_DEBUG_LEVEL
:
lo
->
ldo_debug
=
*
(
int
*
)
invalue
;
lo
->
ldo_debug
=
*
(
const
int
*
)
invalue
;
return
LDAP_OPT_SUCCESS
;
default:
...
...
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