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
d5936c12
Commit
d5936c12
authored
21 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Remove LDAP_DEPRECATED dependency
parent
4d29df5b
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
clients/tools/common.c
+22
-27
22 additions, 27 deletions
clients/tools/common.c
with
22 additions
and
27 deletions
clients/tools/common.c
+
22
−
27
View file @
d5936c12
...
...
@@ -32,7 +32,6 @@
#include
<ac/unistd.h>
#include
<ac/errno.h>
#define LDAP_DEPRECATED 1
#include
<ldap.h>
#include
"lutil_ldap.h"
...
...
@@ -651,35 +650,31 @@ tool_conn_setup( int not, void (*private_setup)( LDAP * ) )
#endif
if
(
!
not
)
{
/* connect to server */
int
rc
;
if
(
(
ldaphost
!=
NULL
||
ldapport
)
&&
(
ldapuri
==
NULL
)
)
{
if
(
verbose
)
{
fprintf
(
stderr
,
"ldap_init( %s, %d )
\n
"
,
ldaphost
!=
NULL
?
ldaphost
:
"<DEFAULT>"
,
ldapport
);
}
/* construct URL */
LDAPURLDesc
url
;
memset
(
&
url
,
0
,
sizeof
(
url
));
ld
=
ldap_init
(
ldaphost
,
ldapport
);
if
(
ld
==
NULL
)
{
char
buf
[
20
+
sizeof
(
": ldap_init"
)];
sprintf
(
buf
,
"%.20s: ldap_init"
,
prog
);
perror
(
buf
);
exit
(
EXIT_FAILURE
);
}
url
.
lud_scheme
=
"ldap"
;
url
.
lud_host
=
ldaphost
;
url
.
lud_port
=
ldapport
;
url
.
lud_scope
=
LDAP_SCOPE_DEFAULT
;
}
else
{
int
rc
;
if
(
verbose
)
{
fprintf
(
stderr
,
"ldap_initialize( %s )
\n
"
,
ldapuri
!=
NULL
?
ldapuri
:
"<DEFAULT>"
);
}
rc
=
ldap_initialize
(
&
ld
,
ldapuri
);
if
(
rc
!
=
LDAP_SUCCESS
)
{
fprintf
(
stderr
,
"Could not create LDAP session handle (%d): %s
\n
"
,
rc
,
ldap_err2string
(
rc
)
);
exit
(
EXIT_FAILURE
);
}
ldapuri
=
ldap_url_desc2str
(
&
url
);
}
if
(
verbose
)
{
fprintf
(
stderr
,
"ldap_initialize( %s )
\n
"
,
ldapuri
!=
NULL
?
ldapuri
:
"<DEFAULT>"
);
}
rc
=
ldap_initialize
(
&
ld
,
ldapuri
);
if
(
rc
!=
LDAP_SUCCESS
)
{
fprintf
(
stderr
,
"Could not create LDAP session handle (%d): %s
\n
"
,
rc
,
ldap_err2string
(
rc
)
);
exit
(
EXIT_FAILURE
);
}
if
(
private_setup
)
private_setup
(
ld
);
...
...
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