From nobody Tue Sep 28 18:04:18 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2B7E617ECA7E for ; Tue, 28 Sep 2021 18:04:32 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HJnTC0Jcfz4YGw for ; Tue, 28 Sep 2021 18:04:31 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ed1-f48.google.com with SMTP id l8so37489639edw.2 for ; Tue, 28 Sep 2021 11:04:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=YqndLEacGhJC3lvY6/3tADQhFGANOZtfKgeny8GEz+A=; b=txutaRB+HCMGnDURuGLjPKtLxd1elTj1DcJzL4AXOd4ctKZiF+b0pViBSUoduRjbRa vGVMOlk3THBWPUSvOs06kKYchpIDqLWw9IvCy/84MGQH3oZr+6JyXNOGVJE3bLy2p40v 6cV96uG1YOoUM77S16kXOJWv8MXMl9aFHJljfsltdY7hRiAd2Fcyltuiz/VuX2+xRMn9 HxpQb8ZPbBadtuKDvZCth4AFJdg56THerh+4TAsao78SO0FNcpKDutJVIJ9ZgmnwuV0O CauXkslSMrqIfBIPANEdAYt9WsMObKduwdreVsOPrvbiwxgbs9J+WIFEyzdWecrVaE/u V4tQ== X-Gm-Message-State: AOAM533XpYE6l3xp3cMP0OmURIOveI92zgXN3XwFiLZJLjEJ1P8vOBpA Yl9eK9P4v9NSUYX5OM3dnzaRfublp5VLLA== X-Google-Smtp-Source: ABdhPJzxt7zyTQOWbOPh3Fq9RPn6CEckltRWwWWBM/AjnQudlDGXhnu4jhlyxwnZTAXGXsxVEnpTTA== X-Received: by 2002:a50:9d07:: with SMTP id v7mr8953716ede.185.1632852262100; Tue, 28 Sep 2021 11:04:22 -0700 (PDT) Received: from ?IPv6:2a02:8109:9880:1d70:5e5f:67ff:fef4:ffd8? ([2a02:8109:9880:1d70:5e5f:67ff:fef4:ffd8]) by smtp.gmail.com with ESMTPSA id la1sm11004517ejc.48.2021.09.28.11.04.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Sep 2021 11:04:21 -0700 (PDT) To: freebsd-current@freebsd.org References: <20210922083645.4vnoajyvwq6wfhdf@aniel.nours.eu> <97ebc390-a19e-3203-7016-ce541796eb18@beastielabs.net> From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: Re: [HEADSUP] making /bin/sh the default shell for root Message-ID: Date: Tue, 28 Sep 2021 20:04:18 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 In-Reply-To: <97ebc390-a19e-3203-7016-ce541796eb18@beastielabs.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Rspamd-Queue-Id: 4HJnTC0Jcfz4YGw X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.208.48 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; ARC_NA(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.48:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; DMARC_NA(0.00)[FreeBSD.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.48:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 23/09/2021 10:55, Hans Ottevanger wrote: > As you mention elsewhere in this thread, usage in scripts is not affect= ed by these changes. And=20 > for interactive use it could be a POLA violation, but the astonishment = would be a positive one. Unfortunately, the switch from csh to sh is going to affect scripts. Take= a look at this (examples=20 below assume that toor uses /bin/sh): # su root -c 'echo $1' abc def abc # su toor -c 'echo $1' abc def def Another example: # ssh -p 2222 root@xxx -- '$@' echo 1 2 3 Illegal variable name. # ssh -p 2222 toor@xxx -- '$@' echo 1 2 3 1 2 3 I've been bitten by this a couple of times when working with some product= ion scripts. I'm afraid=20 changing the default shell to csh may cause a bit of hard-to-debug proble= ms there in the wild. Otherwise, I'd be happy with having sh(1) as the default shell for root. = =46rom my perspective, sh(1)=20 was far more forgiving to my colleagues when they started with FreeBSD. Best, Mateusz Piotrowski