kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-4247) kafka-run-class has potential to add a leading colon to classpath
Date Tue, 09 Jan 2018 18:25:00 GMT

    [ https://issues.apache.org/jira/browse/KAFKA-4247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16318863#comment-16318863

ASF GitHub Bot commented on KAFKA-4247:

C0urante opened a new pull request #4406: KAFKA-4247: Prevent CLASSPATH from beginning with
a single colon
URL: https://github.com/apache/kafka/pull/4406
   Different fix for problem addressed by https://github.com/apache/kafka/pull/1953. Should
prevent the CLASSPATH environment variable from being prefixed by a single colon before the
JVM is invoked in the run-class script, which will then prevent the current working directory
from being unintentionally included in the classpath when using the Reflections library.
   If the current working directory should still be included in the classpath, it just needs
to be explicitly specified either with its fully-qualified pathname or as a single dot (".").

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> kafka-run-class has potential to add a leading colon to classpath
> -----------------------------------------------------------------
>                 Key: KAFKA-4247
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4247
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>            Reporter: Ryan P
>            Assignee: Ryan P
> https://github.com/confluentinc/kafka/blob/trunk/bin/kafka-run-class.sh#L128-L133
> In the event CLASSPATH has not yet been populated this will result in 
> :$file 
> Normally this wouldn't be a problem however Connect's AbstractClassHearder uses ClasspathHelper.forJavaClassPath()
to collect it's eligible classes. 
> With a leading colon you will endup with a entry for null which is expanded to the working
> java -cp ":" test
> []
> java -cp ":Users" test
> [file:/Users/ryan/, file:/Users/ryan/Users]
> This is problematic if the script was run from the root directory since the URLs will
be scanned the directories recursively. Ultimately leading to a situation where the entire
FileSystem is scanned. This has been known to cause issues for some Docker installations.

> Typically this is worked around by editing the the kafka-run-class script however I think
we should handle this within Connect itself by excluding the root directory. 

This message was sent by Atlassian JIRA

View raw message