Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Nov 2015 11:40:57 +0300
From:      Sergey Zakharchenko <doublef.mobile@gmail.com>
To:        Mateusz Guzik <mjguzik@gmail.com>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: Docker: jail: name cannot be numeric fix
Message-ID:  <CADYCxoMcsmYZ1ghOdq8pNjD8-d_q33_9qJUZeEOC0NhGzi2K6g@mail.gmail.com>
In-Reply-To: <CADYCxoPUQ6EpHGpeVwwPnTt6k2NqfhkZDGRkWSCj6LqEQ%2BZuVw@mail.gmail.com>
References:  <CADYCxoOGAyBe=bzxX0OB=q4N6qM7ZcnP1-oKbEGmYjy9pQMVww@mail.gmail.com> <20151027145033.GA24588@dft-labs.eu> <CADYCxoPUQ6EpHGpeVwwPnTt6k2NqfhkZDGRkWSCj6LqEQ%2BZuVw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2015-10-27 19:12 GMT+03:00 Sergey Zakharchenko <doublef.mobile@gmail.com>:
> Mateusz,
>
>> What's the significance of said names?
>
> None that I know of; I'm new to Docker so I might be wrong though.
>
>> The issue here is that said id may contain to letters, effectivley
>> looking like a number
>
> ..the probability of that being (10/16)^12, which isn't too high but still
> significant...

A funny thing: Docker source (function GenerateRandomID in
pkg/stringid/stringid.go) actually checks for a fully numeric ID and
avoids it, because it causes other problems:

        // if we try to parse the truncated for as an int and we don't have
        // an error then the value is all numberic and causes issues when
        // used as a hostname. ref #3869

So the probability I mentioned is if fact zero and, ironically, fixing
this small kernel bug could actually 'unbreak' Docker. Adjusting
GenerateRandomID in the FreeBSD Docker port is another option,
possibly faster to get into production.

Best regards,

-- 
DoubleF



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADYCxoMcsmYZ1ghOdq8pNjD8-d_q33_9qJUZeEOC0NhGzi2K6g>