Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
369da3ae
Commit
369da3ae
authored
Nov 18, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Treat an empty username as NULL in FTP_Connect().
parent
3a3b75e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
ftp.c
dlls/wininet/ftp.c
+2
-2
ftp.c
dlls/wininet/tests/ftp.c
+23
-0
No files found.
dlls/wininet/ftp.c
View file @
369da3ae
...
...
@@ -2256,7 +2256,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
assert
(
hIC
->
hdr
.
htype
==
WH_HINIT
);
if
(
NULL
==
lpszUserName
&&
NULL
!=
lpszPassword
)
if
(
(
!
lpszUserName
||
!
strlenW
(
lpszUserName
))
&&
lpszPassword
)
{
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
goto
lerror
;
...
...
@@ -2302,7 +2302,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
if
(
hIC
->
lpszProxyBypass
)
FIXME
(
"Proxy bypass is ignored.
\n
"
);
}
if
(
!
lpszUserName
)
{
if
(
!
lpszUserName
||
!
strlenW
(
lpszUserName
)
)
{
HKEY
key
;
WCHAR
szPassword
[
MAX_PATH
];
DWORD
len
=
sizeof
(
szPassword
);
...
...
dlls/wininet/tests/ftp.c
View file @
369da3ae
...
...
@@ -66,6 +66,8 @@ static void test_connect(HINTERNET hInternet)
* anonymous : NULL
* NULL : IEUser@
* NULL : NULL
* "" : IEUser@
* "" : NULL
*/
SetLastError
(
0xdeadbeef
);
...
...
@@ -85,6 +87,13 @@ static void test_connect(HINTERNET hInternet)
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hFtp
=
InternetConnect
(
hInternet
,
"ftp.winehq.org"
,
INTERNET_DEFAULT_FTP_PORT
,
""
,
"IEUser@"
,
INTERNET_SERVICE_FTP
,
INTERNET_FLAG_PASSIVE
,
0
);
ok
(
!
hFtp
,
"Expected InternetConnect to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
/* Using a NULL username and password will be interpreted as anonymous ftp. The username will be 'anonymous' the password
* is created via some simple heuristics (see dlls/wininet/ftp.c).
* On Wine this registry key is not set by default so (NULL, NULL) will result in anonymous ftp with an (most likely) not
...
...
@@ -103,6 +112,20 @@ static void test_connect(HINTERNET hInternet)
ok
(
hFtp
!=
NULL
,
"InternetConnect failed : %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"ERROR_SUCCESS, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hFtp
=
InternetConnect
(
hInternet
,
"ftp.winehq.org"
,
INTERNET_DEFAULT_FTP_PORT
,
""
,
NULL
,
INTERNET_SERVICE_FTP
,
INTERNET_FLAG_PASSIVE
,
0
);
if
(
!
hFtp
)
{
ok
(
GetLastError
()
==
ERROR_INTERNET_LOGIN_FAILURE
,
"Expected ERROR_INTERNET_LOGIN_FAILURE, got %d
\n
"
,
GetLastError
());
}
else
{
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
GetLastError
());
}
}
static
void
test_createdir
(
HINTERNET
hFtp
,
HINTERNET
hConnect
)
...
...
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