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
bf6d5fc6
Commit
bf6d5fc6
authored
Mar 05, 2005
by
Troy Rollo
Committed by
Alexandre Julliard
Mar 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make GetFileSecurityW return a standard SECURITY_DESCRIPTOR instead of
an uninitialised (and invalid) one.
parent
57279184
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
2 deletions
+76
-2
security.c
dlls/advapi32/security.c
+76
-2
No files found.
dlls/advapi32/security.c
View file @
bf6d5fc6
...
...
@@ -57,6 +57,8 @@ typedef struct _ACEFLAG
DWORD
value
;
}
ACEFLAG
,
*
LPACEFLAG
;
static
SID
const
sidWorld
=
{
SID_REVISION
,
1
,
{
SECURITY_WORLD_SID_AUTHORITY
}
,
{
SECURITY_WORLD_RID
}
};
/*
* ACE access rights
*/
...
...
@@ -111,6 +113,25 @@ static void dumpLsaAttributes( PLSA_OBJECT_ATTRIBUTES oa )
}
}
#define WINE_SIZE_OF_WORLD_ACCESS_ACL (sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE) + sizeof(sidWorld) - sizeof(DWORD))
static
void
GetWorldAccessACL
(
PACL
pACL
)
{
PACCESS_ALLOWED_ACE
pACE
=
(
PACCESS_ALLOWED_ACE
)
(
pACL
+
1
);
pACL
->
AclRevision
=
ACL_REVISION
;
pACL
->
Sbz1
=
0
;
pACL
->
AclSize
=
WINE_SIZE_OF_WORLD_ACCESS_ACL
;
pACL
->
AceCount
=
1
;
pACL
->
Sbz2
=
0
;
pACE
->
Header
.
AceType
=
ACCESS_ALLOWED_ACE_TYPE
;
pACE
->
Header
.
AceFlags
=
CONTAINER_INHERIT_ACE
;
pACE
->
Header
.
AceSize
=
sizeof
(
ACCESS_ALLOWED_ACE
)
+
sizeof
(
sidWorld
)
-
sizeof
(
DWORD
);
pACE
->
Mask
=
0xf3ffffff
;
/* Everything except reserved bits */
memcpy
(
&
pACE
->
SidStart
,
&
sidWorld
,
sizeof
(
sidWorld
));
}
/************************************************************
* ADVAPI_IsLocalComputer
*
...
...
@@ -1297,8 +1318,61 @@ GetFileSecurityW( LPCWSTR lpFileName,
PSECURITY_DESCRIPTOR
pSecurityDescriptor
,
DWORD
nLength
,
LPDWORD
lpnLengthNeeded
)
{
FIXME
(
"(%s) : stub
\n
"
,
debugstr_w
(
lpFileName
)
);
return
TRUE
;
DWORD
nNeeded
;
LPBYTE
pBuffer
;
DWORD
iLocNow
;
SECURITY_DESCRIPTOR_RELATIVE
*
pSDRelative
;
FIXME
(
"(%s) : returns fake SECURITY_DESCRIPTOR
\n
"
,
debugstr_w
(
lpFileName
)
);
nNeeded
=
sizeof
(
SECURITY_DESCRIPTOR_RELATIVE
);
if
(
RequestedInformation
&
OWNER_SECURITY_INFORMATION
)
nNeeded
+=
sizeof
(
sidWorld
);
if
(
RequestedInformation
&
GROUP_SECURITY_INFORMATION
)
nNeeded
+=
sizeof
(
sidWorld
);
if
(
RequestedInformation
&
DACL_SECURITY_INFORMATION
)
nNeeded
+=
WINE_SIZE_OF_WORLD_ACCESS_ACL
;
if
(
RequestedInformation
&
SACL_SECURITY_INFORMATION
)
nNeeded
+=
WINE_SIZE_OF_WORLD_ACCESS_ACL
;
*
lpnLengthNeeded
=
nNeeded
;
if
(
nNeeded
>
nLength
)
return
TRUE
;
if
(
!
InitializeSecurityDescriptor
(
pSecurityDescriptor
,
SECURITY_DESCRIPTOR_REVISION
))
return
FALSE
;
pSDRelative
=
(
PISECURITY_DESCRIPTOR_RELATIVE
)
pSecurityDescriptor
;
pSDRelative
->
Control
|=
SE_SELF_RELATIVE
;
pBuffer
=
(
LPBYTE
)
pSDRelative
;
iLocNow
=
sizeof
(
SECURITY_DESCRIPTOR_RELATIVE
);
if
(
RequestedInformation
&
OWNER_SECURITY_INFORMATION
)
{
memcpy
(
pBuffer
+
iLocNow
,
&
sidWorld
,
sizeof
(
sidWorld
));
pSDRelative
->
Owner
=
iLocNow
;
iLocNow
+=
sizeof
(
sidWorld
);
}
if
(
RequestedInformation
&
GROUP_SECURITY_INFORMATION
)
{
memcpy
(
pBuffer
+
iLocNow
,
&
sidWorld
,
sizeof
(
sidWorld
));
pSDRelative
->
Group
=
iLocNow
;
iLocNow
+=
sizeof
(
sidWorld
);
}
if
(
RequestedInformation
&
DACL_SECURITY_INFORMATION
)
{
GetWorldAccessACL
((
PACL
)
(
pBuffer
+
iLocNow
));
pSDRelative
->
Dacl
=
iLocNow
;
iLocNow
+=
WINE_SIZE_OF_WORLD_ACCESS_ACL
;
}
if
(
RequestedInformation
&
SACL_SECURITY_INFORMATION
)
{
GetWorldAccessACL
((
PACL
)
(
pBuffer
+
iLocNow
));
pSDRelative
->
Sacl
=
iLocNow
;
/* iLocNow += WINE_SIZE_OF_WORLD_ACCESS_ACL; */
}
return
TRUE
;
}
...
...
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