From owner-freebsd-sysinstall@freebsd.org Wed Nov 23 16:33:50 2016 Return-Path: Delivered-To: freebsd-sysinstall@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD8BC51431 for ; Wed, 23 Nov 2016 16:33:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 3F106DDE for ; Wed, 23 Nov 2016 16:33:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uANGXnbN063578 for ; Wed, 23 Nov 2016 16:33:50 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-sysinstall@FreeBSD.org Subject: [Bug 211523] [bsdinstall] Hardening menu option "kern.randompid" not written to cfg Date: Wed, 23 Nov 2016 16:33:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-BETA3 X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: brueffer@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-sysinstall@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2016 16:33:50 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211523 Christian Brueffer changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|New |Closed CC| |brueffer@FreeBSD.org --- Comment #2 from Christian Brueffer --- Fixed in HEAD (r303877) and and 11-STABLE (r304921) a while back. Thanks f= or the submission! --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-sysinstall@freebsd.org Thu Nov 24 14:11:08 2016 Return-Path: Delivered-To: freebsd-sysinstall@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D5A5C51862 for ; Thu, 24 Nov 2016 14:11:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 1C35F866 for ; Thu, 24 Nov 2016 14:11:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uAOEB75v071097 for ; Thu, 24 Nov 2016 14:11:07 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-sysinstall@FreeBSD.org Subject: [Bug 202058] bsdinstall - Disable dialog(3) for distfetch/checksum/distextract targets Date: Thu, 24 Nov 2016 14:11:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: ganael.laplanche@corp.ovh.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-sysinstall@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 14:11:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D202058 Ganael LAPLANCHE changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159488|0 |1 is obsolete| | --- Comment #2 from Ganael LAPLANCHE --- Created attachment 177357 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D177357&action= =3Dedit Patch for -CURRENT (r309088) --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-sysinstall@freebsd.org Thu Nov 24 14:11:49 2016 Return-Path: Delivered-To: freebsd-sysinstall@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84A66C518BB for ; Thu, 24 Nov 2016 14:11:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 7417090B for ; Thu, 24 Nov 2016 14:11:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uAOEBnGw075309 for ; Thu, 24 Nov 2016 14:11:49 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-sysinstall@FreeBSD.org Subject: [Bug 202058] bsdinstall - Disable dialog(3) for distfetch/checksum/distextract targets Date: Thu, 24 Nov 2016 14:11:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: ganael.laplanche@corp.ovh.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-sysinstall@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 14:11:49 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D202058 --- Comment #3 from Ganael LAPLANCHE --- Hi, I am not sure to understand your comment. Only the 'distfetch', 'checksum' = and 'distextract' targets are fixed by that patch. I've attached an updated version of the patch (that builds successfully on r309088). Best regards, Ganael. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-sysinstall@freebsd.org Thu Nov 24 20:24:42 2016 Return-Path: Delivered-To: freebsd-sysinstall@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E93D6C54AF5 for ; Thu, 24 Nov 2016 20:24:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 CD5982FC for ; Thu, 24 Nov 2016 20:24:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uAOKOe2T020099 for ; Thu, 24 Nov 2016 20:24:42 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-sysinstall@FreeBSD.org Subject: [Bug 202058] bsdinstall - Disable dialog(3) for distfetch/checksum/distextract targets Date: Thu, 24 Nov 2016 20:24:41 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dteske@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-sysinstall@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 20:24:43 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D202058 Devin Teske changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dteske@FreeBSD.org --- Comment #4 from Devin Teske --- Apologies for not picking this up off of -sysinstall@ (I'm sure I was CC'd,= but I am quite a busy gal). Using "nonInteractive" to achieve what you want is not historically accurate with the use of the variable in both bsdconfig and sysinstall. In bsdconfig, you can see its use by executing the following: $ grep -nrs --color '\(VAR_NONINTERACTIVE\|nonInteractive\)' /usr/share/bsdconfig And for sysinstall (from base/stable/9/usr.sbin/sysinstall/): $ grep -Inrs --color '\(VAR_NONINTERACTIVE\|nonInteractive\)' ~/src/freebsd_svn/base/stable/9/usr.sbin/sysinstall NB: You may have your stable/9 sources elsewhere And for bsdinstall grep -Inrs --color '\(VAR_NONINTERACTIVE\|nonInteractive\)' /usr/libexec/bsdinstall Any grep above should indicate that VAR_NONINTERACTIVE (nonInteractive; configurable in source) doesn't actually disable dialog. It disables prompts for information. That is to explain: When nonInteractive is NULL or unset, you can be prompted. When nonInteractive is set and non-NULL (e.g., 1), you'll get an error if required information is not provided in your script. NB: sysinstall was essentially split in twain; install bits to bsdinstall, configure bits to bsdconfig. I'm all-for teaching bsdinstall to use $nonInteractive more often. However,= its purpose is not to disable dialog, just disable prompts which can hang up scripts because nobody is there to answer the prompt. ASIDE: By the way, I'm super impressed that your patch included the use of DPV_DISPLAY_STDOUT ;D (you're thorough, and I like that). Getting back to the issue at-hand... I think the appropriate solution is to: 1. Add support for HAVE_DIALOG (see SVN r307802 -- link below) NB: That will dove-tail nicely into the following work(s)... https://svnweb.freebsd.org/base?view=3Drevision&revision=3D307802 [bapt+ema= ste] https://svnweb.freebsd.org/base?view=3Drevision&revision=3D306648 [emaste] https://svnweb.freebsd.org/base?view=3Drevision&revision=3D306375 [emaste+d= teske] 2. Use printf when HAVE_DIALOG is unset and optionally... 3. Add a command-line flag that inhibits the use of dialog in the same mann= er as using WITHOUT_DIALOG to compile-out the HAVE_DIALOG sections. You can see from the above SVN revisions: a. First came r306375; we wanted to introduce WITHOUT_DIALOG; that caused u= s to have to disable bsdinstall, bsdconfig, dpv, and tzsetup b. However, bapt made tzsetup work without dialog in SVN r307802 paving the= way to have it re-enabled permanently And you've correctly identified that both dpv(3) and dpv(1) support non-dia= log interfaces (e.g., stdout via DPV_DISPLAY_STDOUT for dpv(3) and for dpv(1), = the `-d' flag). If, with your help, we can add "#ifdef HAVE_DIALOG" support to the bsdinsta= ll components that you correctly identified as needing it (distfetch, checksum, and distextract) and I help fix all the shell code, we could get these components working in a dialog-less world. What do you think? --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-sysinstall@freebsd.org Thu Nov 24 20:34:20 2016 Return-Path: Delivered-To: freebsd-sysinstall@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2BDC54FE1 for ; Thu, 24 Nov 2016 20:34:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 3651CE32 for ; Thu, 24 Nov 2016 20:34:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uAOKYIUr040831 for ; Thu, 24 Nov 2016 20:34:18 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-sysinstall@FreeBSD.org Subject: [Bug 202058] bsdinstall - Disable dialog(3) for distfetch/checksum/distextract targets Date: Thu, 24 Nov 2016 20:34:19 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dteske@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-sysinstall@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 20:34:20 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D202058 --- Comment #5 from Devin Teske --- The way that I have in-mind with how to support WITHOUT_DIALOG for the shell code (which is not compiled, unlike the C code): a. When WITHOUT_DIALOG is unset and unused, install the normal "dialog.subr" which provides all the f_dialog_*() shell functions, using dialog(1) b. When WITHOUT_DIALOG is set in src.conf(5) and present when usr.sbin/bsdconfig/Makefile is processed, install an "anti_dialog.subr" (na= me pending) that provides the same functions but use printf/f_err/etc. to stdo= ut instead of dialog. That way we don't have to go changing massive amounts of shell code and all the f_dialog_msgbox/f_show_msg/etc. invocations will sti= ll work as-expected. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-sysinstall@freebsd.org Fri Nov 25 10:02:32 2016 Return-Path: Delivered-To: freebsd-sysinstall@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E39BC5439F for ; Fri, 25 Nov 2016 10:02:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 0D660CC8 for ; Fri, 25 Nov 2016 10:02:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uAPA2UMu097937 for ; Fri, 25 Nov 2016 10:02:31 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-sysinstall@FreeBSD.org Subject: [Bug 202058] bsdinstall - Disable dialog(3) for distfetch/checksum/distextract targets Date: Fri, 25 Nov 2016 10:02:30 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: ganael.laplanche@corp.ovh.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-sysinstall@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 10:02:32 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D202058 --- Comment #6 from Ganael LAPLANCHE --- Hi Devin, Thank you very much for your answer. There may be a misunderstanding (the title of my PR is propably inaccurate): the goal of my patch is not to disable the need for dialog(3) at build time= . My initial -exact- need is to be able to run the tools over a SSH session with= out a tty, but *without having to recompile the tools with a specific option*, = so we are mostly dealing with you suggestion 3 here. Making the tools build WITHOUT_DIALOG is (in my opinion) a step further that can be achieved later. Anyway, you're right, the 'nonInteractive' env variable is not appropriate everywhere in my patches: sometimes it is used to prevent dialog_msgbox(,,,,TRUE) from waiting for "OK" to be pressed after an error message and sometimes it is also used to disable infoboxes or general dialo= g(3) code. In the first case, I think it is OK, as pressing "OK" is an interacti= ve action. In the second case, we should probably introduce a way to disable dialog(3) and use printf() instead. So the patch should probably be re-written to split the modifications in two kinds: - the ones that really disable interactivity (dialog_msgbox(,,,,TRUE)) =3D>= can be left as is IMHO - the ones that really only deal with dialog(3) stuff =3D> to be reworked. = For that purpose, we could introduce a new env variable ($noDialog ?) to keep t= he global spirit of the tools. Finaly, there is probably a relationship between the two variables : /* ---- */ static uint8_t interactive =3D 1; static uint8_t dialog =3D 1; if (getenv("noDialog") !=3D NULL) { interactive =3D 0; dialog =3D 0; } if (getenv("nonInteractive") !=3D NULL) { interactive =3D 0; } /* ---- */ Does that seem reasonable to you ? For the 'checksum' script, we could do the same kinds of modifications. E.g= ., for the second chunk : + if f_dialog; then + dialog --backtitle "FreeBSD Installer" --title "Checksum Verificati= on" \ + --mixedgauge "Verifying checksums of selected distributions." \ + 0 0 $percentage $items + else + printf "Verifying checksum of %s\n" "$dist" + fi The third and last chunk should probably be rewritten that way : + if f_interactive; then + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 + else + if f_dialog; then + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --infobox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 + else + f_err "The checksum for %s does not match. It may have beco= me corrupted, and should be redownloaded.\n" "$dist" + fi + fi Not sure if f_dialog is well-chosen but you get the idea... Regards, Ganael. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-sysinstall@freebsd.org Fri Nov 25 22:50:00 2016 Return-Path: Delivered-To: freebsd-sysinstall@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D41CC54342 for ; Fri, 25 Nov 2016 22:50:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 13702152 for ; Fri, 25 Nov 2016 22:50:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uAPMnxpm030284 for ; Fri, 25 Nov 2016 22:49:59 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-sysinstall@FreeBSD.org Subject: [Bug 202058] bsdinstall - Disable dialog(3) for distfetch/checksum/distextract targets Date: Fri, 25 Nov 2016 22:49:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dteske@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-sysinstall@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 22:50:00 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D202058 --- Comment #7 from Devin Teske --- I recommend the following: For C code, we should be using isatty(3) on stdout (fd=3D1) to determine wh= ether we use dialog(3) vs printf(3). For shell code, we should be using stty(1) to determine whether we use dialog(1) vs f_err()/printf(1). It doesn't make sense to use dialog(1,3) when stdout is not a TTY, so the c= ode should dynamically detect this situation and adjust accordingly (no need for setting a variable). For distfetch, distextract, and cksum, your printf's are good-to-go, but the conditional should be something like "if (notty)" which would be set when isatty(3) tells us that fd=3D1 is not a TTY. For bsdconfig, I would like to teach /usr/share/bsdconfig/dialog.subr to te= st for TTY on include (e.g., ``stty >&- 2>&- || setvar $VAR_NOTTY 1''*) and if set, dialog.subr would use f_err()/printf(1) instead of dialog(1). Then all= the other code could rely on f_dialog_* without having to address each invocati= on. It would be rather slick if we allowed the environment to override the defa= ult interpretation. That is to explain: If fd=3D1 is not a TTY (in C) or stty(1) reports error (in sh), default to = using printf(1,3). An environment variable (I suggest $noTty, $VAR_NOTTY), if set= and non-NULL overrides the default setting. In fact, if set, don't even perform= the isatty(3)/stty(1) test. * in /usr/share/bsdconfig/variable.subr we would add a "f_variable_new VAR_NOTTY noTty" --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-sysinstall@freebsd.org Fri Nov 25 22:55:23 2016 Return-Path: Delivered-To: freebsd-sysinstall@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1107C54572 for ; Fri, 25 Nov 2016 22:55:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 C074F68B for ; Fri, 25 Nov 2016 22:55:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uAPMtN96044750 for ; Fri, 25 Nov 2016 22:55:23 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-sysinstall@FreeBSD.org Subject: [Bug 202058] bsdinstall - Disable dialog(3) for distfetch/checksum/distextract targets Date: Fri, 25 Nov 2016 22:55:23 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dteske@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-sysinstall@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 22:55:23 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D202058 --- Comment #8 from Devin Teske --- I still need to make sure that we build upon bapt, emaste, and my own work = thus far with respect to the following (previously mentioned) work: https://svnweb.freebsd.org/base?view=3Drevision&revision=3D307802 [bapt+ema= ste] https://svnweb.freebsd.org/base?view=3Drevision&revision=3D306648 [emaste] https://svnweb.freebsd.org/base?view=3Drevision&revision=3D306375 [emaste+d= teske] I had previously suggested that a good solid approach would be to first and foremost follow the approach of bapt with respect to tzsetup, and then optionally add a command-line flag to each of the applications to enable runtime disabling of dialog(1). I do like to think of iterative approaches that build upon and reinforce pr= ior works. The shortcomings of distfetch, distextract, and cksum are also solved by wa= y of fixing the other issue of them not being able to run in a dialog(1,3)-less environment -- regardless of that being a decision that is made at compile-= time or runtime. I think the best approach would be to use isatty(3)/stty(1) at runtime to invoke the same code-path as WITHOUT_DIALOG. --=20 You are receiving this mail because: You are the assignee for the bug.=