From owner-freebsd-security@freebsd.org Tue Jun 1 22:52:35 2021 Return-Path: Delivered-To: freebsd-security@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4B4A633021 for ; Tue, 1 Jun 2021 22:52:35 +0000 (UTC) (envelope-from fasxmut@protonmail.com) Received: from mail4.protonmail.ch (mail4.protonmail.ch [185.70.40.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "protonmail.com", Issuer "SwissSign Server Gold CA 2014 - G22" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvnVT5fG0z50pW for ; Tue, 1 Jun 2021 22:52:33 +0000 (UTC) (envelope-from fasxmut@protonmail.com) Date: Tue, 01 Jun 2021 22:52:16 +0000 To: =?utf-8?Q?Mikl=C3=B3s_Quartus?= From: Fas Xmut Cc: "freebsd-security@freebsd.org" Reply-To: Fas Xmut Subject: Re: sysrc bug Message-ID: In-Reply-To: <242de1fa-ccd5-c9d6-4b2e-330ac9dcc152@foresthacker.hu> References: <242de1fa-ccd5-c9d6-4b2e-330ac9dcc152@foresthacker.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Rspamd-Queue-Id: 4FvnVT5fG0z50pW X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; HAS_REPLYTO(0.00)[fasxmut@protonmail.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[protonmail.com]; R_SPF_ALLOW(-0.20)[+ip4:185.70.40.0/24]; DKIM_TRACE(0.00)[protonmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[protonmail.com,quarantine]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[185.70.40.27:from]; FREEMAIL_ENVFROM(0.00)[protonmail.com]; ASN(0.00)[asn:62371, ipnet:185.70.40.0/24, country:CH]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[protonmail.com:s=protonmail]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[protonmail.com]; SPAMHAUS_ZRD(0.00)[185.70.40.27:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[185.70.40.27:from]; MAILMAN_DEST(0.00)[freebsd-security] X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 22:52:35 -0000 =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Tuesday, June 1, 2021 9:22 PM, Mikl=C3=B3s Quartus via freebsd-security = wrote: > On 6/1/21 5:54 AM, Gordon Tetlow via freebsd-security wrote: > > > Surprised this old myth is still being repeated. Having used various > > > > > root shells in FreeBSD and other Unux/Linux systems for decades I hav= e to > > > ask specifically what said reasons are, particularly considering > > > /usr/sbin/sysrc starts with "#!/bin/sh" (as does and should every sys= tem > > > shell script). > > > It=E2=80=99s likely due to the quoting behavior of newlines passed as= the argument when he ran the script, which varies between shell implementa= tions. As I said, I=E2=80=99m not surprised something broke because many ut= ilities are not tested with different shell behaviors. > > > > I also believe if we have a reproducible test case, we should go ahead = and fix it. > > Gordon > > I have Bash shell in my root terminal (did not change the default shell, > just type 'bash -l' from the default csh) and I could not reproduce this > error on 13.0-RELEASE . The rc.conf remains fine showing just the > expected changes. > > -------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------- > > Regards, > Mikl=C3=B3s > GPG fingerprint: 3C4B 1364 A379 7366 7FED 260A 2208 F2CE 3FCE A0D3 I think I didnt express clearly. You have to do two commands to reproduce i= t: First: sysrc something_enable=3D"NO" Then: sysrc something_enable=3D"YES " (Suppose you forget to type " at the end and just type enter, so I type " a= t the following line) ---