<div dir="ltr">Just a remark...<div><br></div><div>When I start a container via the Python bindings (version <code>1.0.6-0ubuntu0.1</code> on Ubuntu trusty) I get the following message:</div><div><br></div><div> lxc_container: simple_container is too long (>= 16)</div><div><br></div><div>I cannot reproduce this by calling lxc-start directly but if there will be a patch to check the name, please allow names longer than 16 characters - because of the common use case mentioned by <span style="font-size:13px">Stéphane: container name == hostname (or even fqdn).</span></div><div><br></div><div>The message probably originates here:</div><div><br></div><div> <a href="https://github.com/lxc/lxc/blob/ec64264d78d4ed608553842ce9e1f07eeab2a032/src/lxc/confile.c#L265">https://github.com/lxc/lxc/blob/ec64264d78d4ed608553842ce9e1f07eeab2a032/src/lxc/confile.c#L265</a><br></div><div><br></div><div>Regards,</div><div><br></div><div>BB</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 18, 2014 at 4:42 PM, Serge Hallyn <span dir="ltr"><<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Agreed. Would you mind coming up with a proposed patch to be stricter at<br>
lxcapi_create() and sending it out?<br>
<div class="HOEnZb"><div class="h5"><br>
Quoting Joel Nider (<a href="mailto:JOELN@il.ibm.com">JOELN@il.ibm.com</a>):<br>
> I would strongly suggest to nail this down now since the question came up.<br>
> This is the kind of issue that could create security bugs later on (when<br>
> different parts of the code check for valid names in different ways, or<br>
> don't check at all). Stephane's suggestion of a 64 ASCII character string<br>
> that forms a valid Linux hostname sounds good to me - is this formally<br>
> defined somewhere?<br>
><br>
> Regards,<br>
><br>
> Joel<br>
><br>
> "lxc-devel" <<a href="mailto:lxc-devel-bounces@lists.linuxcontainers.org">lxc-devel-bounces@lists.linuxcontainers.org</a>> wrote on<br>
> 16/12/2014 05:22:05 PM:<br>
><br>
> > From: Stéphane Graber <<a href="mailto:stgraber@ubuntu.com">stgraber@ubuntu.com</a>><br>
> > To: LXC development mailing-list <<a href="mailto:lxc-devel@lists.linuxcontainers.org">lxc-devel@lists.linuxcontainers.org</a>><br>
> > Date: 16/12/2014 05:22 PM<br>
> > Subject: Re: [lxc-devel] Valid Container Names/Identifiers<br>
> > Sent by: "lxc-devel" <<a href="mailto:lxc-devel-bounces@lists.linuxcontainers.org">lxc-devel-bounces@lists.linuxcontainers.org</a>><br>
> ><br>
> > On Tue, Dec 16, 2014 at 10:36:13AM +0100, Till Walter wrote:<br>
> > > Dear LXC Developers,<br>
> > ><br>
> > > the manual page of lxc-create states that "The container identifier<br>
> > > format is an alphanumeric string". Yet besides [A-Za-z0-9] other<br>
> > > characters like underscore are also fine.<br>
> > > I had a brief look at the source but did not find any check, e.g.,<br>
> > > using a regex. Is there any check at all? What are valid container<br>
> > > identifiers/names?<br>
> > > I am asking because I am using the official python bindings to write a<br>
> > > little utility and want to avoid container naming problems that may<br>
> > > arise.<br>
> > ><br>
> > > Best regards,<br>
> > ><br>
> > > BB<br>
> ><br>
> > So LXC itself doesn't really have a definition for valid names, however<br>
> > since the name is typically used for the container's hostname, you<br>
> > should stick to what's considered a valid hostname on Linux.<br>
> ><br>
> > There's a POSIX RFC for that but IIRC it's basically 64 chars ASCII.<br>
> ><br>
> > --<br>
> > Stéphane Graber<br>
> > Ubuntu developer<br>
> > <a href="http://www.ubuntu.com" target="_blank">http://www.ubuntu.com</a><br>
> > [attachment "signature.asc" deleted by Joel Nider/Haifa/IBM]<br>
> > _______________________________________________<br>
> > lxc-devel mailing list<br>
> > <a href="mailto:lxc-devel@lists.linuxcontainers.org">lxc-devel@lists.linuxcontainers.org</a><br>
> > <a href="http://lists.linuxcontainers.org/listinfo/lxc-devel" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-devel</a><br>
><br>
> _______________________________________________<br>
> lxc-devel mailing list<br>
> <a href="mailto:lxc-devel@lists.linuxcontainers.org">lxc-devel@lists.linuxcontainers.org</a><br>
> <a href="http://lists.linuxcontainers.org/listinfo/lxc-devel" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-devel</a><br>
_______________________________________________<br>
lxc-devel mailing list<br>
<a href="mailto:lxc-devel@lists.linuxcontainers.org">lxc-devel@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-devel" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-devel</a><br>
</div></div></blockquote></div><br></div>