From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 12 02:40:01 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEF5F106564A for ; Thu, 12 Jul 2012 02:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 218288FC0C for ; Thu, 12 Jul 2012 02:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6C2e1mW023287 for ; Thu, 12 Jul 2012 02:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6C2e0vQ023286; Thu, 12 Jul 2012 02:40:01 GMT (envelope-from gnats) Resent-Date: Thu, 12 Jul 2012 02:40:01 GMT Resent-Message-Id: <201207120240.q6C2e0vQ023286@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Arnaud Lacombe Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1BD8A1065672 for ; Thu, 12 Jul 2012 02:31:04 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 0737A8FC15 for ; Thu, 12 Jul 2012 02:31:04 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6C2V3uT000108 for ; Thu, 12 Jul 2012 02:31:03 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q6C2V34N000106; Thu, 12 Jul 2012 02:31:03 GMT (envelope-from nobody) Message-Id: <201207120231.q6C2V34N000106@red.freebsd.org> Date: Thu, 12 Jul 2012 02:31:03 GMT From: Arnaud Lacombe To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/169796: kenv(1) output is unreadable X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 02:40:02 -0000 >Number: 169796 >Category: misc >Synopsis: kenv(1) output is unreadable >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jul 12 02:40:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Arnaud Lacombe >Release: many. >Organization: n/a >Environment: FreeBSD coltar 9.0-STABLE FreeBSD 9.0-STABLE >Description: Output of kenv(1) is not escaped to be safely usable on terminals. Depending their content, variable value might end up being interpreted as terminal command. On 9.0-stable, we ends up having the following being output: LINES="24" ansi_caption[1]="ESC[1mBESC[37moot ESC[1m[ENTER]ESC[37m" ansi_caption[2]="ESC[1mEscESC[37mape to loader prompt" ansi_caption[4]="ESC[1mAESC[37mCPI Support: ESC[34;1mDisabledESC[37m" ansi_caption[5]="Boot Safe ESC[1mMESC[37mode: ESC[34;1mNOESC[37m" ansi_caption[6]="Boot ESC[1mSESC[37mingle User: ESC[34;1mNOESC[37m" ansi_caption[7]="Boot ESC[1mVESC[37merbose: ESC[34;1mNOESC[37m" bootfile="kernel" comconsole_speed="115200" console="comconsole" currdev="disk0p2:" Of course, ESC are not escaped and result in kenv(1)'s being unreadable. >How-To-Repeat: # kenv >Fix: escape variable content not to be interpreted as terminal command. >Release-Note: >Audit-Trail: >Unformatted: