Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
93a2556f
Commit
93a2556f
authored
Mar 31, 2023
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wldap32: Don't call ldap_connect() when a connection has already been established.
parent
3bdf2ad6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
30 deletions
+33
-30
init.c
dlls/wldap32/init.c
+5
-7
winldap_private.h
dlls/wldap32/winldap_private.h
+28
-23
No files found.
dlls/wldap32/init.c
View file @
93a2556f
...
@@ -256,12 +256,10 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout )
...
@@ -256,12 +256,10 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout )
TRACE
(
"(%p, %p)
\n
"
,
ld
,
timeout
);
TRACE
(
"(%p, %p)
\n
"
,
ld
,
timeout
);
if
(
!
ld
)
return
WLDAP32_LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_LDAP_PARAM_ERROR
;
if
(
CONNECTED
(
ld
))
return
WLDAP32_LDAP_SUCCESS
;
if
(
timeout
&&
(
timeout
->
tv_sec
||
timeout
->
tv_usec
))
if
(
timeout
&&
(
timeout
->
tv_sec
||
timeout
->
tv_usec
))
FIXME
(
"ignoring timeout
\n
"
);
FIXME
(
"ignoring timeout
\n
"
);
if
((
ret
=
ldap_connect
(
CTX
(
ld
)
)))
return
map_error
(
ret
);
if
((
ret
=
ldap_connect
(
CTX
(
ld
)
)))
return
map_error
(
ret
);
if
(
cert_callback
)
if
(
cert_callback
)
{
{
...
@@ -285,6 +283,7 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout )
...
@@ -285,6 +283,7 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout )
}
}
}
}
CONNECTED
(
ld
)
=
TRUE
;
return
WLDAP32_LDAP_SUCCESS
;
return
WLDAP32_LDAP_SUCCESS
;
}
}
...
@@ -456,9 +455,8 @@ ULONG CDECL ldap_start_tls_sW( LDAP *ld, ULONG *retval, LDAPMessage **result, LD
...
@@ -456,9 +455,8 @@ ULONG CDECL ldap_start_tls_sW( LDAP *ld, ULONG *retval, LDAPMessage **result, LD
if
(
clientctrls
&&
!
(
clientctrlsU
=
controlarrayWtoU
(
clientctrls
)))
goto
exit
;
if
(
clientctrls
&&
!
(
clientctrlsU
=
controlarrayWtoU
(
clientctrls
)))
goto
exit
;
else
else
{
{
if
(
CONNECTED
(
ld
))
return
WLDAP32_LDAP_LOCAL_ERROR
;
ret
=
map_error
(
ldap_start_tls_s
(
CTX
(
ld
),
serverctrlsU
,
clientctrlsU
)
);
ret
=
map_error
(
ldap_start_tls_s
(
CTX
(
ld
),
serverctrlsU
,
clientctrlsU
)
);
if
(
!
ret
&&
WLDAP32_ldap_connect
(
ld
,
NULL
)
!=
WLDAP32_LDAP_SUCCESS
)
ret
=
WLDAP32_LDAP_LOCAL_ERROR
;
}
}
exit:
exit:
...
...
dlls/wldap32/winldap_private.h
View file @
93a2556f
...
@@ -194,16 +194,17 @@ typedef struct WLDAP32_berelement
...
@@ -194,16 +194,17 @@ typedef struct WLDAP32_berelement
char
*
opaque
;
char
*
opaque
;
}
WLDAP32_BerElement
;
}
WLDAP32_BerElement
;
typedef
struct
ldap
struct
ld_sb
{
{
struct
UINT_PTR
sb_sd
;
{
UCHAR
Reserved1
[
41
];
UINT_PTR
sb_sd
;
ULONG_PTR
sb_naddr
;
UCHAR
Reserved1
[
41
];
UCHAR
Reserved2
[
24
];
ULONG_PTR
sb_naddr
;
};
UCHAR
Reserved2
[
24
];
}
ld_sb
;
typedef
struct
ldap
{
struct
ld_sb
ld_sb
;
char
*
ld_host
;
char
*
ld_host
;
ULONG
ld_version
;
ULONG
ld_version
;
UCHAR
ld_lberoptions
;
UCHAR
ld_lberoptions
;
...
@@ -221,6 +222,25 @@ typedef struct ldap
...
@@ -221,6 +222,25 @@ typedef struct ldap
ULONG
ld_options
;
ULONG
ld_options
;
}
LDAP
,
*
PLDAP
;
}
LDAP
,
*
PLDAP
;
typedef
BOOLEAN
(
CDECL
VERIFYSERVERCERT
)(
LDAP
*
,
const
CERT_CONTEXT
**
);
struct
private_data
{
LDAP
*
ctx
;
struct
berval
**
server_ctrls
;
VERIFYSERVERCERT
*
cert_callback
;
BOOL
connected
;
};
C_ASSERT
(
sizeof
(
struct
private_data
)
<
FIELD_OFFSET
(
struct
ld_sb
,
sb_naddr
)
-
FIELD_OFFSET
(
struct
ld_sb
,
Reserved1
));
#define CTX(ld) (((struct private_data *)ld->ld_sb.Reserved1)->ctx)
#define SERVER_CTRLS(ld) (((struct private_data *)ld->ld_sb.Reserved1)->server_ctrls)
#define CERT_CALLBACK(ld) (((struct private_data *)ld->ld_sb.Reserved1)->cert_callback)
#define CONNECTED(ld) (((struct private_data *)ld->ld_sb.Reserved1)->connected)
#define MSG(entry) (entry->Request)
#define BER(ber) ((BerElement *)((ber)->opaque))
typedef
struct
l_timeval
typedef
struct
l_timeval
{
{
LONG
tv_sec
;
LONG
tv_sec
;
...
@@ -366,21 +386,6 @@ typedef struct ldapsearch
...
@@ -366,21 +386,6 @@ typedef struct ldapsearch
struct
WLDAP32_berval
*
cookie
;
struct
WLDAP32_berval
*
cookie
;
}
LDAPSearch
;
}
LDAPSearch
;
typedef
BOOLEAN
(
CDECL
VERIFYSERVERCERT
)(
LDAP
*
,
const
CERT_CONTEXT
**
);
struct
private_data
{
LDAP
*
ctx
;
struct
berval
**
server_ctrls
;
VERIFYSERVERCERT
*
cert_callback
;
};
#define CTX(ld) (((struct private_data *)ld->Reserved3)->ctx)
#define SERVER_CTRLS(ld) (((struct private_data *)ld->Reserved3)->server_ctrls)
#define CERT_CALLBACK(ld) (((struct private_data *)ld->Reserved3)->cert_callback)
#define MSG(entry) (entry->Request)
#define BER(ber) ((BerElement *)((ber)->opaque))
void
CDECL
WLDAP32_ber_bvecfree
(
BERVAL
**
);
void
CDECL
WLDAP32_ber_bvecfree
(
BERVAL
**
);
void
CDECL
WLDAP32_ber_bvfree
(
BERVAL
*
);
void
CDECL
WLDAP32_ber_bvfree
(
BERVAL
*
);
void
CDECL
WLDAP32_ber_free
(
WLDAP32_BerElement
*
,
int
);
void
CDECL
WLDAP32_ber_free
(
WLDAP32_BerElement
*
,
int
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment