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
261bf8da
Commit
261bf8da
authored
Jan 22, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Jan 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add more tests for SetEntriesInAcl.
parent
a76abc03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
3 deletions
+87
-3
security.c
dlls/advapi32/tests/security.c
+87
-3
No files found.
dlls/advapi32/tests/security.c
View file @
261bf8da
...
...
@@ -1973,8 +1973,13 @@ static void test_impersonation_level(void)
static
void
test_SetEntriesInAcl
(
void
)
{
ACL
*
acl
=
(
ACL
*
)
0xdeadbeef
;
DWORD
res
;
PSID
EveryoneSid
=
NULL
,
UsersSid
=
NULL
;
PACL
OldAcl
=
NULL
,
NewAcl
;
SID_IDENTIFIER_AUTHORITY
SIDAuthWorld
=
{
SECURITY_WORLD_SID_AUTHORITY
};
SID_IDENTIFIER_AUTHORITY
SIDAuthNT
=
{
SECURITY_NT_AUTHORITY
};
EXPLICIT_ACCESSW
ExplicitAccess
;
static
const
WCHAR
wszEveryone
[]
=
{
'E'
,
'v'
,
'e'
,
'r'
,
'y'
,
'o'
,
'n'
,
'e'
,
0
};
if
(
!
pSetEntriesInAclW
)
{
...
...
@@ -1982,14 +1987,93 @@ static void test_SetEntriesInAcl(void)
return
;
}
res
=
pSetEntriesInAclW
(
0
,
NULL
,
NULL
,
&
acl
);
NewAcl
=
(
PACL
)
0xdeadbeef
;
res
=
pSetEntriesInAclW
(
0
,
NULL
,
NULL
,
&
NewAcl
);
if
(
res
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
skip
(
"SetEntriesInAclW is not implemented
\n
"
);
return
;
}
ok
(
res
==
ERROR_SUCCESS
,
"SetEntriesInAclW failed: %u
\n
"
,
res
);
ok
(
acl
==
NULL
,
"acl=%p, expected NULL
\n
"
,
acl
);
ok
(
NewAcl
==
NULL
,
"NewAcl=%p, expected NULL
\n
"
,
NewAcl
);
OldAcl
=
HeapAlloc
(
GetProcessHeap
(),
0
,
256
);
res
=
InitializeAcl
(
OldAcl
,
256
,
ACL_REVISION
);
if
(
!
res
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
skip
(
"ACLs not implemented - skipping tests
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
OldAcl
);
return
;
}
ok
(
res
,
"InitializeAcl failed with error %d
\n
"
,
GetLastError
());
res
=
AllocateAndInitializeSid
(
&
SIDAuthWorld
,
1
,
SECURITY_WORLD_RID
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
&
EveryoneSid
);
ok
(
res
,
"AllocateAndInitializeSid failed with error %d
\n
"
,
GetLastError
());
res
=
AllocateAndInitializeSid
(
&
SIDAuthNT
,
2
,
SECURITY_BUILTIN_DOMAIN_RID
,
DOMAIN_ALIAS_RID_USERS
,
0
,
0
,
0
,
0
,
0
,
0
,
&
UsersSid
);
ok
(
res
,
"AllocateAndInitializeSid failed with error %d
\n
"
,
GetLastError
());
res
=
AddAccessAllowedAce
(
OldAcl
,
ACL_REVISION
,
KEY_READ
,
UsersSid
);
ok
(
res
,
"AddAccessAllowedAce failed with error %d
\n
"
,
GetLastError
());
ExplicitAccess
.
grfAccessPermissions
=
KEY_WRITE
;
ExplicitAccess
.
grfAccessMode
=
GRANT_ACCESS
;
ExplicitAccess
.
grfInheritance
=
NO_INHERITANCE
;
ExplicitAccess
.
Trustee
.
pMultipleTrustee
=
NULL
;
ExplicitAccess
.
Trustee
.
MultipleTrusteeOperation
=
NO_MULTIPLE_TRUSTEE
;
ExplicitAccess
.
Trustee
.
TrusteeForm
=
TRUSTEE_IS_SID
;
ExplicitAccess
.
Trustee
.
TrusteeType
=
TRUSTEE_IS_UNKNOWN
;
ExplicitAccess
.
Trustee
.
ptstrName
=
(
LPWSTR
)
EveryoneSid
;
res
=
pSetEntriesInAclW
(
1
,
&
ExplicitAccess
,
OldAcl
,
&
NewAcl
);
ok
(
res
==
ERROR_SUCCESS
,
"SetEntriesInAclW failed: %u
\n
"
,
res
);
todo_wine
ok
(
NewAcl
!=
NULL
,
"returned acl was NULL
\n
"
);
LocalFree
(
NewAcl
);
ExplicitAccess
.
Trustee
.
TrusteeForm
=
TRUSTEE_IS_USER
;
ExplicitAccess
.
Trustee
.
ptstrName
=
(
LPWSTR
)
wszEveryone
;
res
=
pSetEntriesInAclW
(
1
,
&
ExplicitAccess
,
OldAcl
,
&
NewAcl
);
ok
(
res
==
ERROR_SUCCESS
,
"SetEntriesInAclW failed: %u
\n
"
,
res
);
todo_wine
ok
(
NewAcl
!=
NULL
,
"returned acl was NULL
\n
"
);
LocalFree
(
NewAcl
);
ExplicitAccess
.
Trustee
.
TrusteeForm
=
TRUSTEE_BAD_FORM
;
res
=
pSetEntriesInAclW
(
1
,
&
ExplicitAccess
,
OldAcl
,
&
NewAcl
);
todo_wine
ok
(
res
==
ERROR_INVALID_PARAMETER
,
"SetEntriesInAclW failed: %u
\n
"
,
res
);
ok
(
NewAcl
==
NULL
,
"returned acl wasn't NULL: %p
\n
"
,
NewAcl
);
LocalFree
(
NewAcl
);
ExplicitAccess
.
Trustee
.
TrusteeForm
=
TRUSTEE_IS_USER
;
ExplicitAccess
.
Trustee
.
MultipleTrusteeOperation
=
TRUSTEE_IS_IMPERSONATE
;
res
=
pSetEntriesInAclW
(
1
,
&
ExplicitAccess
,
OldAcl
,
&
NewAcl
);
todo_wine
ok
(
res
==
ERROR_INVALID_PARAMETER
,
"SetEntriesInAclW failed: %u
\n
"
,
res
);
ok
(
NewAcl
==
NULL
,
"returned acl wasn't NULL: %p
\n
"
,
NewAcl
);
LocalFree
(
NewAcl
);
ExplicitAccess
.
Trustee
.
MultipleTrusteeOperation
=
NO_MULTIPLE_TRUSTEE
;
ExplicitAccess
.
grfAccessMode
=
SET_ACCESS
;
res
=
pSetEntriesInAclW
(
1
,
&
ExplicitAccess
,
OldAcl
,
&
NewAcl
);
ok
(
res
==
ERROR_SUCCESS
,
"SetEntriesInAclW failed: %u
\n
"
,
res
);
todo_wine
ok
(
NewAcl
!=
NULL
,
"returned acl was NULL
\n
"
);
LocalFree
(
NewAcl
);
ExplicitAccess
.
grfAccessMode
=
REVOKE_ACCESS
;
ExplicitAccess
.
Trustee
.
TrusteeForm
=
TRUSTEE_IS_SID
;
ExplicitAccess
.
Trustee
.
ptstrName
=
(
LPWSTR
)
UsersSid
;
res
=
pSetEntriesInAclW
(
1
,
&
ExplicitAccess
,
OldAcl
,
&
NewAcl
);
ok
(
res
==
ERROR_SUCCESS
,
"SetEntriesInAclW failed: %u
\n
"
,
res
);
todo_wine
ok
(
NewAcl
!=
NULL
,
"returned acl was NULL
\n
"
);
LocalFree
(
NewAcl
);
LocalFree
(
UsersSid
);
LocalFree
(
EveryoneSid
);
HeapFree
(
GetProcessHeap
(),
0
,
OldAcl
);
}
static
void
test_GetNamedSecurityInfoA
(
void
)
...
...
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