From nobody Mon Jan 17 15:20:44 2022 X-Original-To: ports@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 AA9CE19673A2 for ; Mon, 17 Jan 2022 15:20:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jcwb24Q6lz4Wwg; Mon, 17 Jan 2022 15:20:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642432846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wrmPUlblrMD7LV2Vh2XtN/4Lgsd1IJ8bvkvk1NlQk2g=; b=wW2G/1FeoNtbRYX2aE56bDEbkmeBiWCq1RCl0JdBMGx5Hlsy0m+sFvQKLPcUnYFiji9AIS k8kLjjAHCLnEF939/fE8+FmJpBfPcolp/whw1qihap28aERXDJa/3HrzD8CoZ0PwMdDt0j vFEY0LwOB9vYII6JRIzJnsu9qmry+/7McfWDbSfBngtoizqDWHE8PfdE7K16lsRnzRqYFL xosH//iGx/7N8Wv80/jVP3Zplca/kf6/ytT75cL35OUQxA1Ri791tyhwBSK/OqhxZ3gd7x 3rBXK0xtRyNriH2jbslKMKGe7WbKF69CVrYKJVd/LJrOpo+KaggFGLKT5gME1Q== Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 5DFB8CD5C; Mon, 17 Jan 2022 15:20:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 081D28171E; Mon, 17 Jan 2022 16:20:45 +0100 (CET) Date: Mon, 17 Jan 2022 16:20:44 +0100 From: Baptiste Daroussin To: Rosenke Cc: ports@freebsd.org, manu@freebsd.org Subject: Re: pkgbase checksums Message-ID: <20220117152044.5njhh72fw7hm4tae@aniel.nours.eu> References: <5fc8453b-1aab-bce9-59e9-1ee36161a580@FreeBSD.org> <20220113125730.zh4zmxj5d4473nmr@aniel.nours.eu> <5e0f8e42-0162-74d8-5fc7-1c2b62afd7dc@dssgmbh.de> List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5e0f8e42-0162-74d8-5fc7-1c2b62afd7dc@dssgmbh.de> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642432846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wrmPUlblrMD7LV2Vh2XtN/4Lgsd1IJ8bvkvk1NlQk2g=; b=wruf6aepuoPP2Fnx983N4o6Iy/DpssGlspQzNAsr/uVB//PWNsjfntIB5AxUGMxaK9fcQp MZfATdlU62KUZDqyEZ/gpHuA0NSVKfD2GN1+Rl+EOpKgwvbKC+VbFkG5hNU1eXvYqYp9fO VeVS6maUcNwOKxORMZUY1Eu3PDqqRUcKaGgYbyY2ZNl+2KJbekn3rQdlH2p2r2zH7ami2f MMDH1WWo++FYWNAK/FXa0NQIAVollAaLtERLkNvvXrrxlUF+CKxKJZu1UhMVyAi7o6lxp/ egWfu1hWiAa8IdRopSRevuNZwOn/0DHP5+3OMGox29BXfNqvQ9RIlaJdTj/s6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642432846; a=rsa-sha256; cv=none; b=yyoJV302pi2T/OGCLgtDOgM5vHinyOKT4P4HVGtQdJxSjKUvp5rMn+4zgA22T1O5O8EZK9 HjSthCF5W/EOCik5m0U4xnoNdRXA9gIJc7+JabjtEx9Amtqm1XRvZum4/oATEbJKE+O61+ ijxqtTDxX/7qz8Hr+SR3oSSJb2YPUolRVH0nFAeFRdTVBpomCCcDYXVjiWQRBbclJhethK yRQeyE7gctGfpgZJ1q+ClnvQRJIxJ/63Tig39UoNiyVkX/TF7ZeOYL1Kkcq9JGXbU3w9CE hNv3s95Qq7xWZEXiXmdQsoYQgCsA+dWXp1ui3/N/thYPN9htRN/ZD3nttbuf+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Mon, Jan 17, 2022 at 04:17:46PM +0100, Rosenke wrote: > On 17.01.22 16:12, Rosenke wrote: > > On 13.01.22 13:57, Baptiste Daroussin wrote: > > > On Thu, Jan 13, 2022 at 11:33:55AM +0100, Stefan Esser wrote: > > > > Am 13.01.22 um 10:36 schrieb Henrik Rosenke: > > > > > Hello, > > > > > > > > > > what is the correct way to handle pkg checksum mismatches in > > > > > pkgbase? (pkg > > > > > check -sa) > > > > > For example after installing bash or editing /etc/hosts > > > > > there are checksum > > > > > mismatches: > > > > > > > > > >      FreeBSD-clibs-12.2.s20220105232846: checksum mismatch > > > > > for /etc/hosts > > > > >      FreeBSD-clibs-12.2.s20220105232846: checksum mismatch > > > > > for /etc/shells > > > > > > > > > > I workaround this after setting up the jail by executing pkg > > > > > check -r but this > > > > > doesnt seem right to me. Also this doesnt handle > > > > > modifications made afterwards. > > > > > In normal pkgs we got the ability to provide a default and > > > > > modify this, for > > > > > this files no checksums are stored from what i know. > > > > I'm not a pkgbase user, but I'd think that this could be fixed > > > > by using @sample to have e.g. /etc/hosts.sample with a checksum, > > > > which is copied to /etc/hosts if that file does not exist during > > > > installation. > > > > > > > > This logic works great for ports, but had the disadvantage of > > > > doubling the number of files in /etc that are installed that way, > > > > since the .sample file will have to stay as part of the installed > > > > pkgbase package and may occasionally be updated. > > > > > > > > That would also allow a special version of etcupdate to detect > > > > changed .sample files and to perform a 3-way merge on the installed > > > > files as is possible when building from source. > > > > > > > > Regards, STefan > > > We have @config for base were pkg will do a 3 way merge, just those > > > files are > > > probably not marked as @config and should. > > > > > > (@config is native while @sample is external and define only in the > > > ports tree) > > > > > > if they are marked as such, then it means we have a bug in pkg > > > checksum as it > > > should not check the checksum of the files marked @config > > > > > > Best regards, > > > Bapt > > I tried it again with pkg 1.17.5 and FreeBSD 12.3 packages but got the > > same Error. The @config section is included in the packages: > > pkg info -R FreeBSD-clibs > > config: [ > >     "/etc/nsswitch.conf", > >     "/etc/libmap.conf", > >     "/etc/hosts", > >     "/etc/protocols", > >     "/etc/netconfig", > >     "/etc/hosts.equiv", > >     "/etc/rpc", > >     "/etc/mac.conf", > >     "/etc/shells", > >     "/etc/networks" > > ] > > > > In total these are now 9 cheksum mismatches in the pkgbase jail: > > === root@dsssrvt4j1 (pts/2) ~ 19(3) -> pkg check -sa > > Checking all packages:   1% > > FreeBSD-clibs-12.2.s20220114103031: checksum mismatch for /etc/hosts > > FreeBSD-clibs-12.2.s20220114103031: checksum mismatch for /etc/shells > > Checking all packages:  78% > > FreeBSD-runtime-12.2.s20220114103031: checksum mismatch for /.profile > > FreeBSD-runtime-12.2.s20220114103031: checksum mismatch for > > /etc/locate.rc > > FreeBSD-runtime-12.2.s20220114103031: checksum mismatch for > > /etc/login.conf > > FreeBSD-runtime-12.2.s20220114103031: checksum mismatch for > > /etc/sysctl.conf > > FreeBSD-runtime-12.2.s20220114103031: checksum mismatch for > > /etc/syslog.conf > > FreeBSD-runtime-12.2.s20220114103031: checksum mismatch for /etc/ttys > > FreeBSD-runtime-12.2.s20220114103031: checksum mismatch for > > /root/.profile > > Checking all packages: 100% > > > Whoops,  copied the wrong output: > === root@dsssrvt4j1 (pts/1) ~ 1(3) -> pkg check -sa > Checking all packages:   1% > FreeBSD-clibs-12.3.s20220117084939: checksum mismatch for /etc/hosts > FreeBSD-clibs-12.3.s20220117084939: checksum mismatch for /etc/shells > Checking all packages:  78% > FreeBSD-runtime-12.3.s20220117084939: checksum mismatch for /etc/locate.rc > FreeBSD-runtime-12.3.s20220117084939: checksum mismatch for /etc/login.conf > FreeBSD-runtime-12.3.s20220117084939: checksum mismatch for /etc/motd > FreeBSD-runtime-12.3.s20220117084939: checksum mismatch for /etc/sysctl.conf > FreeBSD-runtime-12.3.s20220117084939: checksum mismatch for /etc/syslog.conf > FreeBSD-runtime-12.3.s20220117084939: checksum mismatch for /etc/ttys > Checking all packages: 100% > Here we are ;), the bug is on my side then :D, we pkg devs (I said we because maybe manu will be faster than me on this) will dive in the code and fix. Best regards Bapt