This is an automated email from the git hooks/post-receive script. tmancill pushed a commit to branch master in repository commons-daemon.
commit 64d7ae3f91c51f7368eb9d8bd9dd820653d519f7 Author: tony mancill <[email protected]> Date: Fri Nov 7 07:59:35 2014 -0800 Imported Upstream version 1.0.7 --- RELEASE-NOTES.txt | 10 +++-- build.xml | 4 +- pom.xml | 4 +- .../daemon/support/DaemonConfiguration.java | 9 ++++- src/native/unix/CHANGES.txt | 5 ++- src/native/unix/native/jsvc-unix.c | 31 +++++++++------ src/native/unix/native/version.h | 2 +- src/native/windows/apps/prunmgr/prunmgr.h | 2 +- src/native/windows/apps/prunmgr/prunmgr.rc | 6 +-- src/native/windows/apps/prunsrv/prunsrv.h | 2 +- src/native/windows/apps/prunsrv/prunsrv.rc | 4 +- src/native/windows/src/log.c | 45 ---------------------- 12 files changed, 50 insertions(+), 74 deletions(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 165f2c3..76f8a53 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,7 +1,7 @@ -$Id: RELEASE-NOTES.txt 1138939 2011-06-23 15:38:29Z mturk $ +$Id: RELEASE-NOTES.txt 1153024 2011-08-02 04:27:12Z mturk $ Commons Daemon Package - Version 1.0.6 + Version 1.0.7 Release Notes @@ -32,7 +32,7 @@ Commons DAEMON 1.0.3 requires a minimum of JDK 1.3 NEW FEATURES: * DAEMON-209: Add --LibraryPath to procrun for setting the - LoadLibrary serch paths (1.0.6) + LoadLibrary search paths (1.0.6) * DAEMON-208: Add -server and -client -jvm <name> synonyms (1.0.6) * DAEMON-205: Add support for building on ARM processors (1.0.6) * DAEMON-204: Add DaemonSignal interface that allows catching SIGUSR2 @@ -72,12 +72,14 @@ NEW FEATURES: for Unix and Windows NT/2K/XP, which allows running a Java program as a native operating system daemon -* Switch to JIRA bug tracking sytem. +* Switch to JIRA bug tracking system. * Add sample ProcrunService Java application for use with Procrun Jvm/Java modes (1.0.3) BUG FIXES: +1.0.7: DAEMON-211 + 1.0.6: DAEMON-186, DAEMON-193, DAEMON-194, DAEMON-206, DAEMON-185, DAEMON-200 DAEMON-192 diff --git a/build.xml b/build.xml index d8f6c71..f87802b 100644 --- a/build.xml +++ b/build.xml @@ -19,7 +19,7 @@ <!-- "Daemon" component of the Apache Commons Subproject - $Id: build.xml 1142575 2011-07-04 07:29:33Z mturk $ + $Id: build.xml 1152906 2011-08-01 19:38:09Z mturk $ --> @@ -59,7 +59,7 @@ <property name="component.title" value="Java Daemons"/> <!-- The current version number of this component --> - <property name="component.version" value="1.0.6"/> + <property name="component.version" value="1.0.7"/> <!-- The base directory for compilation targets --> <property name="build.home" value="target"/> diff --git a/pom.xml b/pom.xml index fd0963b..1086b9d 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>commons-daemon</groupId> <artifactId>commons-daemon</artifactId> - <version>1.0.6</version> + <version>1.0.7</version> <name>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 --> @@ -92,7 +92,7 @@ <maven.compile.source>1.3</maven.compile.source> <maven.compile.target>1.3</maven.compile.target> <commons.componentid>daemon</commons.componentid> - <commons.release.version>1.0.6</commons.release.version> + <commons.release.version>1.0.7</commons.release.version> <commons.jira.id>DAEMON</commons.jira.id> <commons.jira.pid>12310468</commons.jira.pid> </properties> diff --git a/src/java/org/apache/commons/daemon/support/DaemonConfiguration.java b/src/java/org/apache/commons/daemon/support/DaemonConfiguration.java index 908b969..d7f5a4f 100644 --- a/src/java/org/apache/commons/daemon/support/DaemonConfiguration.java +++ b/src/java/org/apache/commons/daemon/support/DaemonConfiguration.java @@ -83,10 +83,11 @@ public final class DaemonConfiguration public boolean load(String fileName) { boolean ok = false; + FileInputStream file = null; try { if (fileName == null) fileName = DEFAULT_CONFIG; - FileInputStream file = new FileInputStream(fileName); + file = new FileInputStream(fileName); configurationProperties.clear(); configurationProperties.load(file); ok = true; @@ -96,6 +97,12 @@ public final class DaemonConfiguration } catch (IOException ex) { // Error reading properties file + } finally { + try { + if (file != null) + file.close(); + } catch (IOException ex) { + } } return ok; } diff --git a/src/native/unix/CHANGES.txt b/src/native/unix/CHANGES.txt index 8b102ca..8076770 100644 --- a/src/native/unix/CHANGES.txt +++ b/src/native/unix/CHANGES.txt @@ -1,5 +1,8 @@ APACHE COMMONS DAEMON (UNIX) CHANGELOG: -Last modified at [$Date: 2011-01-18 09:56:45 +0100 (Tue, 18 Jan 2011) $] +Last modified at [$Date: 2011-08-01 21:38:09 +0200 (Mon, 01 Aug 2011) $] + +Changes with 1.0.7 + Changes with 1.0.6 * Fix syslog infinite loop (DAEMON-194) diff --git a/src/native/unix/native/jsvc-unix.c b/src/native/unix/native/jsvc-unix.c index 1967f09..eff5dd2 100644 --- a/src/native/unix/native/jsvc-unix.c +++ b/src/native/unix/native/jsvc-unix.c @@ -14,7 +14,7 @@ * limitations under the License. */ -/* @version $Id: jsvc-unix.c 1130635 2011-06-02 16:29:44Z mturk $ */ +/* @version $Id: jsvc-unix.c 1152701 2011-08-01 08:03:41Z mturk $ */ #include "jsvc.h" #include <signal.h> @@ -180,14 +180,12 @@ static cap_value_t caps_std[] = { CAP_NET_BIND_SERVICE, CAP_SETUID, CAP_SETGID, - CAP_DAC_READ_SEARCH, - CAP_DAC_OVERRIDE + CAP_DAC_READ_SEARCH }; static cap_value_t caps_min[] = { CAP_NET_BIND_SERVICE, - CAP_DAC_READ_SEARCH, - CAP_DAC_OVERRIDE + CAP_DAC_READ_SEARCH }; #define CAPS 1 @@ -197,31 +195,42 @@ static int set_caps(int cap_type) { cap_t c; int ncap; + int flag = CAP_SET; cap_value_t *caps; + const char *type; if (cap_type == CAPS) { ncap = sizeof(caps_std)/sizeof(cap_value_t); caps = caps_std; + type = "default"; + } + else if (cap_type == CAPSMIN) { + ncap = sizeof(caps_min)/sizeof(cap_value_t); + caps = caps_min; + type = "min"; } else { ncap = sizeof(caps_min)/sizeof(cap_value_t); caps = caps_min; + type = "null"; + flag = CAP_CLEAR; } c = cap_init(); cap_clear(c); - cap_set_flag(c, CAP_EFFECTIVE, ncap, caps, CAP_SET); - cap_set_flag(c, CAP_INHERITABLE, ncap, caps, CAP_SET); - cap_set_flag(c, CAP_PERMITTED, ncap, caps, CAP_SET); + cap_set_flag(c, CAP_EFFECTIVE, ncap, caps, flag); + cap_set_flag(c, CAP_INHERITABLE, ncap, caps, flag); + cap_set_flag(c, CAP_PERMITTED, ncap, caps, flag); if (cap_set_proc(c) != 0) { - log_error("failed setting %s capabilities.", - cap_type == CAPS ? "default" : "min"); + log_error("failed setting %s capabilities.", type); return -1; } cap_free(c); if (cap_type == CAPS) log_debug("increased capability set."); - else + else if (cap_type == CAPSMIN) log_debug("decreased capability set to min required."); + else + log_debug("dropped capabilities."); return 0; } diff --git a/src/native/unix/native/version.h b/src/native/unix/native/version.h index 5d0d1f5..51623a1 100644 --- a/src/native/unix/native/version.h +++ b/src/native/unix/native/version.h @@ -31,7 +31,7 @@ #define JSVC_MINOR_VERSION 0 /** patch level */ -#define JSVC_PATCH_VERSION 6 +#define JSVC_PATCH_VERSION 7 /** * This symbol is defined for internal, "development" copies of JSVC. diff --git a/src/native/windows/apps/prunmgr/prunmgr.h b/src/native/windows/apps/prunmgr/prunmgr.h index 71f77ff..2a205e7 100644 --- a/src/native/windows/apps/prunmgr/prunmgr.h +++ b/src/native/windows/apps/prunmgr/prunmgr.h @@ -24,7 +24,7 @@ #define _PRUNMGR_H #undef PRG_VERSION -#define PRG_VERSION "1.0.6.0" +#define PRG_VERSION "1.0.7.0" #define PRG_REGROOT L"Apache Software Foundation\\Procrun 2.0" #define IDM_TM_EXIT 2000 diff --git a/src/native/windows/apps/prunmgr/prunmgr.rc b/src/native/windows/apps/prunmgr/prunmgr.rc index 921be62..4909a51 100644 --- a/src/native/windows/apps/prunmgr/prunmgr.rc +++ b/src/native/windows/apps/prunmgr/prunmgr.rc @@ -228,7 +228,7 @@ END STRINGTABLE BEGIN IDS_APPLICATION RSTR_PSM - IDS_APPVERSION "Version 1.0.6-dev" + IDS_APPVERSION "Version 1.0.7" IDS_APPFULLNAME RSTR_PSM " Version " PRG_VERSION IDS_APPCOPYRIGHT "Copyright (c) 2000-2011 The Apache Software Foundation" IDS_APPDESCRIPTION "Apache Commons Daemon Service Management Tool" @@ -259,8 +259,8 @@ BEGIN END 1 VERSIONINFO - FILEVERSION 1,0,6,0 - PRODUCTVERSION 1,0,6,0 + FILEVERSION 1,0,7,0 + PRODUCTVERSION 1,0,7,0 FILEFLAGSMASK 0x3fL #if defined(_DEBUG) FILEFLAGS 0x03L diff --git a/src/native/windows/apps/prunsrv/prunsrv.h b/src/native/windows/apps/prunsrv/prunsrv.h index 545accd..06a55c0 100644 --- a/src/native/windows/apps/prunsrv/prunsrv.h +++ b/src/native/windows/apps/prunsrv/prunsrv.h @@ -25,7 +25,7 @@ #define _PRUNSRV_H #undef PRG_VERSION -#define PRG_VERSION "1.0.6.0" +#define PRG_VERSION "1.0.7.0" #define PRG_REGROOT L"Apache Software Foundation\\Procrun 2.0" #endif /* _PRUNSRV_H */ diff --git a/src/native/windows/apps/prunsrv/prunsrv.rc b/src/native/windows/apps/prunsrv/prunsrv.rc index 7dc0575..8ef5b6c 100644 --- a/src/native/windows/apps/prunsrv/prunsrv.rc +++ b/src/native/windows/apps/prunsrv/prunsrv.rc @@ -22,8 +22,8 @@ IDI_MAINICON ICON "../../resources/procrunw.ico" 1 VERSIONINFO - FILEVERSION 1,0,6,0 - PRODUCTVERSION 1,0,6,0 + FILEVERSION 1,0,7,0 + PRODUCTVERSION 1,0,7,0 FILEFLAGSMASK 0x3fL #if defined(_DEBUG) FILEFLAGS 0x03L diff --git a/src/native/windows/src/log.c b/src/native/windows/src/log.c index 683f8c5..c7fc941 100644 --- a/src/native/windows/src/log.c +++ b/src/native/windows/src/log.c @@ -32,7 +32,6 @@ static LPCSTR _log_level[] = { typedef struct apx_logfile_st { HANDLE hFile; DWORD dwLogLevel; - BOOL bRotate; SYSTEMTIME sysTime; WCHAR szPath[SIZ_PATHLEN]; WCHAR szPrefix[MAX_PATH]; @@ -175,16 +174,6 @@ void apxLogLevelSet(HANDLE hFile, DWORD dwLevel) lf->dwLogLevel = dwLevel; } -void apxLogRotateSet(HANDLE hFile, BOOL doRotate) -{ - apx_logfile_st *lf = (apx_logfile_st *)hFile; - if (IS_INVALID_HANDLE(lf)) - lf = _st_sys_loghandle; - if (IS_INVALID_HANDLE(lf)) - return; - lf->bRotate = doRotate; -} - void apxLogLevelSetW(HANDLE hFile, LPCWSTR szLevel) { @@ -206,36 +195,6 @@ void apxLogLevelSetW(HANDLE hFile, } } -static BOOL apx_log_rotate(apx_logfile_st *l, - LPSYSTEMTIME lpCtime) -{ - WCHAR sPath[SIZ_PATHLEN]; - - /* rotate on daily basis */ - if (l->sysTime.wDay == lpCtime->wDay) - return TRUE; - FlushFileBuffers(l->hFile); - CloseHandle(l->hFile); - l->sysTime = *lpCtime; - - wsprintfW(sPath, L"%s\\%s" LOGF_EXT, - l->szPath, - l->szPrefix, - l->sysTime.wYear, - l->sysTime.wMonth, - l->sysTime.wDay); - l->hFile = CreateFileW(sPath, - GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_ALWAYS, - FILE_FLAG_NO_BUFFERING | FILE_FLAG_SEQUENTIAL_SCAN, - NULL); - if (IS_INVALID_HANDLE(l->hFile)) - return FALSE; - else - return TRUE; -} - int apxLogWrite( HANDLE hFile, @@ -310,10 +269,6 @@ apxLogWrite( if (!IS_INVALID_HANDLE(lf->hFile)) { SYSTEMTIME t; GetLocalTime(&t); - if (lf->bRotate) { - if (!apx_log_rotate(lf, &t)) - return 0; - } if (dolock) { APX_LOGLOCK(lf->hFile); } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/commons-daemon.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

