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

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

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            rwunderer Robert Wunderer

            Dates

              Created:
              Updated:

              Slack

                Issue deployment