Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
James Lowden
OpenLDAP
Commits
6a293c65
Commit
6a293c65
authored
18 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
line up network-timeout with back-meta
parent
c1019fbf
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
servers/slapd/back-ldap/bind.c
+8
-0
8 additions, 0 deletions
servers/slapd/back-ldap/bind.c
servers/slapd/back-ldap/config.c
+39
-0
39 additions, 0 deletions
servers/slapd/back-ldap/config.c
with
47 additions
and
0 deletions
servers/slapd/back-ldap/bind.c
+
8
−
0
View file @
6a293c65
...
...
@@ -485,6 +485,14 @@ ldap_back_prepare_conn( ldapconn_t **lcp, Operation *op, SlapReply *rs, ldap_bac
ldap_set_option
(
ld
,
LDAP_OPT_REFERRALS
,
LDAP_BACK_CHASE_REFERRALS
(
li
)
?
LDAP_OPT_ON
:
LDAP_OPT_OFF
);
if
(
li
->
li_network_timeout
>
0
)
{
struct
timeval
tv
;
tv
.
tv_sec
=
li
->
li_network_timeout
;
tv
.
tv_usec
=
0
;
ldap_set_option
(
ld
,
LDAP_OPT_NETWORK_TIMEOUT
,
(
const
void
*
)
&
tv
);
}
#ifdef HAVE_TLS
rs
->
sr_err
=
ldap_back_start_tls
(
ld
,
op
->
o_protocol
,
&
is_tls
,
li
->
li_uri
,
li
->
li_flags
,
li
->
li_nretries
,
&
rs
->
sr_text
);
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-ldap/config.c
+
39
−
0
View file @
6a293c65
...
...
@@ -62,6 +62,7 @@ enum {
LDAP_BACK_CFG_TIMEOUT
,
LDAP_BACK_CFG_IDLE_TIMEOUT
,
LDAP_BACK_CFG_CONN_TTL
,
LDAP_BACK_CFG_NETWORK_TIMEOUT
,
LDAP_BACK_CFG_REWRITE
,
LDAP_BACK_CFG_LAST
...
...
@@ -232,6 +233,14 @@ static ConfigTable ldapcfg[] = {
"SYNTAX OMsDirectoryString "
"SINGLE-VALUE )"
,
NULL
,
NULL
},
{
"network-timeout"
,
"timeout"
,
2
,
0
,
0
,
ARG_MAGIC
|
LDAP_BACK_CFG_NETWORK_TIMEOUT
,
ldap_back_cf_gen
,
"( OLcfgDbAt:3.17 "
"NAME 'olcDbNetworkTimeout' "
"DESC 'connection network timeout' "
"SYNTAX OMsDirectoryString "
"SINGLE-VALUE )"
,
NULL
,
NULL
},
{
"suffixmassage"
,
"[virtual]> <real"
,
2
,
3
,
0
,
ARG_STRING
|
ARG_MAGIC
|
LDAP_BACK_CFG_REWRITE
,
ldap_back_cf_gen
,
NULL
,
NULL
,
NULL
},
...
...
@@ -583,6 +592,19 @@ ldap_back_cf_gen( ConfigArgs *c )
value_add_one
(
&
c
->
rvalue_vals
,
&
bv
);
}
break
;
case
LDAP_BACK_CFG_NETWORK_TIMEOUT
:
{
char
buf
[
SLAP_TEXT_BUFLEN
];
if
(
li
->
li_network_timeout
==
0
)
{
return
1
;
}
snprintf
(
buf
,
sizeof
(
buf
),
"%ld"
,
(
long
)
li
->
li_network_timeout
);
ber_str2bv
(
buf
,
0
,
0
,
&
bv
);
value_add_one
(
&
c
->
rvalue_vals
,
&
bv
);
}
break
;
default:
/* FIXME: we need to handle all... */
assert
(
0
);
...
...
@@ -668,6 +690,10 @@ ldap_back_cf_gen( ConfigArgs *c )
li
->
li_conn_ttl
=
0
;
break
;
case
LDAP_BACK_CFG_NETWORK_TIMEOUT
:
li
->
li_network_timeout
;
break
;
default:
/* FIXME: we need to handle all... */
assert
(
0
);
...
...
@@ -1205,6 +1231,19 @@ done_url:;
li
->
li_conn_ttl
=
(
time_t
)
t
;
}
break
;
case
LDAP_BACK_CFG_NETWORK_TIMEOUT
:
{
unsigned
long
t
;
if
(
lutil_parse_time
(
c
->
argv
[
1
],
&
t
)
!=
0
)
{
snprintf
(
c
->
msg
,
sizeof
(
c
->
msg
),
"unable to parse network timeout
\"
%s
\"
"
,
c
->
argv
[
1
]
);
Debug
(
LDAP_DEBUG_ANY
,
"%s: %s.
\n
"
,
c
->
log
,
c
->
msg
,
0
);
return
1
;
}
li
->
li_network_timeout
=
(
time_t
)
t
;
}
break
;
case
LDAP_BACK_CFG_REWRITE
:
snprintf
(
c
->
msg
,
sizeof
(
c
->
msg
),
"rewrite/remap capabilities have been moved "
...
...
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