Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package apache-commons-daemon for 
openSUSE:Factory checked in at 2023-05-04 17:10:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/apache-commons-daemon (Old)
 and      /work/SRC/openSUSE:Factory/.apache-commons-daemon.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "apache-commons-daemon"

Thu May  4 17:10:03 2023 rev:22 rq:1084292 version:1.3.3

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/apache-commons-daemon/apache-commons-daemon.changes  
    2022-10-25 13:40:19.922636424 +0200
+++ 
/work/SRC/openSUSE:Factory/.apache-commons-daemon.new.1533/apache-commons-daemon.changes
    2023-05-04 17:10:14.384247344 +0200
@@ -1,0 +2,15 @@
+Wed May  3 07:07:37 UTC 2023 - Pedro Monreal <pmonr...@suse.com>
+
+- Update to 1.3.3:
+  * Fixes:
+    - Procrun. Follow-up to ensure all child processes are cleaned
+      up if the service does not stop cleanly.
+    - Procrun. Fix creation of duplicate ACL entries on some
+      Windows platforms.
+  * Updates:
+    - Bump actions/cache from 3.0.8 to 3.0.11.
+    - Bump actions/checkout from 3.0.2 to 3.1.0.
+    - Bump actions/setup-java from 3.5.1 to 3.6.0.
+    - Bump spotbugs-maven-plugin from 4.7.2.0 to 4.7.3.0.
+
+-------------------------------------------------------------------

Old:
----
  commons-daemon-1.3.2-src.tar.gz
  commons-daemon-1.3.2-src.tar.gz.asc

New:
----
  commons-daemon-1.3.3-src.tar.gz
  commons-daemon-1.3.3-src.tar.gz.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ apache-commons-daemon.spec ++++++
--- /var/tmp/diff_new_pack.4cpyBh/_old  2023-05-04 17:10:14.936250576 +0200
+++ /var/tmp/diff_new_pack.4cpyBh/_new  2023-05-04 17:10:14.940250599 +0200
@@ -1,7 +1,7 @@
 #
 # spec file
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %{!?make_build:%global make_build make %{?_smp_mflags}}
 %define short_name commons-daemon
 Name:           apache-%{short_name}
-Version:        1.3.2
+Version:        1.3.3
 Release:        0
 Summary:        Commons Daemon - Controlling of Java Daemons
 License:        Apache-2.0

++++++ apache-commons-daemon-build.xml ++++++
--- /var/tmp/diff_new_pack.4cpyBh/_old  2023-05-04 17:10:14.976250810 +0200
+++ /var/tmp/diff_new_pack.4cpyBh/_new  2023-05-04 17:10:14.976250810 +0200
@@ -5,7 +5,7 @@
 
     <property name="project.groupId" value="commons-daemon" />
     <property name="project.artifactId" value="commons-daemon" />
-    <property name="project.version" value="1.3.2" />
+    <property name="project.version" value="1.3.3" />
 
     <property name="compiler.source" value="1.8" />
     <property name="compiler.target" value="${compiler.source}" />

++++++ commons-daemon-1.3.2-src.tar.gz -> commons-daemon-1.3.3-src.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commons-daemon-1.3.2-src/README.md 
new/commons-daemon-1.3.3-src/README.md
--- old/commons-daemon-1.3.2-src/README.md      2022-09-18 15:49:41.000000000 
+0200
+++ new/commons-daemon-1.3.3-src/README.md      2022-09-18 15:49:41.000000000 
+0200
@@ -43,11 +43,12 @@
 Apache Commons Daemon
 ===================
 
-[![Travis-CI 
Status](https://travis-ci.org/apache/commons-daemon.svg)](https://travis-ci.org/apache/commons-daemon)
 [![GitHub Actions 
Status](https://github.com/apache/commons-daemon/workflows/Java%20CI/badge.svg)](https://github.com/apache/commons-daemon/actions)
-[![Coverage 
Status](https://coveralls.io/repos/apache/commons-daemon/badge.svg)](https://coveralls.io/r/apache/commons-daemon)
+[![Coverage 
Status](https://codecov.io/gh/apache/commons-daemon/branch/master/graph/badge.svg)](https://app.codecov.io/gh/apache/commons-daemon)
 [![Maven 
Central](https://maven-badges.herokuapp.com/maven-central/commons-daemon/commons-daemon/badge.svg)](https://maven-badges.herokuapp.com/maven-central/commons-daemon/commons-daemon/)
 
[![Javadocs](https://javadoc.io/badge/commons-daemon/commons-daemon/1.3.2.svg)](https://javadoc.io/doc/commons-daemon/commons-daemon/1.3.2)
+[![CodeQL](https://github.com/apache/commons-daemon/workflows/CodeQL%20CPP/badge.svg)](https://github.com/apache/commons-daemon/actions/workflows/codeql-analysis-cpp.yml?query=workflow%3ACodeQL)
+[![CodeQL](https://github.com/apache/commons-daemon/workflows/CodeQL%20Java/badge.svg)](https://github.com/apache/commons-daemon/actions/workflows/codeql-analysis-java.yml?query=workflow%3ACodeQL)
 
 Apache Commons Daemon software is a set of utilities and Java support
     classes for running Java applications as server processes. These are
@@ -71,7 +72,7 @@
 <dependency>
   <groupId>commons-daemon</groupId>
   <artifactId>commons-daemon</artifactId>
-  <version>1.3.2</version>
+  <version>1.3.3</version>
 </dependency>
 ```
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commons-daemon-1.3.2-src/RELEASE-NOTES.txt 
new/commons-daemon-1.3.3-src/RELEASE-NOTES.txt
--- old/commons-daemon-1.3.2-src/RELEASE-NOTES.txt      2022-09-18 
15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/RELEASE-NOTES.txt      2022-09-18 
15:49:41.000000000 +0200
@@ -15,7 +15,7 @@
   limitations under the License.
 
================================================================================
 
-                   Apache Commons Daemon 1.3.2
+                   Apache Commons Daemon 1.3.3
                          Release Notes
 
 This document contains the release notes for this version of the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commons-daemon-1.3.2-src/pom.xml 
new/commons-daemon-1.3.3-src/pom.xml
--- old/commons-daemon-1.3.2-src/pom.xml        2022-09-18 15:49:41.000000000 
+0200
+++ new/commons-daemon-1.3.3-src/pom.xml        2022-09-18 15:49:41.000000000 
+0200
@@ -27,7 +27,7 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>commons-daemon</groupId>
   <artifactId>commons-daemon</artifactId>
-  <version>1.3.2</version>
+  <version>1.3.3</version>
   <name>Apache Commons Daemon</name>
   <!-- Daemon started in Commons in 2002 with an import of code from Tomcat,
        which is why the NOTICE file has an earlier date than the inceptionYear 
-->
@@ -114,8 +114,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.junit.vintage</groupId>
-      <artifactId>junit-vintage-engine</artifactId>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter</artifactId>
       <scope>test</scope>
     </dependency>
   </dependencies>
@@ -131,15 +131,15 @@
     
<maven.compiler.target>${commons.daemon.javaversion}</maven.compiler.target>
     <commons.componentid>daemon</commons.componentid>
     <commons.module.name>org.apache.commons.daemon</commons.module.name>
-    <commons.release.version>1.3.2</commons.release.version>
+    <commons.release.version>1.3.3</commons.release.version>
     <commons.rc.version>RC1</commons.rc.version>
-    <commons.bc.version>1.3.1</commons.bc.version>
+    <commons.bc.version>1.3.2</commons.bc.version>
     <commons.jira.id>DAEMON</commons.jira.id>
     <commons.jira.pid>12310468</commons.jira.pid>
     <commons.junit.version>5.9.1</commons.junit.version>
     <commons.jacoco.version>0.8.8</commons.jacoco.version>
     <commons.japicmp.version>0.16.0</commons.japicmp.version>
-    <commons.spotbugs.version>4.7.2.0</commons.spotbugs.version>
+    <commons.spotbugs.version>4.7.3.0</commons.spotbugs.version>
   </properties>
 
   <profiles>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commons-daemon-1.3.2-src/src/changes/changes.xml 
new/commons-daemon-1.3.3-src/src/changes/changes.xml
--- old/commons-daemon-1.3.2-src/src/changes/changes.xml        2022-09-18 
15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/changes/changes.xml        2022-09-18 
15:49:41.000000000 +0200
@@ -38,6 +38,21 @@
     <title>Apache Commons Daemon Release Notes</title>
   </properties>
   <body>
+    <release version="1.3.3" date="2022-11-28" description="Bug fix release">
+      <!-- Fix -->
+      <action issue="DAEMON-450" type="fix" dev="markt" due-to="Norimasa 
Yamamoto">
+        Procrun. Fix creation of duplicate ACL entries on some Windows 
platforms.
+      </action>
+      <action type="fix" due-to="jfclere" dev="markt">
+        Procrun. Follow-up to ensure all child processes are cleaned up if the
+        service does not stop cleanly. #64
+      </action>
+      <!-- UPDATES -->
+      <action type="update" dev="ggregory" due-to="Dependabot">Bump 
actions/cache from 3.0.8 to 3.0.11 #60.</action>
+      <action type="update" dev="ggregory" due-to="Dependabot">Bump 
actions/checkout from 3.0.2 to 3.1.0 #59.</action>
+      <action type="update" dev="ggregory" due-to="Dependabot">Bump 
actions/setup-java from 3.5.1 to 3.6.0 #63.</action>
+      <action type="update" dev="ggregory" due-to="Dependabot">Bump 
spotbugs-maven-plugin from 4.7.2.0 to 4.7.3.0 #61, #66.</action>
+    </release>
     <release version="1.3.2" date="2022-10-10" description="Bug fix release">
       <!-- Fix -->
       <action type="fix" dev="markt">
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/unix/man/jsvc.1.xml 
new/commons-daemon-1.3.3-src/src/native/unix/man/jsvc.1.xml
--- old/commons-daemon-1.3.2-src/src/native/unix/man/jsvc.1.xml 2022-09-18 
15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/unix/man/jsvc.1.xml 2022-09-18 
15:49:41.000000000 +0200
@@ -21,8 +21,8 @@
   <refmeta>
     <refentrytitle>JSVC</refentrytitle>
     <manvolnum>1</manvolnum>
-    <refmiscinfo class='date'>2022-10-10</refmiscinfo>
-    <refmiscinfo class='source'>Jsvc version 1.3.2</refmiscinfo>
+    <refmiscinfo class='date'>2022-11-28</refmiscinfo>
+    <refmiscinfo class='source'>Jsvc version 1.3.3</refmiscinfo>
     <refmiscinfo class='manual'>Apache Commons Daemon project</refmiscinfo>
   </refmeta>
   <refnamediv id='name'>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/unix/native/version.h 
new/commons-daemon-1.3.3-src/src/native/unix/native/version.h
--- old/commons-daemon-1.3.2-src/src/native/unix/native/version.h       
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/unix/native/version.h       
2022-09-18 15:49:41.000000000 +0200
@@ -31,7 +31,7 @@
 #define JSVC_MINOR_VERSION      3
 
 /** patch level */
-#define JSVC_PATCH_VERSION      2
+#define JSVC_PATCH_VERSION      3
 
 /**
  *  This symbol is defined for internal, "development" copies of JSVC.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/windows/apps/prunmgr/prunmgr.h 
new/commons-daemon-1.3.3-src/src/native/windows/apps/prunmgr/prunmgr.h
--- old/commons-daemon-1.3.2-src/src/native/windows/apps/prunmgr/prunmgr.h      
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/windows/apps/prunmgr/prunmgr.h      
2022-09-18 15:49:41.000000000 +0200
@@ -24,7 +24,7 @@
 #define _PRUNMGR_H
 
 #undef  PRG_VERSION
-#define PRG_VERSION    "1.3.2.0"
+#define PRG_VERSION    "1.3.3.0"
 #define PRG_REGROOT   L"Apache Software Foundation\\Procrun 2.0"
 
 #define IDM_TM_EXIT                     2000
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/windows/apps/prunmgr/prunmgr.rc 
new/commons-daemon-1.3.3-src/src/native/windows/apps/prunmgr/prunmgr.rc
--- old/commons-daemon-1.3.2-src/src/native/windows/apps/prunmgr/prunmgr.rc     
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/windows/apps/prunmgr/prunmgr.rc     
2022-09-18 15:49:41.000000000 +0200
@@ -228,7 +228,7 @@
 STRINGTABLE
 BEGIN
     IDS_APPLICATION     RSTR_PSM
-    IDS_APPVERSION      "Version 1.3.2"
+    IDS_APPVERSION      "Version 1.3.3"
     IDS_APPFULLNAME     RSTR_PSM " Version " PRG_VERSION
     IDS_APPCOPYRIGHT    "Copyright (c) 2000-2022 The Apache Software 
Foundation"
     IDS_APPDESCRIPTION  "Apache Commons Daemon Service Management Tool"
@@ -259,8 +259,8 @@
 END
 
 1 VERSIONINFO
- FILEVERSION 1,3,2,0
- PRODUCTVERSION 1,3,2,0
+ FILEVERSION 1,3,3,0
+ PRODUCTVERSION 1,3,3,0
  FILEFLAGSMASK 0x3fL
 #if defined(_DEBUG)
  FILEFLAGS 0x03L
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/windows/apps/prunsrv/prunsrv.c 
new/commons-daemon-1.3.3-src/src/native/windows/apps/prunsrv/prunsrv.c
--- old/commons-daemon-1.3.2-src/src/native/windows/apps/prunsrv/prunsrv.c      
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/windows/apps/prunsrv/prunsrv.c      
2022-09-18 15:49:41.000000000 +0200
@@ -229,6 +229,8 @@
 static BOOL                  _java_startup  = FALSE;
 /* Java used for shutdown    */
 static BOOL                  _java_shutdown = FALSE;
+/* We have request to shutdown the exe running */
+static BOOL                  _exe_shutdown = FALSE;
 /* Global variables and objects */
 static APXHANDLE    gPool;
 static APXHANDLE    gWorker;
@@ -1606,6 +1608,7 @@
             apxLogWrite(APXLOG_MARK_INFO "Service SHUTDOWN signalled.");
         case SERVICE_CONTROL_STOP:
             apxLogWrite(APXLOG_MARK_INFO "Service SERVICE_CONTROL_STOP 
signalled.");
+            _exe_shutdown = TRUE;
             if (SO_STOPTIMEOUT > 0) {
                 reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 
SO_STOPTIMEOUT * 1000);
             }
@@ -1834,7 +1837,17 @@
         /* Set console handler to capture CTRL events */
         SetConsoleCtrlHandler((PHANDLER_ROUTINE)console_handler, TRUE);
 
-        apxHandleWait(gWorker, INFINITE, FALSE);
+        if (SO_STOPTIMEOUT) {
+            /* we have a stop timeout */
+           do {
+                /* wait 2 seconds */
+                apxHandleWait(gWorker, 2000, FALSE);
+            } while (!_exe_shutdown);
+            apxLogWrite(APXLOG_MARK_DEBUG "waiting %d sec... shutdown: %d", 
SO_STOPTIMEOUT, _exe_shutdown);
+            apxHandleWait(gWorker, SO_STOPTIMEOUT*1000, FALSE);
+       } else {
+             apxHandleWait(gWorker, INFINITE, FALSE);
+       }
         apxLogWrite(APXLOG_MARK_DEBUG "Worker finished.");
     }
     else {
@@ -1856,6 +1869,8 @@
         apxLogWrite(APXLOG_MARK_DEBUG "Waiting 1 minute for all threads to 
exit.");
         reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, ONE_MINUTE);
         apxDestroyJvm(ONE_MINUTE);
+        /* if we are not using JAVA apxDestroyJvm does nothing, check the chid 
processes in case they hang */
+        apxProcessTerminateChild( GetCurrentProcessId(), FALSE); /* FALSE 
kills! */
     }
     else {
         /* We came here without shutdown event
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/windows/apps/prunsrv/prunsrv.h 
new/commons-daemon-1.3.3-src/src/native/windows/apps/prunsrv/prunsrv.h
--- old/commons-daemon-1.3.2-src/src/native/windows/apps/prunsrv/prunsrv.h      
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/windows/apps/prunsrv/prunsrv.h      
2022-09-18 15:49:41.000000000 +0200
@@ -25,7 +25,7 @@
 #define _PRUNSRV_H
 
 #undef  PRG_VERSION
-#define PRG_VERSION    "1.3.2.0"
+#define PRG_VERSION    "1.3.3.0"
 #define PRG_REGROOT   L"Apache Software Foundation\\Procrun 2.0"
 
 #endif /* _PRUNSRV_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/windows/apps/prunsrv/prunsrv.rc 
new/commons-daemon-1.3.3-src/src/native/windows/apps/prunsrv/prunsrv.rc
--- old/commons-daemon-1.3.2-src/src/native/windows/apps/prunsrv/prunsrv.rc     
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/windows/apps/prunsrv/prunsrv.rc     
2022-09-18 15:49:41.000000000 +0200
@@ -23,8 +23,8 @@
 CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "prunsrv.manifest"
 
 1 VERSIONINFO
- FILEVERSION 1,3,2,0
- PRODUCTVERSION 1,3,2,0
+ FILEVERSION 1,3,3,0
+ PRODUCTVERSION 1,3,3,0
  FILEFLAGSMASK 0x3fL
 #if defined(_DEBUG)
  FILEFLAGS 0x03L
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/windows/include/rprocess.h 
new/commons-daemon-1.3.3-src/src/native/windows/include/rprocess.h
--- old/commons-daemon-1.3.2-src/src/native/windows/include/rprocess.h  
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/windows/include/rprocess.h  
2022-09-18 15:49:41.000000000 +0200
@@ -45,6 +45,8 @@
 BOOL        apxProcessRunning(APXHANDLE hProcess);
 DWORD       apxProcessGetPid(APXHANDLE hProcess);
 
+BOOL apxProcessTerminateChild(DWORD dwProcessId, BOOL dryrun);
+
 
 __APXEND_DECLS
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/windows/src/rprocess.c 
new/commons-daemon-1.3.3-src/src/native/windows/src/rprocess.c
--- old/commons-daemon-1.3.2-src/src/native/windows/src/rprocess.c      
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/windows/src/rprocess.c      
2022-09-18 15:49:41.000000000 +0200
@@ -300,14 +300,79 @@
 
     return rv;
 }
+/* Check if the process is already in the process list */
+static  BOOL __apxProcessisNotinTree(DWORD *treeProcessId, DWORD curProcessId, 
int n) {
+    int i;
+    for (i=0; i<n; i++) {
+        if (treeProcessId[i] == curProcessId) {
+            return FALSE;
+        }
+    }
+    return TRUE;
+}
+/* Add the process to the process list */
+static  BOOL __apxProcessaddToTree(DWORD *treeProcessId, DWORD curProcessId, 
int n) {
+    int i;
+    for (i=0; i<n; i++) {
+        if (treeProcessId[i] == 0) {
+            treeProcessId[i] = curProcessId;
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
+/* Build a process list to kill or list for debugging */
+static  BOOL __apxProcessGetTree(DWORD dwProcessId, HANDLE hProcessSnap,  
DWORD *treeProcessId, int maxProcessId) {
+    for (;;) {
+        BOOL add = FALSE;
+        PROCESSENTRY32 pe32;
+        // Set the size of the structure before using it.
+        pe32.dwSize = sizeof(PROCESSENTRY32);
+        // Retrieve information about the first process,
+        // and return if unsuccessful
+        if(!Process32First(hProcessSnap, &pe32 )) {
+            apxLogWrite(APXLOG_MARK_DEBUG "Process32First failed time for %d", 
dwProcessId);
+            CloseHandle(hProcessSnap);          // clean the snapshot object
+            return(FALSE);
+        }
+        for (;;) {
+            if (pe32.th32ParentProcessID == dwProcessId) {
+                if (__apxProcessisNotinTree(treeProcessId,  
pe32.th32ProcessID, maxProcessId)) {
+                    apxLogWrite(APXLOG_MARK_DEBUG "PROCESS NAME:  %S", 
pe32.szExeFile);
+
+                    apxLogWrite(APXLOG_MARK_DEBUG "Process ID        = 0x%08X 
(%d)", pe32.th32ProcessID,  pe32.th32ProcessID);
+                    apxLogWrite(APXLOG_MARK_DEBUG "Thread count      = %d",   
pe32.cntThreads);
+                    apxLogWrite(APXLOG_MARK_DEBUG "Parent process ID = 0x%08X 
(%d)", pe32.th32ParentProcessID, pe32.th32ParentProcessID);
+                    apxLogWrite(APXLOG_MARK_DEBUG "Priority base     = %d", 
pe32.pcPriClassBase);
+                    __apxProcessGetTree( pe32.th32ProcessID, hProcessSnap,  
treeProcessId, maxProcessId);
+                    __apxProcessaddToTree(treeProcessId,  pe32.th32ProcessID, 
maxProcessId);
+                    add = TRUE;
+                    break; /* restart the loop */
+                }
+           }
+           if (!Process32Next(hProcessSnap, &pe32)) {
+               break; /* done */
+           }
+        }
+       if (!add) {
+           break;
+        }
+    }
+    return(TRUE);
+}
 /* Terminate child processes if any
  * dwProcessId : the parent process
  * dryrun : Don't kill, just list process in debug output file.
  */
-static BOOL __apxProcessTerminateChild(DWORD dwProcessId, BOOL dryrun)
+BOOL apxProcessTerminateChild(DWORD dwProcessId, BOOL dryrun)
 {
     HANDLE hProcessSnap;
-    PROCESSENTRY32 pe32;
+    DWORD treeProcessId[32];
+    int maxProcessId = 32;
+    int i;
+    for (i=0; i<maxProcessId; i++) {
+       treeProcessId[i] = 0;
+    }
 
     apxLogWrite(APXLOG_MARK_DEBUG "TerminateChild 0x%08X (%d)", dwProcessId, 
dwProcessId );
     // Take a snapshot of all processes in the system.
@@ -317,46 +382,39 @@
         return(FALSE);
     }
 
-    // Set the size of the structure before using it.
-    pe32.dwSize = sizeof(PROCESSENTRY32);
-
-    // Retrieve information about the first process,
-    // and return if unsuccessful
-    if( !Process32First(hProcessSnap, &pe32 )) {
-        apxLogWrite(APXLOG_MARK_DEBUG "Process32First failed");
+    // Read recursily all the child process id.
+    // display information about each process in turn if debug.
+    if (!__apxProcessGetTree(dwProcessId, hProcessSnap,  treeProcessId, 
maxProcessId)) {
+        apxLogWrite(APXLOG_MARK_DEBUG "__apxProcessGetTree failed");
         CloseHandle(hProcessSnap);          // clean the snapshot object
         return(FALSE);
     }
 
-    // Now walk the snapshot of processes, and
+    // kill all the processes we have discover.
+     
     // display information about each process in turn
-    do {
-        if (pe32.th32ParentProcessID == dwProcessId) {
-            apxLogWrite(APXLOG_MARK_DEBUG "PROCESS NAME:  %S", pe32.szExeFile);
-
-            apxLogWrite(APXLOG_MARK_DEBUG "Process ID        = 0x%08X", 
pe32.th32ProcessID);
-            apxLogWrite(APXLOG_MARK_DEBUG "Thread count      = %d",   
pe32.cntThreads);
-            apxLogWrite(APXLOG_MARK_DEBUG "Parent process ID = 0x%08X", 
pe32.th32ParentProcessID);
-            apxLogWrite(APXLOG_MARK_DEBUG "Priority base     = %d", 
pe32.pcPriClassBase);
-            if (!dryrun) {
-                HANDLE hProcess;
-                hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, 
pe32.th32ProcessID);
-                if(hProcess != NULL) {
-                   TerminateProcess(hProcess, CHILD_TERMINATE_CODE);
-                   apxLogWrite(APXLOG_MARK_DEBUG "Process ID: 0x%08X (%d) 
Terminated!", pe32.th32ProcessID, pe32.th32ProcessID);
-                   CloseHandle(hProcess);
-                } else {
-                   apxLogWrite(APXLOG_MARK_DEBUG "Process ID: 0x%08X (%d) 
Termination failed!", pe32.th32ProcessID, pe32.th32ProcessID);
-                }
-            }
+    if (!dryrun) {
+        HANDLE hProcess;
+        for (i=0; i<maxProcessId; i++) {
+           if (treeProcessId[i] == 0) {
+              break; /* Done */
+           }
+           hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, treeProcessId[i]);
+           if(hProcess != NULL) {
+              TerminateProcess(hProcess, CHILD_TERMINATE_CODE);
+              apxLogWrite(APXLOG_MARK_DEBUG "Process ID: 0x%08X (%d) 
Terminated!", treeProcessId[i], treeProcessId[i]);
+              CloseHandle(hProcess);
+           } else {
+              apxLogWrite(APXLOG_MARK_DEBUG "Process ID: 0x%08X (%d) 
Termination failed!",  treeProcessId[i], treeProcessId[i]);
+           }
        }
+    }
 
-    } while(Process32Next(hProcessSnap, &pe32));
-  
     CloseHandle(hProcessSnap);
     return(TRUE);
 }
 
+
 /* Close the process.
  * Create the remote thread and call the ExitProcess
  * Terminate the process, if all of the above fails.
@@ -374,7 +432,7 @@
     CHECK_IF_ACTIVE(lpProc);
 
     /* dry run to get debug information */
-    __apxProcessTerminateChild(lpProc->stProcInfo.dwProcessId, TRUE);
+    apxProcessTerminateChild(lpProc->stProcInfo.dwProcessId, TRUE);
     /* Try to close the child's stdin first */
     SAFE_CLOSE_HANDLE(lpProc->hChildInpWr);
     /* Wait 1 sec for child process to
@@ -413,7 +471,7 @@
                      /* We are here when the service starts something like 
wildfly via standalone.sh and wildfly doesn't terminate cleanly, 
                       * dry run is FALSE: we kill all the process of the 
process tree
                       */
-                     
__apxProcessTerminateChild(lpProc->stProcInfo.dwProcessId, FALSE);
+                     apxProcessTerminateChild(lpProc->stProcInfo.dwProcessId, 
FALSE);
                 }
 
 
@@ -804,6 +862,8 @@
         if (rv == WAIT_TIMEOUT && bKill) {
             apxLogWrite(APXLOG_MARK_DEBUG "apxProcessWait. killing???");
             __apxProcessCallback(hProcess, WM_CLOSE, 0, 0);
+            apxLogWrite(APXLOG_MARK_DEBUG "apxProcessWait. killing??? after 
WM_CLOSE");
+            apxProcessTerminateChild(GetCurrentProcessId(), TRUE); 
         }
         return rv;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/native/windows/src/security.c 
new/commons-daemon-1.3.3-src/src/native/windows/src/security.c
--- old/commons-daemon-1.3.2-src/src/native/windows/src/security.c      
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/native/windows/src/security.c      
2022-09-18 15:49:41.000000000 +0200
@@ -38,7 +38,7 @@
     } else {
         dwResult = GetSystemDirectoryW(sPath, MAX_PATH);
         if (dwResult) {
-            return dwResult;
+            goto cleanup;
         }
         lstrlcatW(sPath, MAX_PATH, LOG_PATH_DEFAULT);
     }
@@ -74,13 +74,13 @@
             NULL,
             &pSD);
     if (dwResult) {
-        return dwResult;
+        goto cleanup;
     }
 
     /* Additional access. */
     ZeroMemory(&ea, sizeof(EXPLICIT_ACCESS));
     ea.grfAccessPermissions = GENERIC_EXECUTE + GENERIC_READ + GENERIC_WRITE;
-    ea.grfAccessMode = GRANT_ACCESS;
+    ea.grfAccessMode = SET_ACCESS;
     ea.grfInheritance = CONTAINER_INHERIT_ACE + OBJECT_INHERIT_ACE;
     ea.Trustee.TrusteeForm = TRUSTEE_IS_NAME;
     ea.Trustee.ptstrName = sUser;
@@ -88,7 +88,7 @@
     /* Merge old and additional into new ACL. */
     dwResult = SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL);
     if (dwResult) {
-        return dwResult;
+        goto cleanup;
     }
 
     /* Set the new ACL. */
@@ -101,9 +101,17 @@
             pNewDACL,
             NULL);
     if (dwResult) {
-        return dwResult;
+        goto cleanup;
     }
 
-    return 0;
+cleanup:
+    if (pSD != NULL) {
+        LocalFree((HLOCAL) pSD);
+    }
+    if (pNewDACL != NULL) {
+        LocalFree((HLOCAL) pNewDACL);
+    }
+
+    return dwResult;
 }
  
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/samples/SimpleApplication.sh 
new/commons-daemon-1.3.3-src/src/samples/SimpleApplication.sh
--- old/commons-daemon-1.3.2-src/src/samples/SimpleApplication.sh       
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/samples/SimpleApplication.sh       
2022-09-18 15:49:41.000000000 +0200
@@ -20,7 +20,7 @@
 # Adapt the following lines to your configuration
 JAVA_HOME=/opt/java6
 PROGRAM=SimpleApplication
-CLASSPATH=`pwd`/$PROGRAM.jar:`pwd`/commons-daemon-1.3.2.jar
+CLASSPATH=`pwd`/$PROGRAM.jar:`pwd`/commons-daemon-1.3.3.jar
 
 case "$1" in
   start )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/commons-daemon-1.3.2-src/src/site/xdoc/binaries.xml 
new/commons-daemon-1.3.3-src/src/site/xdoc/binaries.xml
--- old/commons-daemon-1.3.2-src/src/site/xdoc/binaries.xml     2022-09-18 
15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/site/xdoc/binaries.xml     2022-09-18 
15:49:41.000000000 +0200
@@ -36,7 +36,7 @@
 <section name="How do I get the executable?">
 <subsection name="procrun">
 <p>
-The Windows archive (e.g. commons-daemon-1.3.2-bin-windows.zip) contains 2 
different executables:
+The Windows archive (e.g. commons-daemon-1.3.3-bin-windows.zip) contains 2 
different executables:
 <ul>
 <li>prunsrv.exe - service application for running applications as 
services.</li>
 <li>prunmgr.exe - the GUI manager application used to monitor and configure 
installed services.</li>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/site/xdoc/download_daemon.xml 
new/commons-daemon-1.3.3-src/src/site/xdoc/download_daemon.xml
--- old/commons-daemon-1.3.2-src/src/site/xdoc/download_daemon.xml      
2022-09-18 15:49:41.000000000 +0200
+++ new/commons-daemon-1.3.3-src/src/site/xdoc/download_daemon.xml      
2022-09-18 15:49:41.000000000 +0200
@@ -113,32 +113,32 @@
       </p>
     </subsection>
     </section>
-    <section name="Apache Commons Daemon 1.3.2 ">
+    <section name="Apache Commons Daemon 1.3.3 ">
       <subsection name="Binaries">
         <table>
           <tr>
-              <td><a 
href="[preferred]/commons/daemon/binaries/commons-daemon-1.3.2-bin.tar.gz">commons-daemon-1.3.2-bin.tar.gz</a></td>
-              <td><a 
href="https://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.3.2-bin.tar.gz.sha512";>sha512</a></td>
-              <td><a 
href="https://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.3.2-bin.tar.gz.asc";>pgp</a></td>
+              <td><a 
href="[preferred]/commons/daemon/binaries/commons-daemon-1.3.3-bin.tar.gz">commons-daemon-1.3.3-bin.tar.gz</a></td>
+              <td><a 
href="https://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.3.3-bin.tar.gz.sha512";>sha512</a></td>
+              <td><a 
href="https://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.3.3-bin.tar.gz.asc";>pgp</a></td>
           </tr>
           <tr>
-              <td><a 
href="[preferred]/commons/daemon/binaries/commons-daemon-1.3.2-bin.zip">commons-daemon-1.3.2-bin.zip</a></td>
-              <td><a 
href="https://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.3.2-bin.zip.sha512";>sha512</a></td>
-              <td><a 
href="https://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.3.2-bin.zip.asc";>pgp</a></td>
+              <td><a 
href="[preferred]/commons/daemon/binaries/commons-daemon-1.3.3-bin.zip">commons-daemon-1.3.3-bin.zip</a></td>
+              <td><a 
href="https://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.3.3-bin.zip.sha512";>sha512</a></td>
+              <td><a 
href="https://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.3.3-bin.zip.asc";>pgp</a></td>
           </tr>
         </table>
       </subsection>
       <subsection name="Source">
         <table>
           <tr>
-              <td><a 
href="[preferred]/commons/daemon/source/commons-daemon-1.3.2-src.tar.gz">commons-daemon-1.3.2-src.tar.gz</a></td>
-              <td><a 
href="https://www.apache.org/dist/commons/daemon/source/commons-daemon-1.3.2-src.tar.gz.sha512";>sha512</a></td>
-              <td><a 
href="https://www.apache.org/dist/commons/daemon/source/commons-daemon-1.3.2-src.tar.gz.asc";>pgp</a></td>
+              <td><a 
href="[preferred]/commons/daemon/source/commons-daemon-1.3.3-src.tar.gz">commons-daemon-1.3.3-src.tar.gz</a></td>
+              <td><a 
href="https://www.apache.org/dist/commons/daemon/source/commons-daemon-1.3.3-src.tar.gz.sha512";>sha512</a></td>
+              <td><a 
href="https://www.apache.org/dist/commons/daemon/source/commons-daemon-1.3.3-src.tar.gz.asc";>pgp</a></td>
           </tr>
           <tr>
-              <td><a 
href="[preferred]/commons/daemon/source/commons-daemon-1.3.2-src.zip">commons-daemon-1.3.2-src.zip</a></td>
-              <td><a 
href="https://www.apache.org/dist/commons/daemon/source/commons-daemon-1.3.2-src.zip.sha512";>sha512</a></td>
-              <td><a 
href="https://www.apache.org/dist/commons/daemon/source/commons-daemon-1.3.2-src.zip.asc";>pgp</a></td>
+              <td><a 
href="[preferred]/commons/daemon/source/commons-daemon-1.3.3-src.zip">commons-daemon-1.3.3-src.zip</a></td>
+              <td><a 
href="https://www.apache.org/dist/commons/daemon/source/commons-daemon-1.3.3-src.zip.sha512";>sha512</a></td>
+              <td><a 
href="https://www.apache.org/dist/commons/daemon/source/commons-daemon-1.3.3-src.zip.asc";>pgp</a></td>
           </tr>
         </table>
       </subsection>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/commons-daemon-1.3.2-src/src/test/java/org/apache/commons/daemon/DaemonInitExceptionTest.java
 
new/commons-daemon-1.3.3-src/src/test/java/org/apache/commons/daemon/DaemonInitExceptionTest.java
--- 
old/commons-daemon-1.3.2-src/src/test/java/org/apache/commons/daemon/DaemonInitExceptionTest.java
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/commons-daemon-1.3.3-src/src/test/java/org/apache/commons/daemon/DaemonInitExceptionTest.java
   2022-09-18 15:49:41.000000000 +0200
@@ -0,0 +1,34 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.commons.daemon;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.IOException;
+
+import org.junit.jupiter.api.Test;
+
+public class DaemonInitExceptionTest {
+
+    @Test
+    public void test() {
+        final IOException e = new IOException(); 
+        assertEquals(e, new DaemonInitException("Test", e).getCause());
+    }
+
+}

Reply via email to