From owner-svn-src-head@freebsd.org Mon Feb 18 04:11:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE0C014F1F88 for ; Mon, 18 Feb 2019 04:11:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (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 0CBBF7367C for ; Mon, 18 Feb 2019 04:11:17 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1550463008; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=tmOv4PTWVZW1oq8V0y8QsEtvVtqTOp6qlTX4saCgIvt2p1A9eVKdEnQQGaJExXlq/6+01T7OXpIKz fpeBPhWCDPhZgPquvvpuRGmgOuzYsvP74W4dTQVNdnrLZ5D8NnqrI2hxtp/SxzYfBG/XwAjhPEafxU lt2nlp1LeGOE8zpbM3CibiumczjIvvhLb/+5tIqgxrNLqBRFelDb2X08iOz7ZzhXK7aky+NfF8BQhD zZvbOoInUVXpDNnFKi5IkUIccYeLneD68zzoQz/IgXjeePhtUA1PS/DwmCykxVCffJ6QrPO0pRXkVI LldIBa3OfqcDLYajTqIGcCfbspHwk2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=yk73LEpTyTpsSE+8BK2q2UeOHCgzcmvcxQumIXJMnHY=; b=I8wGST9o2tdEZHzQYUPAxLrx1kEd2V3E8fJHByMk8P6eiSfEuQc2Aj0HBEAT2YB7//wKzbZneqBbd 3TBK8rdj65hAwjeKuy1g9gPu78uRHjyhSEUWgZpspS40R7KLvjysTNGUQtx3otYwcOEocgKZwXtuWD u4PRQ5ANYqbkPkONHoykL73kWhcm3rHKvZQhlf9srueVjw4Qcj3vid/C7/sw+dqfz3Fab16zDmat3R xKBbx56kl3JEpa+sMt1sqJf22yih7XGR1nIGtccG/alsylndzEBDvFJtJHNQgbUwoXg3DbImKrSOqS su+x5NvKx5qRIGDcQIvGjTpaYAhvjyw== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=yk73LEpTyTpsSE+8BK2q2UeOHCgzcmvcxQumIXJMnHY=; b=P/fe3PPVxhnnMRgjSoc0hSQo3P/Ly2b91l3VCv/UNJ9tqsAyNRb15ZyzyydPg8/uGw+KTFJGPMnGj DT/AOFLdQoytLnMuzefTOuP200tMI4VclYtroZCu24frPLFPU/u0hocCZTN46Jbg3x0HQ2bNijAvet /OXDkd9zLg7oF/xXgG8OV8XrsfJeI637YJOQIC80AZZkAqnNZYLArx3KbjljcG59xlaebQtVibwJzD cdyjYr9ZNcm9DjOXxYle/XBL0+kcOuNhqhW4dCYC7kov3mta/ajhVrW8jpZfx7L7m3yMB2s6pVGXTu tfiD5fDzgNqpxqMc98KMtSjp5X0Ty3A== X-MHO-RoutePath: aGlwcGll X-MHO-User: 12eb1e51-3333-11e9-befd-af03bedce89f X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 12eb1e51-3333-11e9-befd-af03bedce89f; Mon, 18 Feb 2019 04:10:07 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x1I4B9uf076837; Sun, 17 Feb 2019 21:11:09 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r344243 - head/stand/lua From: Ian Lepore To: rgrimes@freebsd.org, Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 17 Feb 2019 21:11:09 -0700 In-Reply-To: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0CBBF7367C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 04:11:19 -0000 On Sun, 2019-02-17 at 19:41 -0800, Rodney W. Grimes wrote: > > On Sun, Feb 17, 2019 at 9:00 PM Kyle Evans > > wrote: > > > > > > Author: kevans > > > Date: Mon Feb 18 02:59:47 2019 > > > New Revision: 344243 > > > URL: https://svnweb.freebsd.org/changeset/base/344243 > > > > > > Log: > > > lualoader: only clear the screen before first password prompt > > > > > > This was previously an unconditional screen clear, regardless > > > of whether or > > > not we would be prompting for any passwords. This is pointless, > > > given that > > > the screen clear is only there to put our screen into a > > > consistent state > > > before we draw the prompts and do cursor manipulation. > > > > > > This is also the only screen clear besides that to draw the > > > menu. One can > > > now see early pre-loader and loader output with the menu > > > disabled, which may > > > be useful for diagnostics. > > > > > > Reported by: ian > > > MFC after: 3 days > > > > > > Modified: > > > head/stand/lua/password.lua > > > > > > Modified: head/stand/lua/password.lua > > > ================================================================= > > > ============= > > > --- head/stand/lua/password.lua Mon Feb 18 01:57:47 > > > 2019 (r344242) > > > +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 > > > 2019 (r344243) > > > @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect > > > password > > > -- Asterisks as a password mask > > > local show_password_mask = false > > > local twiddle_chars = {"/", "-", "\\", "|"} > > > +local screen_setup = false > > > > > > -- Module exports > > > function password.read(prompt_length) > > > @@ -80,14 +81,18 @@ function password.read(prompt_length) > > > end > > > > > > function password.check() > > > - screen.clear() > > > - screen.defcursor() > > > -- pwd is optionally supplied if we want to check it > > > local function doPrompt(prompt, pwd) > > > local attempts = 1 > > > > > > local function clear_incorrect_text_prompt() > > > printc("\r" .. string.rep(" ", > > > #INCORRECT_PASSWORD)) > > > + end > > > + > > > + if not screen_setup then > > > + screen.clear() > > > + screen.defcursor() > > > + screen_setup = true > > > end > > > > > > while true do > > > > > > > I noted in testing that this may look kinda funky if you have > > neither > > a bootlock password or GELi prompt done by loader(8), but you have > > a > > loader password. The autoboot text gets blown away by the > > subsequent > > clear screen. I'd be interesting in feedback as to whether this > > looks > > odd or how important it is that the autoboot text remains intact, > > as > > it's an easy fix to retain it. > > Personally I would like to see all screen clears go away, > as they always seem to wipe out the very diagnostic output > that would tell you what went wrong. > > If possible, instead of clearing the screen, we should go to the > bottom and scroll it upwards, drawing new things and scrolling > old things off the top. > > screen clear == evil, unless specifically requested by the user. > Screen clear before drawing the menu makes sense. What I noticed is that the screen was still clearing even with beastie_disable=YES. Clearing before prompting for passwords seems like a marginal case... as Kyle mentioned, you've got to get the screen into a known state so that not-echoing the typed pw works reliably. -- Ian