[Bug 268377] jail -cr <jail> fails to set ipv6-address alias with ifconfig under certain conditions

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 14 Dec 2022 17:01:08 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268377

            Bug ID: 268377
           Summary: jail -cr <jail> fails to set ipv6-address alias with
                    ifconfig under certain conditions
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: ahkithaama@proton.me

I have a jail-Configuration in /etc/jail.conf:

testjail {
    exec.start = "/bin/sh /etc/rc";
    exec.stop = "/bin/sh /etc/rc.shutdown";
    exec.clean;
    host.hostname = "testjail";
    path = "/VMs/jails/$name";
    interface = "msk0";
    ip6.addr = "fd9e:21a7:a92c:2323::1/40";
    mount = "/tmp  $path/tmp  nullfs  rw 0 0";
}


If I start the jail with
  jail -c testjail
-> No problem

If I stop the jail with
  jail -r testjail
-> No problem

If I restart a running jail with
  jail -cr testjail
-> I get following error:
testjail: run command: /sbin/ifconfig msk0 inet6 fd9e:21a7:a92c:2323::1/40 >
alias
ifconfig: >: bad value
jail: testjail: /sbin/ifconfig msk0 inet6 fd9e:21a7:a92c:2323::1/40 > alias:
failed

There's a invalid character ('>') in the ifconfig line.
Where it come from? I don't know.

The failure will not occur if I delete the "mount"-Line from the Configuration
(It doesn't matter have a 'mount'-Line or 'mount.fstab').

The failure will also not occur if I append the ifconfig-Parameter
'description' at the end of 'ip6-addr' like:
ip6.addr = "fd9e:21a7:a92c:2323::1/40 description a";

And the failure will only happen with ip6.addr
The same with ip4.addr is not a problem.

It seems to me there is a problem with string handling in the jail command.

-- 
You are receiving this mail because:
You are the assignee for the bug.