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
2e5a8595
Commit
2e5a8595
authored
Jul 21, 2023
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wldap32: Add support for ldap_set_option(LDAP_OPT_HOST_NAME).
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
parent
6dedfec9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
4 deletions
+90
-4
option.c
dlls/wldap32/option.c
+62
-4
parse.c
dlls/wldap32/tests/parse.c
+28
-0
No files found.
dlls/wldap32/option.c
View file @
2e5a8595
...
...
@@ -105,6 +105,24 @@ ULONG CDECL ldap_get_optionA( LDAP *ld, int option, void *value )
case
WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT
:
return
ldap_get_optionW
(
ld
,
LDAP_OPT_REFHOPLIMIT
,
value
);
case
WLDAP32_LDAP_OPT_HOST_NAME
:
{
WCHAR
*
hostW
;
char
*
host
;
ret
=
ldap_get_optionW
(
ld
,
option
,
&
hostW
);
if
(
!
ret
)
{
host
=
strWtoA
(
hostW
);
if
(
!
host
)
ret
=
WLDAP32_LDAP_NO_MEMORY
;
else
*
(
char
**
)
value
=
host
;
free
(
hostW
);
}
return
map_error
(
ret
);
}
case
WLDAP32_LDAP_OPT_CACHE_ENABLE
:
case
WLDAP32_LDAP_OPT_CACHE_FN_PTRS
:
case
WLDAP32_LDAP_OPT_CACHE_STRATEGY
:
...
...
@@ -122,7 +140,6 @@ ULONG CDECL ldap_get_optionA( LDAP *ld, int option, void *value )
case
WLDAP32_LDAP_OPT_ERROR_STRING
:
case
WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND
:
case
WLDAP32_LDAP_OPT_GETDSNAME_FLAGS
:
case
WLDAP32_LDAP_OPT_HOST_NAME
:
case
WLDAP32_LDAP_OPT_HOST_REACHABLE
:
case
WLDAP32_LDAP_OPT_PING_KEEP_ALIVE
:
case
WLDAP32_LDAP_OPT_PING_LIMIT
:
...
...
@@ -238,6 +255,24 @@ ULONG CDECL ldap_get_optionW( LDAP *ld, int option, void *value )
case
WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT
:
return
map_error
(
ldap_get_option
(
CTX
(
ld
),
LDAP_OPT_REFHOPLIMIT
,
value
)
);
case
WLDAP32_LDAP_OPT_HOST_NAME
:
{
WCHAR
*
hostW
;
char
*
host
;
ret
=
ldap_get_option
(
CTX
(
ld
),
LDAP_OPT_HOST_NAME
,
&
host
);
if
(
!
ret
)
{
hostW
=
strUtoW
(
host
);
if
(
!
hostW
)
ret
=
WLDAP32_LDAP_NO_MEMORY
;
else
*
(
WCHAR
**
)
value
=
hostW
;
free
(
host
);
}
return
map_error
(
ret
);
}
case
WLDAP32_LDAP_OPT_CACHE_ENABLE
:
case
WLDAP32_LDAP_OPT_CACHE_FN_PTRS
:
case
WLDAP32_LDAP_OPT_CACHE_STRATEGY
:
...
...
@@ -255,7 +290,6 @@ ULONG CDECL ldap_get_optionW( LDAP *ld, int option, void *value )
case
WLDAP32_LDAP_OPT_ERROR_STRING
:
case
WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND
:
case
WLDAP32_LDAP_OPT_GETDSNAME_FLAGS
:
case
WLDAP32_LDAP_OPT_HOST_NAME
:
case
WLDAP32_LDAP_OPT_HOST_REACHABLE
:
case
WLDAP32_LDAP_OPT_PING_KEEP_ALIVE
:
case
WLDAP32_LDAP_OPT_PING_LIMIT
:
...
...
@@ -322,6 +356,19 @@ ULONG CDECL ldap_set_optionA( LDAP *ld, int option, void *value )
case
WLDAP32_LDAP_OPT_TIMELIMIT
:
return
ldap_set_optionW
(
ld
,
option
,
value
);
case
WLDAP32_LDAP_OPT_HOST_NAME
:
{
char
**
host
=
value
;
WCHAR
*
hostW
;
hostW
=
strAtoW
(
*
host
);
if
(
!
hostW
)
return
WLDAP32_LDAP_NO_MEMORY
;
ret
=
ldap_set_optionW
(
ld
,
option
,
&
hostW
);
free
(
hostW
);
return
map_error
(
ret
);
}
case
WLDAP32_LDAP_OPT_CACHE_ENABLE
:
case
WLDAP32_LDAP_OPT_CACHE_FN_PTRS
:
case
WLDAP32_LDAP_OPT_CACHE_STRATEGY
:
...
...
@@ -342,7 +389,6 @@ ULONG CDECL ldap_set_optionA( LDAP *ld, int option, void *value )
case
WLDAP32_LDAP_OPT_ERROR_STRING
:
case
WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND
:
case
WLDAP32_LDAP_OPT_GETDSNAME_FLAGS
:
case
WLDAP32_LDAP_OPT_HOST_NAME
:
case
WLDAP32_LDAP_OPT_HOST_REACHABLE
:
case
WLDAP32_LDAP_OPT_PING_KEEP_ALIVE
:
case
WLDAP32_LDAP_OPT_PING_LIMIT
:
...
...
@@ -540,6 +586,19 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value )
return
ret
;
}
case
WLDAP32_LDAP_OPT_HOST_NAME
:
{
WCHAR
**
hostW
=
value
;
char
*
host
;
host
=
strWtoU
(
*
hostW
);
if
(
!
host
)
return
WLDAP32_LDAP_NO_MEMORY
;
ret
=
ldap_set_option
(
CTX
(
ld
),
LDAP_OPT_HOST_NAME
,
host
);
free
(
host
);
return
map_error
(
ret
);
}
case
WLDAP32_LDAP_OPT_CACHE_ENABLE
:
case
WLDAP32_LDAP_OPT_CACHE_FN_PTRS
:
case
WLDAP32_LDAP_OPT_CACHE_STRATEGY
:
...
...
@@ -566,7 +625,6 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value )
case
WLDAP32_LDAP_OPT_ERROR_STRING
:
case
WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND
:
case
WLDAP32_LDAP_OPT_GETDSNAME_FLAGS
:
case
WLDAP32_LDAP_OPT_HOST_NAME
:
case
WLDAP32_LDAP_OPT_HOST_REACHABLE
:
case
WLDAP32_LDAP_OPT_PING_KEEP_ALIVE
:
case
WLDAP32_LDAP_OPT_PING_LIMIT
:
...
...
dlls/wldap32/tests/parse.c
View file @
2e5a8595
...
...
@@ -632,10 +632,38 @@ static void test_opt_auto_reconnect(void)
ok
(
ret
==
LDAP_PARAM_ERROR
,
"ldap_set_optionA should fail, got %#lx
\n
"
,
ret
);
}
static
void
test_ldap_host_name
(
void
)
{
LDAP
*
ld
;
char
*
value
;
ULONG
ret
;
ld
=
ldap_initA
(
NULL
,
389
);
ok
(
ld
!=
NULL
,
"ldap_init failed
\n
"
);
value
=
(
char
*
)
"deadbeef"
;
ret
=
ldap_get_optionA
(
ld
,
LDAP_OPT_HOST_NAME
,
&
value
);
ok
(
!
ret
,
"ldap_get_option error %#lx
\n
"
,
ret
);
todo_wine
ok
(
!
value
,
"got %s
\n
"
,
value
);
value
=
(
char
*
)
"deadbeef"
;
ret
=
ldap_set_optionA
(
ld
,
LDAP_OPT_HOST_NAME
,
&
value
);
ok
(
!
ret
,
"ldap_set_option error %#lx
\n
"
,
ret
);
value
=
(
char
*
)
""
;
ret
=
ldap_get_optionA
(
ld
,
LDAP_OPT_HOST_NAME
,
&
value
);
ok
(
!
ret
,
"ldap_get_option error %#lx
\n
"
,
ret
);
ok
(
!
strcmp
(
value
,
"deadbeef"
)
||
!
strcmp
(
value
,
"deadbeef:389"
),
"got %s
\n
"
,
value
);
ldap_unbind
(
ld
);
}
START_TEST
(
parse
)
{
LDAP
*
ld
;
test_ldap_host_name
();
test_ldap_paged_search
();
test_ldap_server_control
();
test_ldap_bind_sA
();
...
...
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