This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git

commit 5616a3138b1d609997a9a96fffd6ff2fdf24a730
Author: Mark Thomas <[email protected]>
AuthorDate: Thu May 23 21:55:18 2019 +0100

    Change the default procrun service user from LocalSystem to LocalService
    
    LocalSystem is effectively a local administrator whereas LocalService
    has significantly reduced priviledges.
---
 src/changes/changes.xml          | 4 ++++
 src/native/windows/src/service.c | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 1b6cd5a..e089a82 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -100,6 +100,10 @@
         Procrun. Add 'NT Authority\LocalService' and
         'NT Authority\NetworkService' as options to the Log On user interface.
       </action>
+      <action type="update" dev="markt">
+        Procrun. Change the default service user from LocalSystem to
+        'NT Authority\LocalService'.
+      </action>
     </release>
     <release version="1.1.0" date="2017-11-15" description="Feature and bug 
fix release">
       <action issue="DAEMON-368" type="add" dev="ggregory">
diff --git a/src/native/windows/src/service.c b/src/native/windows/src/service.c
index c8c0a3e..d775253 100644
--- a/src/native/windows/src/service.c
+++ b/src/native/windows/src/service.c
@@ -517,9 +517,9 @@ apxServiceControl(APXHANDLE hService, DWORD dwControl, UINT 
uMsg,
         if (stStatus.dwCurrentState == dwState) {
             return TRUE;
         } else {
-            apxLogWrite(APXLOG_MARK_ERROR 
+            apxLogWrite(APXLOG_MARK_ERROR
                 "apxServiceControl(): dwState(%d) != dwCurrentState(%d); "
-                "dwWin32ExitCode = %d, dwWaitHint = %d, 
dwServiceSpecificExitCode = %d", 
+                "dwWin32ExitCode = %d, dwWaitHint = %d, 
dwServiceSpecificExitCode = %d",
                 dwState,
                 stStatus.dwCurrentState,
                 stStatus.dwWin32ExitCode,
@@ -579,7 +579,7 @@ apxServiceInstall(APXHANDLE hService, LPCWSTR szServiceName,
                                          NULL,
                                          NULL,
                                          lpDependencies,
-                                         NULL,
+                                         L"NT Authority\\LocalService",
                                          NULL);
 
     if (IS_INVALID_HANDLE(lpService->hService)) {

Reply via email to