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
2f964def
Commit
2f964def
authored
18 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
add support for VERSION, TIMEOUT and NETWORK_TIMEOUT in ldap.conf
parent
a9a4a14d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/libldap/init.c
+24
-1
24 additions, 1 deletion
libraries/libldap/init.c
with
24 additions
and
1 deletion
libraries/libldap/init.c
+
24
−
1
View file @
2f964def
...
...
@@ -29,6 +29,7 @@
#include
"ldap-int.h"
#include
"ldap_defaults.h"
#include
"lutil.h"
struct
ldapoptions
ldap_int_global_options
=
{
LDAP_UNINITIALIZED
,
LDAP_DEBUG_NONE
};
...
...
@@ -43,6 +44,9 @@ struct ldapoptions ldap_int_global_options =
#define ATTR_SASL 6
#define ATTR_TLS 7
#define ATTR_OPT_TV 8
#define ATTR_OPT_INT 9
struct
ol_keyvalue
{
const
char
*
key
;
int
value
;
...
...
@@ -63,6 +67,9 @@ static const struct ol_attribute {
const
void
*
data
;
size_t
offset
;
}
attrs
[]
=
{
{
0
,
ATTR_OPT_TV
,
"TIMEOUT"
,
NULL
,
LDAP_OPT_TIMEOUT
},
{
0
,
ATTR_OPT_TV
,
"NETWORK_TIMEOUT"
,
NULL
,
LDAP_OPT_NETWORK_TIMEOUT
},
{
0
,
ATTR_OPT_INT
,
"VERSION"
,
NULL
,
LDAP_OPT_PROTOCOL_VERSION
},
{
0
,
ATTR_KV
,
"DEREF"
,
deref_kv
,
/* or &deref_kv[0] */
offsetof
(
struct
ldapoptions
,
ldo_deref
)},
{
0
,
ATTR_INT
,
"SIZELIMIT"
,
NULL
,
...
...
@@ -205,7 +212,7 @@ static void openldap_ldap_init_w_conf(
case
ATTR_INT
:
p
=
&
((
char
*
)
gopts
)[
attrs
[
i
].
offset
];
*
(
int
*
)
p
=
atoi
(
opt
);
(
void
)
lutil_atoi
(
(
int
*
)
p
,
opt
);
break
;
case
ATTR_KV
:
{
...
...
@@ -241,6 +248,22 @@ static void openldap_ldap_init_w_conf(
ldap_int_tls_config
(
NULL
,
attrs
[
i
].
offset
,
opt
);
#endif
break
;
case
ATTR_OPT_TV
:
{
struct
timeval
tv
;
tv
.
tv_sec
=
-
1
;
tv
.
tv_usec
=
0
;
(
void
)
lutil_atol
(
&
tv
.
tv_sec
,
opt
);
if
(
tv
.
tv_sec
>
0
)
{
(
void
)
ldap_set_option
(
NULL
,
attrs
[
i
].
offset
,
(
const
void
*
)
&
tv
);
}
}
break
;
case
ATTR_OPT_INT
:
{
int
v
=
-
1
;
(
void
)
lutil_atoi
(
&
v
,
opt
);
if
(
v
>
0
)
{
(
void
)
ldap_set_option
(
NULL
,
attrs
[
i
].
offset
,
(
const
void
*
)
&
v
);
}
}
break
;
}
break
;
...
...
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