From nobody Wed Dec 18 16:22:34 2024 X-Original-To: freebsd-arch@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 4YCzVS72MLz5hXsN for ; Wed, 18 Dec 2024 16:22:40 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCzVS2CHSz4XNN; Wed, 18 Dec 2024 16:22:39 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (124-18-43-234.area1a.commufa.jp [124.18.43.234]) (authenticated bits=0) by www121.sakura.ne.jp (8.17.1/8.17.1/[SAKURA-WEB]/20201212) with ESMTPA id 4BIGMYxg030068; Thu, 19 Dec 2024 01:22:35 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dec.sakura.ne.jp; s=s2405; t=1734538955; bh=NE6pjzIBWcl9erJCMLuY4m2zHW82RJ/9ZwuyNDODgyY=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=EDHzWdfTKwHeOS9U1Ng3K/GoSgVg91+qz1h2Gh6qLClXPEu/VIIA2sFl4JzD+gyw4 15TQU+IyhPtElJVu0E4tP1eg8ehDLya9ejkVT/f3iuzDvIIRLoRWVfdCLZmkkOqNul irLcenAJqBydNBV7bsn0T5JRK7v28zF4oLZK4a5c= Date: Thu, 19 Dec 2024 01:22:34 +0900 From: Tomoaki AOKI To: Kyle Evans Cc: freebsd-arch@freebsd.org Subject: Re: Removing shar(1) Message-Id: <20241219012234.25c4033ea1356c072f4ef162@dec.sakura.ne.jp> In-Reply-To: <98535948-3426-4f87-b83b-29952ed356b3@FreeBSD.org> References: <0d63a94d-2773-4efd-b789-0b753ab38b91@FreeBSD.org> <20241218182200.0096ef17f7a0714291da1afc@dec.sakura.ne.jp> <98535948-3426-4f87-b83b-29952ed356b3@FreeBSD.org> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.1) List-Id: Discussion related to FreeBSD architecture List-Archive: https://lists.freebsd.org/archives/freebsd-arch List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arch@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP] X-Rspamd-Queue-Id: 4YCzVS2CHSz4XNN X-Spamd-Bar: ---- On Wed, 18 Dec 2024 07:47:41 -0600 Kyle Evans wrote: > On 12/18/24 03:22, Tomoaki AOKI wrote: > > On Tue, 17 Dec 2024 20:27:16 -0600 > > Kyle Evans wrote: > > > >> Hi, > >> > >> I was reminded the other day that shar(1) exists, though it's use is no > >> longer recommended in ports. The same functionality can be found in > >> tar(1) instead, so I think we should deorbit /usr/bin/shar and stop > >> promoting it entirely. sh(1) archives are really problematic from a > >> user standpoint for at least one reason best explained by the manpage: > >> > >> It is easy to insert trojan horses into shar files. It is strongly > >> recommended that all shell archive files be examined before running > >> them through sh(1). Archives produced using this implementation of > >> shar may be easily examined with the command: > >> > >> egrep -av '^[X#]' shar.file > >> > >> It's hard to advocate for their use in good conscience, much like it's > >> hard to advocate curl|sh pipes. > >> > >> Review: https://reviews.freebsd.org/D48130 > >> > >> Thanks, > >> > >> Kyle Evans > > > > Unfortunately, there's some reporters (sorry, lost track with examples) > > providing error outputs and/or patches as shar files. > > (I myself dislike it, though, and consider them as "nonexistent" unless > > it is a set of patches and multiple comments "it works" are posted.) > > > > If we drop it, such users would complain. But when I really need the > > contents to look into the problem, I usually request the reporters to > > re-upload the contents as flat texts or non-executable archives like > > *.txz. > > > > The behavior is still there in tar(1), but these are the cases that I > don't sympathize with even remotely. I feel even stronger about this > than the original proposal here- we should absolutely be discouraging > this in our own bug tracker. If you want to use these between your own > systems, that's fine, but don't make the users of our bug trackers have > to be even more paranoid about attachments. The persons who want shar is not me. ;-) I'm at the opposite side. > > And IIRC, RPMs for Linux binaries containing install-time scripts would > > have similar problems. > > > > Can you expand on that? Why are install-time scripts generating > shar-cives, and what's happening with the results? Why are they running > in a context with host tools and not a linux jail/chroot? Most of the points are already noted by Tomek. Some appendixes (actually, not limited with RPM). Not install-time script generats shar archive, but the install-time script could be generated AS something like shar-archived script. Maybe official (RedHat) RPM packages would be checked and being fine, but any of in-the-wild and INSANE projects (like at a point of xz) using RPM to distribute their own packages can include something malicious in their RPMs (or any other package systems). AFAIK (not every ports, though), install-time scripts on ports are not self-extracting and/or fetch and execute some executables (including scripts) not included in pkg / stagedir. But I'm not sure how other fistribution formats are. Regards. > > Thanks, > > Kyle Evans -- Tomoaki AOKI