mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
launcher: named pipe SDDL
This commit is contained in:
parent
da839e39b8
commit
a81a766bbe
@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include <launcher/launcher.h>
|
||||
#include <sddl.h>
|
||||
|
||||
#define PROGNAME "WinFsp-Launcher"
|
||||
#define REGKEY "SYSTEM\\CurrentControlSet\\Services\\" PROGNAME "\\Services"
|
||||
@ -356,8 +357,16 @@ static VOID SvcPipeTransact(PWSTR PipeBuf, PULONG PSize);
|
||||
|
||||
static NTSTATUS SvcStart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
|
||||
{
|
||||
SECURITY_ATTRIBUTES SecurityAttributes = { 0 };
|
||||
|
||||
InitializeCriticalSection(&SvcInstanceLock);
|
||||
|
||||
SecurityAttributes.nLength = sizeof SecurityAttributes;
|
||||
SecurityAttributes.bInheritHandle = FALSE;
|
||||
if (!ConvertStringSecurityDescriptorToSecurityDescriptorW(L"" PIPE_SDDL, SDDL_REVISION_1,
|
||||
&SecurityAttributes.lpSecurityDescriptor, 0))
|
||||
goto fail;
|
||||
|
||||
SvcEvent = CreateEventW(0, TRUE, FALSE, 0);
|
||||
if (0 == SvcEvent)
|
||||
goto fail;
|
||||
@ -378,6 +387,8 @@ static NTSTATUS SvcStart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
|
||||
if (0 == SvcThread)
|
||||
goto fail;
|
||||
|
||||
LocalFree(SecurityAttributes.lpSecurityDescriptor);
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
fail:
|
||||
@ -395,6 +406,8 @@ fail:
|
||||
if (0 != SvcEvent)
|
||||
CloseHandle(SvcEvent);
|
||||
|
||||
LocalFree(SecurityAttributes.lpSecurityDescriptor);
|
||||
|
||||
DeleteCriticalSection(&SvcInstanceLock);
|
||||
|
||||
return FspNtStatusFromWin32(LastError);
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <shared/minimal.h>
|
||||
|
||||
#define PIPE_NAME "\\\\.\\pipe\\WinFsp.{14E7137D-22B4-437A-B0C1-D21D1BDF3767}"
|
||||
#define PIPE_SDDL "O:SYG:SYD:P(A;;GA;;;WD)"
|
||||
#define PIPE_BUFFER_SIZE 2048
|
||||
#define PIPE_DEFAULT_TIMEOUT 3000
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user