From owner-freebsd-questions@freebsd.org Mon Mar 1 15:39:00 2021 Return-Path: Delivered-To: freebsd-questions@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 901CA561D0D for ; Mon, 1 Mar 2021 15:39:00 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4Dq4Dh3PTgz4jkF; Mon, 1 Mar 2021 15:39:00 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "R3" (verified OK)) (Authenticated sender: matthew/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 500C333D1D; Mon, 1 Mar 2021 15:39:00 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from PD0786.local (unknown [IPv6:2001:8b0:151:1:85b2:e2ee:4d75:c7e6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 7056DF3D4; Mon, 1 Mar 2021 15:38:58 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/7056DF3D4; dkim=none; dkim-atps=neutral Subject: Re: installed ports library audit? From: Matthew Seaman To: freebsd@dreamchaser.org, FreeBSD Mailing List References: <97db8511-c5e0-26cc-5e56-4dfa976d7d12@FreeBSD.org> Message-ID: <0935eab6-d458-2c3e-3f8a-a6879fe27363@FreeBSD.org> Date: Mon, 1 Mar 2021 15:38:58 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <97db8511-c5e0-26cc-5e56-4dfa976d7d12@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 15:39:00 -0000 On 01/03/2021 15:36, Matthew Seaman wrote: > On 01/03/2021 03:43, Gary Aitken wrote: >> I just mostly recovered from a system crash where /usr was corrupted and >> had to be recovered using fsck; couldn't completely recover using the >> journal. >> >> I suspect the trashed files are in one of a few libraries.  I'm wondering >> if there's an easy way to audit all files installed by given ports, >> i.e. do an sha256 or something like that on each and compare with the >> known >> good if it's available somewhere? > > pkg-check(8) -- specifically `pkg check -r -x .` will show you any file > known to pkg(8) where the on-disk copy doesn't match the checksum in the > pkgdb. Dammit. `pkg check -s -x .` `-r` is exactly what you don't want, as that will make pkg(8) believe the corrupted files are actually correct. Cheers, Matthew