jenkins-monitor-job script does not handle jobs that contain spaces

Bug #880786 reported by petitg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jenkins (Ubuntu)
Fix Released
Low
James Page

Bug Description

Reporting this bug on Ubuntu 11.10
Installed package version: Installed: 1.409.1-0ubuntu4

The script by James in /usr/bin/jenkins-monitor-job wraps a call to java -jar ${JENKINS_LIB}/jenkins-core.jar $@

However, since $@ is not quoted, jenkins-monitor-job fails when the project name contains a space. For instance

jenkins-monitor-job "this_works" ls # this works
jenkins-monitor-job "this does not work" ls # returns an error about the project 'this' not existing

The solution is to wrap the $@ arguments between quotes in /usr/bin/jenkins-monitor-job:

30c30
< java -jar ${JENKINS_LIB}/jenkins-core.jar $@
---
> java -jar ${JENKINS_LIB}/jenkins-core.jar "$@"

This has been working fine on my side and should be corrected in the jenkins package.

Cheers,

Gaspard

Tags: jenkins

Related branches

Revision history for this message
James Page (james-page) wrote :

Confirmed - pretty easy to reproduce.

Changed in jenkins (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → James Page (james-page)
Revision history for this message
James Page (james-page) wrote :

Hi Gaspard

Thanks for taking the time to report this bug.

I'll update the jenkins package in the current development release; if this bug is an issue for a larger number of people then we can look at applying an SRU to 11.10 to resolve this issue.

Cheers

James

Revision history for this message
petitg (gaspardpetit) wrote :

awesome, thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package jenkins - 1.409.2-0ubuntu1

---------------
jenkins (1.409.2-0ubuntu1) precise; urgency=low

  * New upstream release:
    - d/control: Added new BDI's - libjtidy-java, libjenkins-htmlunit-java
    - Refreshed patches.
    - d/maven.rules: Updated jenkins version to 1.409.2.
  * Updated upstart configuration to start on runlevel [2345].
  * Revised patches to filter on compile/test surplus native integrations
    rather than patchout complete files.
  * Re-organised patches by type.
  * Fixed issue with projects with spaces in names with jenkins-monitor-job
    (LP: #880786).
 -- James Page <email address hidden> Sat, 22 Oct 2011 11:57:35 +0100

Changed in jenkins (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.