Robert Wunderer created KAFKA-7839:
--------------------------------------

             Summary: CLASSPATH with single component containing globs breaks 
kafka-run-class.sh
                 Key: KAFKA-7839
                 URL: https://issues.apache.org/jira/browse/KAFKA-7839
             Project: Kafka
          Issue Type: Bug
          Components: core
    Affects Versions: 0.11.0.3
            Reporter: Robert Wunderer
             Fix For: 0.11.0.3


This issue is very similar to KAFKA-3692, but occurs further down in 
kafa-run-class.sh:

If at the end of all processing CLASSPATH contains only a single component 
including wildcards, the shell will evaluate CLASSPATH on starting Java, thus 
breaking the command line.

To elaborate:

*Problem:*
If CLASSPATH is '/some/path/*', then

{CODE}
java -cp $CLASSPATH
{CODE}

becomes

{CODE}
java -cp /some/path/*
{CODE}

which in turn becomes

{CODE}
java -cp /some/path/file1 /some/path/file2
{CODE}

*Solution:*
This can be prevented by encapsulating CLASSPATH in quotes:

{CODE}
java -cp "$CLASSPATH"
{CODE}

which becomes

{CODE}
java -cp "/some/path/*"
{CODE}

and is handed like that to Java.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to