Re: does numeric only name of jails not allowed (bug?)
- In reply to: Anthony Pankov : "Re: does numeric only name of jails not allowed (bug?)"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 09 Aug 2025 20:09:43 UTC
Hi,
Well, now I could agree it's seems to be a bug (until something more is known).
On Sat, 9 Aug 2025 13:23:59 +0300
Anthony Pankov <anthony.pankov@yahoo.com> wrote:
> Hello Vadim,
>
> Unfortunetly it does not work:
>
> root@builderhost:/ws/a7777 # jail -c 47777
> jail: 47777: host.hostname: variable "name" not found
> jail: 47777: exec.consolelog: variable "name" not found
>
> root@builderhost:/ws/a7777 # head embedding/jail-a7777.conf
> ...
> "47777" {
> host.hostname = "${name}";
> ...
>
>
> Friday, August 8, 2025, 8:04:12 PM, you wrote:
>
> > 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