Re: does numeric only name of jails not allowed (bug?)
Date: Fri, 08 Aug 2025 17:04:12 UTC
On Wed, 6 Aug 2025 17:37:36 +0300
Anthony Pankov <anthony.pankov@yahoo.com> wrote:
> It seems there is no sign that numeric only name is prohibited:
>
> "
> The jail name. This is an arbitrary string that identifies a
> jail (except it may not contain a ďż˝.ďż˝).
> "
>
> But
> # head jail-47777.conf
> ...
> 47777 {
> host.hostname = "${name}";
> ...
>
> # jail -c 47777
> jail: 47777: host.hostname: variable "name" not found
>
> If I add letter prefix, say w47777, it worked.
>
> Because of strange error "variable "name" not found" it seems like a bug.
> Does it?
This is of course not a bug, because how would you distinguish identifiers
from numbers in grammar, then? jail.conf(5) documents:
String format
Parameter values, including jail names, can be single tokens or quoted
strings. A token is any sequence of characters that aren't considered
special in the syntax of the configuration file (such as a semicolon or
whitespace). If a value contains anything more than letters, numbers,
dots, dashes and underscores, it is advisable to put quote marks around
that value. Either single or double quotes may be used.
So you could try to just write "47777" { param = "value"; ...
--
WBR, @nuclight