Bug#667001: autopkgtest: adt-virt-schroot chokes on empty root-users/root-groups or non-existent names

Colin Watson cjwatson at ubuntu.com
Tue Apr 3 10:07:47 UTC 2012


Package: autopkgtest
Version: 2.0.1
Severity: normal
Tags: patch

The (largely automatically-generated) configuration for the schroot
instance I was trying to run adt-virt-schroot against is as follows:

  [precise-i386-sbuild]
  description=precise-i386-sbuild
  groups=sbuild,root,admin
  root-groups=sbuild,root,admin
  # Uncomment these lines to allow members of these groups to access
  # the -source chroots directly (useful for automated updates, etc).
  source-root-users=sbuild,root,admin
  source-root-groups=sbuild,root,admin
  type=directory
  union-type=overlayfs
  directory=/media/passport/chroot/precise-i386-sbuild
  personality=linux32

adt-virt-schroot chokes on this with:

  Traceback (most recent call last):
    File "/usr/bin/adt-virt-schroot", line 107, in <module>
      parse_args()
    File "/usr/bin/adt-virt-schroot", line 72, in parse_args
      if got_uid == pwd.getpwnam(exp_name).pw_uid
  KeyError: 'getpwnam(): name not found: '

There are two problems here.  Firstly, ''.split(',') returns [''] not
[], so you should filter out empty entries.  Secondly, adt-virt-schroot
should ignore user or group names that don't exist rather than crashing.
Patch attached.

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-schroot-configuration-parsing-more-robust.patch
Type: text/x-diff
Size: 1763 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20120403/d6bcebe4/attachment.patch>


More information about the autopkgtest-devel mailing list