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
9ab98868
Commit
9ab98868
authored
Mar 24, 2007
by
Kai Blin
Committed by
Alexandre Julliard
Mar 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32/test: Test the username and password length limits.
parent
47aaf09d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
5 deletions
+43
-5
access.c
dlls/netapi32/tests/access.c
+43
-5
No files found.
dlls/netapi32/tests/access.c
View file @
9ab98868
...
...
@@ -38,9 +38,24 @@ static const WCHAR sAdminUserName[] = {'A','d','m','i','n','i','s','t','r','a','
static
const
WCHAR
sGuestUserName
[]
=
{
'G'
,
'u'
,
'e'
,
's'
,
't'
,
0
};
static
const
WCHAR
sNonexistentUser
[]
=
{
'N'
,
'o'
,
'n'
,
'e'
,
'x'
,
'i'
,
's'
,
't'
,
'e'
,
'n'
,
't'
,
' '
,
'U'
,
's'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
sTestUserName
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'u'
,
's'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
sTestUserOldPass
[]
=
{
'o'
,
'l'
,
'd'
,
'p'
,
'a'
,
's'
,
's'
,
0
};
static
const
WCHAR
sTestUserNewPass
[]
=
{
'n'
,
'e'
,
'w'
,
'p'
,
'a'
,
's'
,
's'
,
0
};
static
WCHAR
sTooLongName
[]
=
{
'T'
,
'h'
,
'i'
,
's'
,
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};
...
...
@@ -192,14 +207,37 @@ static void run_userhandling_tests(void)
NET_API_STATUS
ret
;
USER_INFO_1
usri
;
usri
.
usri1_name
=
(
LPWSTR
)
sTestUserName
;
usri
.
usri1_password
=
(
LPWSTR
)
sTestUserOldPass
;
usri
.
usri1_priv
=
USER_PRIV_USER
;
usri
.
usri1_home_dir
=
NULL
;
usri
.
usri1_comment
=
NULL
;
usri
.
usri1_flags
=
UF_SCRIPT
;
usri
.
usri1_script_path
=
NULL
;
usri
.
usri1_name
=
sTooLongName
;
usri
.
usri1_password
=
sTestUserOldPass
;
ret
=
pNetUserAdd
(
NULL
,
1
,
(
LPBYTE
)
&
usri
,
NULL
);
todo_wine
ok
(
ret
==
NERR_BadUsername
,
"Adding user with too long username returned 0x%08x
\n
"
,
ret
);
usri
.
usri1_name
=
sTestUserName
;
usri
.
usri1_password
=
sTooLongPassword
;
ret
=
pNetUserAdd
(
NULL
,
1
,
(
LPBYTE
)
&
usri
,
NULL
);
todo_wine
ok
(
ret
==
NERR_PasswordTooShort
,
"Adding user with too long password returned 0x%08x
\n
"
,
ret
);
usri
.
usri1_name
=
sTooLongName
;
usri
.
usri1_password
=
sTooLongPassword
;
ret
=
pNetUserAdd
(
NULL
,
1
,
(
LPBYTE
)
&
usri
,
NULL
);
todo_wine
ok
(
ret
==
NERR_BadUsername
,
"Adding user with too long username/password returned 0x%08x
\n
"
,
ret
);
usri
.
usri1_name
=
sTestUserName
;
usri
.
usri1_password
=
sTestUserOldPass
;
ret
=
pNetUserAdd
(
NULL
,
5
,
(
LPBYTE
)
&
usri
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_INVALID_LEVEL
,
"Adding user with level 5 returned 0x%08x
\n
"
,
ret
);
ret
=
pNetUserAdd
(
NULL
,
1
,
(
LPBYTE
)
&
usri
,
NULL
);
if
(
ret
==
ERROR_ACCESS_DENIED
)
{
...
...
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