dschneider-pivotal commented on a change in pull request #7299:
URL: https://github.com/apache/geode/pull/7299#discussion_r793842812
##########
File path:
geode-serialization/src/main/java/org/apache/geode/internal/serialization/filter/GlobalSerialFilterConfiguration.java
##########
@@ -93,32 +107,45 @@ public boolean configure() {
globalSerialFilter.setFilter();
// log statement that filter is now configured
- logger.accept("Global serial filter is now configured.");
+ infoLogger.accept("Global serial filter is now configured.");
return true;
} catch (UnsupportedOperationException e) {
- if (hasRootCauseWithMessage(e, IllegalStateException.class,
- "Serial filter can only be set once")) {
-
- // log statement that filter was already configured
- logger.accept("Global serial filter is already configured.");
- }
+ handleUnsupportedOperationException(e);
return false;
}
}
- private static boolean hasRootCauseWithMessage(Throwable throwable,
+ private void
handleUnsupportedOperationException(UnsupportedOperationException e) {
+ if (hasRootCauseWithMessageContaining(e, IllegalStateException.class,
+ "Serial filter can only be set once")) {
+
+ // log statement that filter was already configured
+ warnLogger.accept("Global serial filter is already configured.");
+ }
+ if (hasRootCauseWithMessageContaining(e, ClassNotFoundException.class,
+ "ObjectInputFilter")) {
+
+ // log statement that a global serial filter cannot be configured
+ errorLogger.accept(
+ "Geode was unable to configure a global serialization filter because
ObjectInputFilter not found.");
Review comment:
I think you are correct in making in stronger than "info". I think it
could also be helpful to tie it back directly to the sys prop that was set.
This seems like an important enough security feature that if the user
explicitly configured it and we were not able to honor that request that it
should case startup to fail. They could then correct their environment so it
can be secure or remove the sys prop requesting it. But if failing startup is
not an option then "error" is better than "info".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]