From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 6 20:47:37 2015 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58414840 for ; Tue, 6 Jan 2015 20:47:37 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A62E79E for ; Tue, 6 Jan 2015 20:47:37 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t06KlbDK069523 for ; Tue, 6 Jan 2015 20:47:37 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 196574] Bug in parsing jail.conf Date: Tue, 06 Jan 2015 20:47:37 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: 10.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: logik@centrum.cz X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jan 2015 20:47:37 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196574 Bug ID: 196574 Summary: Bug in parsing jail.conf Product: Base System Version: 10.1-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: conf Assignee: freebsd-bugs@FreeBSD.org Reporter: logik@centrum.cz It seems to me, that when one redefines $name variable in jail.conf, the jail command begin misbehave: i get strange results as - segmentation fault - bad variables substitution $name = something $ip_addr = "192.168.6.210" $ip = 210 "/sbin/ifconfig epair${ip}b inet ${ip_addr} up" results in running "/sbin/ifconfig epair210b ine192.168.6.210t up" - or other strange errors vnet.interface = epair210b results in calling ifconfig epair210b vnet (instead of ifconfig epair210b vnet ) which naturaly failed on ifconfig: 'vnet' requires argument o even in some cases ifconfig epair210b vnet I think, that the best bugfix is to forbid to change predefined variables as $name. ----------------------------------------------------------------------------- jail.conf, that causes one of described errors (ifconfig: 'vnet' requires argument), when calling: jail -c dhcp * { exec.start = "/bin/bash /etc/rc"; exec.stop = "/bin/bash /etc/rc.shutdown"; exec.consolelog = "/var/log/jail/$name"; path = "/usr/jails/$name"; mount.fstab = "/etc/jail.fstab/$name"; host.hostname = "$name.dionyska.cz"; devfs_ruleset = "4"; mount.devfs; mount.fdescfs; $ip_addr = "192.168.6.${ip}" ; } dhcp { $name='dhcp'; $ip = "210" ; $ip_route = "192.168.6.1" ; vnet; vnet.interface = "epair${ip}b"; exec.prestart = "ifconfig epair${ip}a destroy 2>/dev/null || true"; exec.prestart += "ifconfig epair$ip create up"; exec.prestart += "ifconfig bridge0 addm epair${ip}a"; exec.start = "/sbin/ifconfig lo0 127.0.0.1 up"; exec.start += "/sbin/ifconfig epair${ip}b inet 192.168.6.210 up" ; exec.start += "/sbin/route add default $ip_route " ; exec.start += "/bin/sh /etc/rc"; exec.poststop = "ifconfig bridge0 delem epair${ip}"; exec.poststop = "ifconfig epair${ip}a destroy " ; persist; devfs_ruleset=5 ; allow.raw_sockets=1 ; allow.socket_af = 1; } -- You are receiving this mail because: You are the assignee for the bug.