diff --git a/CHANGES.txt b/CHANGES.txt index e932b40467..dd567703a7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0 + * CVE-2017-5929 Security vulnerability and redefine default log rotation policy (CASSANDRA-14183) * Use JVM default SSL validation algorithm instead of custom default (CASSANDRA-13259) * Better document in code InetAddressAndPort usage post 7544, incorporate port into UUIDGen node (CASSANDRA-14226) * Fix sstablemetadata date string for minLocalDeletionTime (CASSANDRA-14132) diff --git a/build.xml b/build.xml index bc9f0a74c0..4b6ae70b2f 100644 --- a/build.xml +++ b/build.xml @@ -383,8 +383,8 @@ - - + + diff --git a/conf/logback.xml b/conf/logback.xml index a22f131757..b2c5b10d2a 100644 --- a/conf/logback.xml +++ b/conf/logback.xml @@ -22,7 +22,7 @@ In order to disable debug.log, comment-out the ASYNCDEBUGLOG appender reference in the root level section below. --> - + @@ -34,14 +34,14 @@ appender reference in the root level section below. INFO ${cassandra.logdir}/system.log - - ${cassandra.logdir}/system.log.%i.zip - 1 - 20 + + + ${cassandra.logdir}/system.log.%d{yyyy-MM-dd}.%i.zip + + 50MB + 7 + 5GB - - 20MB - %-5level [%thread] %date{ISO8601} %F:%L - %msg%n @@ -51,14 +51,14 @@ appender reference in the root level section below. ${cassandra.logdir}/debug.log - - ${cassandra.logdir}/debug.log.%i.zip - 1 - 20 + + + ${cassandra.logdir}/debug.log.%d{yyyy-MM-dd}.%i.zip + + 50MB + 7 + 5GB - - 20MB - %-5level [%thread] %date{ISO8601} %F:%L - %msg%n diff --git a/lib/logback-classic-1.1.3.jar b/lib/logback-classic-1.1.3.jar deleted file mode 100644 index 2aa10a5196..0000000000 Binary files a/lib/logback-classic-1.1.3.jar and /dev/null differ diff --git a/lib/logback-classic-1.2.3.jar b/lib/logback-classic-1.2.3.jar new file mode 100644 index 0000000000..bed00c0a58 Binary files /dev/null and b/lib/logback-classic-1.2.3.jar differ diff --git a/lib/logback-core-1.1.3.jar b/lib/logback-core-1.1.3.jar deleted file mode 100644 index 996b722d05..0000000000 Binary files a/lib/logback-core-1.1.3.jar and /dev/null differ diff --git a/lib/logback-core-1.2.3.jar b/lib/logback-core-1.2.3.jar new file mode 100644 index 0000000000..487b3956ad Binary files /dev/null and b/lib/logback-core-1.2.3.jar differ diff --git a/src/java/org/apache/cassandra/cql3/functions/ThreadAwareSecurityManager.java b/src/java/org/apache/cassandra/cql3/functions/ThreadAwareSecurityManager.java index 9c5b95b9cb..0a424b21eb 100644 --- a/src/java/org/apache/cassandra/cql3/functions/ThreadAwareSecurityManager.java +++ b/src/java/org/apache/cassandra/cql3/functions/ThreadAwareSecurityManager.java @@ -88,6 +88,8 @@ public final class ThreadAwareSecurityManager extends SecurityManager // To work around this, a custom ReconfigureOnChangeFilter is installed, that simply // prevents this configuration file check and possible reload of the configration, // while executing sandboxed UDF code. + // + // NOTE: this is obsolte with logback versions (at least since 1.2.3) Logger l = LoggerFactory.getLogger(ThreadAwareSecurityManager.class); ch.qos.logback.classic.Logger logbackLogger = (ch.qos.logback.classic.Logger) l; LoggerContext ctx = logbackLogger.getLoggerContext(); @@ -110,6 +112,9 @@ public final class ThreadAwareSecurityManager extends SecurityManager /** * The purpose of this class is to prevent logback from checking for config file change, * if the current thread is executing a sandboxed thread to avoid {@link AccessControlException}s. + * + * This is obsolete with logback versions that replaced {@link ReconfigureOnChangeFilter} + * with {@link ch.qos.logback.classic.joran.ReconfigureOnChangeTask} (at least logback since 1.2.3). */ private static class SMAwareReconfigureOnChangeFilter extends ReconfigureOnChangeFilter { diff --git a/test/conf/logback-test.xml b/test/conf/logback-test.xml index 48f93bceb8..4092050d66 100644 --- a/test/conf/logback-test.xml +++ b/test/conf/logback-test.xml @@ -17,7 +17,7 @@ under the License. --> - + diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java index 589afd5195..dd45f72bbf 100644 --- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java +++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java @@ -218,10 +218,10 @@ public class DatabaseDescriptorRefTest method.invoke(null); if ("clientInitialization".equals(methodName) && - threadCount + 1 == threads.getThreadCount()) + threadCount + 2 == threads.getThreadCount()) { - // ignore the "AsyncAppender-Worker-ASYNC" thread - threadCount++; + // ignore the "AsyncAppender-Worker-ASYNC" and "logback-1" threads + threadCount = threadCount + 2; } if (threadCount != threads.getThreadCount()) diff --git a/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java b/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java index dea3803b73..f2f6614646 100644 --- a/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java +++ b/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java @@ -38,6 +38,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ch.qos.logback.classic.LoggerContext; +import ch.qos.logback.classic.joran.ReconfigureOnChangeTask; import ch.qos.logback.classic.spi.TurboFilterList; import ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter; import ch.qos.logback.classic.turbo.TurboFilter; @@ -58,6 +59,7 @@ import org.apache.cassandra.transport.Event; import org.apache.cassandra.transport.ProtocolVersion; import org.apache.cassandra.transport.messages.ResultMessage; +import static ch.qos.logback.core.CoreConstants.RECONFIGURE_ON_CHANGE_TASK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -1849,6 +1851,16 @@ public class AggregationTest extends CQLTester break; } } + + ReconfigureOnChangeTask roct = (ReconfigureOnChangeTask) ctx.getObject(RECONFIGURE_ON_CHANGE_TASK); + if (roct != null) + { + // New functionality in logback - they replaced ReconfigureOnChangeFilter (which runs in the logging code) + // with an async ReconfigureOnChangeTask - i.e. in a thread that does not become sandboxed. + // Let the test run anyway, just we cannot reconfigure it (and it is pointless to reconfigure). + return; + } + assertTrue("ReconfigureOnChangeFilter not in logback's turbo-filter list - do that by adding scan=\"true\" to logback-test.xml's configuration element", done); }