You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2022/01/28 14:29:22 UTC

[GitHub] [logging-log4j2] carterkozak commented on a change in pull request #732: LOG4J2-3350: Lookup recursion is not allowed, except through config properties

carterkozak commented on a change in pull request #732:
URL: https://github.com/apache/logging-log4j2/pull/732#discussion_r794552367



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/config/PropertiesPlugin.java
##########
@@ -45,15 +46,14 @@ private PropertiesPlugin() {
     @PluginFactory
     public static StrLookup configureSubstitutor(@PluginElement("Properties") final Property[] properties,
                                                  @PluginConfiguration final Configuration config) {
-        if (properties == null) {
-            return new Interpolator(config.getProperties());
-        }
+        final Property[] props = properties == null ? Property.EMPTY_ARRAY : properties;
         final Map<String, String> map = new HashMap<>(config.getProperties());

Review comment:
       TODO + test: the configuration context-properties (`config.getProperties()`) are distinct from the configuration properties (`Property[] properties`), and should not allow recursive evaluation.
   The PropertiesLookup should take both maps, and return values which don't support recursive evaluation for config context props.




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org