vm.conf(5) states it must be `owner user[:group]' or `owner group', not
specifying a value is undocumented and ought to be invalid syntax, yet
`owner' is treated as `owner root' which is the same as simply omitting
the owner line.

Diff below causes the following behaviour change:

        $ cat socket-owner.conf
        socket owner
        $ vmd -nf socket-owner.conf
        configuration OK
        $ ./obj/vmd -nf socket-owner.conf
        socket-owner.conf:1: syntax error

        $ cat vm-owner.conf
        vm v {
                disk /dev/null
                owner
        }
        $ vmd -nf vm-owner.conf          
        configuration OK
        $ ./obj/vmd -nf vm-owner.conf    
        vm-owner.conf:3: syntax error

Feedback? OK?

Index: parse.y
===================================================================
RCS file: /cvs/src/usr.sbin/vmd/parse.y,v
retrieving revision 1.52
diff -u -p -r1.52 parse.y
--- parse.y     14 May 2019 06:05:45 -0000      1.52
+++ parse.y     5 Dec 2019 19:30:10 -0000
@@ -545,11 +545,7 @@ instance_flags     : BOOT          { vmc.vmc_insflag
                }
                ;
 
-owner_id       : /* none */            {
-                       $$.uid = 0;
-                       $$.gid = -1;
-               }
-               | NUMBER                {
+owner_id       : NUMBER                {
                        $$.uid = $1;
                        $$.gid = -1;
                }

Reply via email to