jail name is interpreted as jid when numeric

Jamie Gritton jamie at FreeBSD.org
Fri Mar 23 14:59:17 UTC 2012


It might seem clear with the dot-separated names that asd.asd.1 isn't
the same as jail 1. But looking from the viewpoint of asd.asd, that jail
would simply be "1". As jails may be referred to by either number or
name, it made sense to exclude jails whose name was a number, except in
the special case of it being the same as the jid. Otherwise there's the
confusion of a jail having two different numbers (one really being a
name), or of a number referring to two different jails.

So while this does seem to break the dot-separate namespace concept,
it's necessary because jails aren't always referred to by the full
hierarchical name.

- Jamie


On 03/22/12 11:18, Nikos Vassiliadis wrote:
> I found this somehow strange behavior and I am reporting it
> just to hear your opinions.
>
>> lab# jail -c name=asd persist
>> lab# jail -c name=asd.asd persist
>
> asd is interpreted as jail asd.asd
>
>> lab# jail -c name=asd.asd.1 persist
>> jail: jail 1 already exists
>
> 1 is interpreted as jail 1
>
> This has to do with the fact that a numeric name is interpreted as jid
> and this breaks the dot-seperated hierarchical jails concept.
> I find this behavior somehow strange. Is it intended or it's bug?
>
> Thanks for your insights, Nikos


More information about the freebsd-jail mailing list