From nobody Sun Aug 28 09:37:16 2022 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 4MFpPz3Xm6z4bD8P; Sun, 28 Aug 2022 09:37:27 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MFpPx1BcQz3qP4; Sun, 28 Aug 2022 09:37:25 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id c4920b47; Sun, 28 Aug 2022 09:37:17 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id fa4950c3 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sun, 28 Aug 2022 09:37:17 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 (1.0) Subject: Re: security/clamav: /ar/run on TMPFS renders the port broken by design From: Michael Gmelin In-Reply-To: <202208280842.27S8gDXn055868@nuc.oldach.net> Date: Sun, 28 Aug 2022 11:37:16 +0200 Cc: Cy.Schubert@cschubert.com, otis@freebsd.org, freebsd@walstatt-de.de, freebsd-current@freebsd.org, freebsd-ports@freebsd.org, yasu@freebsd.org Message-Id: <163333B4-76A1-4E46-B7C3-60492D379C6E@freebsd.org> References: <202208280842.27S8gDXn055868@nuc.oldach.net> To: freebsd@oldach.net X-Mailer: iPhone Mail (19G82) X-Rspamd-Queue-Id: 4MFpPx1BcQz3qP4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 213.239.217.29 is neither permitted nor denied by domain of grembo@freebsd.org) smtp.mailfrom=grembo@freebsd.org X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE]; MLMMJ_DEST(0.00)[freebsd-ports@freebsd.org,freebsd-current@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; FREEFALL_USER(0.00)[grembo]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_NONE(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N > On 28. Aug 2022, at 10:42, freebsd@oldach.net wrote: >=20 > =EF=BB=BFCy Schubert wrote on Sat, 27 Aug 2022 17:26:38 +0200 (CEST): >> As stated before in this thread, replacing /var/run with tmpfs is not a >> supported configuration. >=20 > Not supported? What is the purpose of /etc/rc.d/var then? That creates a t= mpfs backed /var, populates it through mtree, and makes a proper /var/run av= ailable. >=20 > However it doesn't (yet) create /var/run/clamav of course. >=20 > It would be fairly easy to extend /etc/rc.d/var by a logic that walks thro= ugh /usr/local/etc/mtree/* and runs mtree on each of the files found as need= ed. All that the security/clamav port would need to do then is to drop an ap= propriate small mtree file as /usr/local/etc/mtree/clamav. =46rom a port's p= erspective that is the same logic as dropping service scripts as /usr/local/= etc/rc.d/clamav-*. =46rom a user's perspective, it would be preferable to have this happen at s= ervice start though, as (unlike in the setup described) reboots don't happen= that frequently, but files in /var/run might get deleted manually. Maybe so= me rc framework based solution would make sense, e.g., a variable `mtree_fil= es`, which, if set, is applied in the default start_precmd. Besides being mo= re resilient, this would also have the advantage that all required file syst= ems should be available at that point and the separation between system and p= orts would be more clear. Another advantage would be that directories are on= ly created for services that are actually enabled/started. Cheers Michael