lxc-ls fails if name of a container starts with '-'

Bug #1006332 reported by Jean-Baptiste Lallement on 2012-05-30
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Low
Serge Hallyn
Precise
Undecided
Unassigned
Quantal
Low
Serge Hallyn

Bug Description

============== SRU Justification =============
Impact: lxc-ls fails when container names start with a dash ('-')
Development fix: when calling 'ls' from lxc-ls, specify -- before the container name to make clear that the next argument is a file name
Stable fix: same as Development fix.
Test case:
 sudo lxc-create -t ubuntu -n -p2
 sudo lxc-start -n -p2 -d
 sudo lxc-ls
 the lxc-ls will show ls error messages without the patch
Regression potential: none

==============================================

A script created a container which name starts with a '-' ( -lo-quantal-i386 in this case )

Then calls to lxc-ls and lxc-list fail with:

$ lxc-ls
-lo-quantal-i386
ls: invalid option -- '-'
Try `ls --help' for more information.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: lxc 0.8.0~rc1-4ubuntu10
ProcVersionSignature: Ubuntu 3.4.0-3.8-generic 3.4.0
Uname: Linux 3.4.0-3-generic x86_64
ApportVersion: 2.1-0ubuntu1
Architecture: amd64
Date: Wed May 30 12:30:17 2012
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: lxc
UpgradeStatus: Upgraded to quantal on 2012-01-31 (119 days ago)

Jean-Baptiste Lallement (jibel) wrote :
Serge Hallyn (serge-hallyn) wrote :

Sure does, thanks for reporting this bug. All other commands I tried did seem to work.

Changed in lxc (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Changed in lxc (Ubuntu):
assignee: nobody → Serge Hallyn (serge-hallyn)
Changed in lxc (Ubuntu Quantal):
status: Triaged → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.8.0~rc1-4ubuntu13

---------------
lxc (0.8.0~rc1-4ubuntu13) quantal; urgency=low

  * 0086-lxc-unshare-zero-args: fix lxc-unshare segfaulting when no command
    is given (LP: #1011603)
  * 0087-lxc-ls-dash: fix lxc-ls for containers whose names start with a
    dash (LP: #1006332)
  * 0088-ubuntu-template-flock: don't fail when flock is busy, just wait,
    so concurrent lxc-creates don't break. (LP: #1007483)
  * 0089-lxc-netstat-exec: fix lxc-netstat errors (LP: #1011739)
 -- Serge Hallyn <email address hidden> Mon, 11 Jun 2012 15:46:25 +0000

Changed in lxc (Ubuntu Quantal):
status: In Progress → Fix Released
description: updated

Hello Jean-Baptiste, or anyone else affected,

Accepted lxc into precise-proposed. The package will build now and be available in a few hours. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case details of your testing will help us make a better decision. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in lxc (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Stéphane Graber (stgraber) wrote :

lxc-ls is happy now

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.7.5-3ubuntu59

---------------
lxc (0.7.5-3ubuntu59) precise-proposed; urgency=low

  [ Serge Hallyn ]
  * 0085-pivot-dir: use a directory other than /mnt to put the pivot_root
    old dir into (LP: #986385)
  * 0086-lxc-unshare-zero-args: fix lxc-unshare segfaulting when no command
    is given (LP: #1011603)
  * 0087-lxc-ls-dash: fix lxc-ls for containers whose names start with a
    dash (LP: #1006332)
  * 0088-ubuntu-template-flock: don't fail when flock is busy, just wait,
    so concurrent lxc-creates don't break. (LP: #1007483)
  * debian/rules, debian/lxc.apport: install apport hook (LP: #1011644)

  [ Stéphane Graber ]
  * Ship /etc/dnsmasq.d/lxc to configure an eventual system wide
    dnsmasq daemon not to listen on the LXC bridge interface. (LP: #928524)
 -- Serge Hallyn <email address hidden> Mon, 11 Jun 2012 19:56:30 -0500

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

Other bug subscribers