Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7839

CLASSPATH with single component containing globs breaks kafka-run-class.sh

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 0.11.0.3
    • 0.11.0.3
    • core
    • None

    Description

      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

      java -cp $CLASSPATH
      

      becomes

      java -cp /some/path/*
      

      which in turn becomes

      java -cp /some/path/file1 /some/path/file2
      

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

      java -cp "$CLASSPATH"
      

      which becomes

      java -cp "/some/path/*"
      

      and is handed like that to Java.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rwunderer Robert Wunderer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: