[buildd-tools-devel] Bug#594720: Bug#594720: schroot: weird error message when chroot names contain a slash

Roger Leigh rleigh at codelibre.net
Sat Aug 28 20:36:40 UTC 2010


tags 594720 + confirmed patch
thanks

On Sat, Aug 28, 2010 at 06:38:05PM +0200, Hilko Bengen wrote:
> A long time ago, I set up many chroots etch/i386, etch/amd64,
> lenny/i386, lenny/amd64, etc.. I am sure that this used to work, but
> with the schroot current I get this error message if any entry in the
> schroot.conf contains a slash:
> 
>     E: boost::too_many_args: format-string referred to less arguments than were passed
> 
> From the message, it is not clear at all what is wrong with my
> configuration here.
> 
> I get the same message when any name contains whitespace.

Thanks for letting me know.  It looks like the following patch should
fix things:

diff --git a/sbuild/sbuild-chroot.cc b/sbuild/sbuild-chroot.cc
index d4bba19..c15f5e1 100644
--- a/sbuild/sbuild-chroot.cc
+++ b/sbuild/sbuild-chroot.cc
@@ -214,9 +214,7 @@ sbuild::chroot::set_name (std::string const& name)
   if (!is_valid_sessionname(name))
     {
       error e(name, NAME_INVALID);
-      format fmt("Only alphanumeric characters, underscores and hyphens are all
-      fmt % chroot_config::namespace_separator;
-      e.set_reason(fmt.str());
+      e.set_reason("Only alphanumeric characters, underscores and hyphens are a
       throw e;
     }
 
We recently increased the strictness of the allowed names of chroots
because they must also be valid filenames and so slashes are not
allowed.  While spaces are OK, we've restricted names so they also
work with run-parts(8) and so they are required to match the
regular expression

  static regex file_namespace("^[a-zA-Z0-9][a-zA-Z0-9_-]*$");

which the error reason should have showed you, only there was an error
in using a format string where a plain string should have been used.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20100828/80593586/attachment.pgp>


More information about the Buildd-tools-devel mailing list