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
Nadezhda Ivanova
OpenLDAP
Commits
5ee53ca8
Commit
5ee53ca8
authored
26 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Add in WINSOCK2 ifdefs (ugh).
parent
9f92954d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libraries/libldap/cldap.c
+1
-1
1 addition, 1 deletion
libraries/libldap/cldap.c
libraries/libldap/open.c
+20
-0
20 additions, 0 deletions
libraries/libldap/open.c
libraries/libldap/os-ip.c
+1
-1
1 addition, 1 deletion
libraries/libldap/os-ip.c
with
22 additions
and
2 deletions
libraries/libldap/cldap.c
+
1
−
1
View file @
5ee53ca8
...
...
@@ -127,7 +127,7 @@ cldap_open( char *host, int port )
}
}
if
(
(
address
=
inet_a
ddr
(
host
)
)
==
-
1
)
{
if
(
inet_a
ton
(
host
,
&
address
)
==
0
)
{
if
(
(
hp
=
gethostbyname
(
host
))
==
NULL
)
{
errno
=
EHOSTUNREACH
;
continue
;
...
...
This diff is collapsed.
Click to expand it.
libraries/libldap/open.c
+
20
−
0
View file @
5ee53ca8
...
...
@@ -64,9 +64,20 @@ ldap_open( char *host, int port )
#ifdef LDAP_REFERRALS
LDAPServer
*
srv
;
#endif
/* LDAP_REFERRALS */
#ifdef HAVE_WINSOCK_2
WORD
wVersionRequested
;
WSADATA
wsaData
;
#endif
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_open
\n
"
,
0
,
0
,
0
);
#ifdef HAVE_WINSOCK_2
wVersionRequested
=
MAKEWORD
(
2
,
0
);
if
(
WSAStartup
(
wVersionRequested
,
&
wsadata
)
!=
0
)
{
return
(
NULL
);
}
#endif
if
((
ld
=
ldap_init
(
host
,
port
))
==
NULL
)
{
return
(
NULL
);
}
...
...
@@ -76,6 +87,9 @@ ldap_open( char *host, int port )
NULL
||
(
ld
->
ld_defhost
!=
NULL
&&
(
srv
->
lsrv_host
=
strdup
(
ld
->
ld_defhost
))
==
NULL
))
{
ldap_ld_free
(
ld
,
0
);
#ifdef HAVE_WINSOCK_2
WSACleanup
();
#endif
return
(
NULL
);
}
srv
->
lsrv_port
=
ld
->
ld_defport
;
...
...
@@ -84,6 +98,9 @@ ldap_open( char *host, int port )
if
(
ld
->
ld_defhost
!=
NULL
)
free
(
srv
->
lsrv_host
);
free
(
(
char
*
)
srv
);
ldap_ld_free
(
ld
,
0
);
#ifdef HAVE_WINSOCK_2
WSACleanup
();
#endif
return
(
NULL
);
}
++
ld
->
ld_defconn
->
lconn_refcnt
;
/* so it never gets closed/freed */
...
...
@@ -92,6 +109,9 @@ ldap_open( char *host, int port )
if
(
open_ldap_connection
(
ld
,
&
ld
->
ld_sb
,
ld
->
ld_defhost
,
ld
->
ld_defport
,
&
ld
->
ld_host
,
0
)
<
0
)
{
ldap_ld_free
(
ld
,
0
);
#ifdef HAVE_WINSOCK_2
WSACleanup
();
#endif
return
(
NULL
);
}
#endif
/* LDAP_REFERRALS */
...
...
This diff is collapsed.
Click to expand it.
libraries/libldap/os-ip.c
+
1
−
1
View file @
5ee53ca8
...
...
@@ -96,7 +96,7 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address,
connected
=
use_hp
=
0
;
if
(
host
!=
NULL
&&
(
address
=
inet_a
ddr
(
host
)
)
==
-
1
)
{
if
(
host
!=
NULL
&&
(
inet_a
ton
(
host
,
&
address
)
==
0
)
)
{
if
(
(
hp
=
gethostbyname
(
host
))
==
NULL
)
{
errno
=
EHOSTUNREACH
;
/* not exactly right, but... */
return
(
-
1
);
...
...
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