From nobody Wed Jul 7 20:24:09 2021 X-Original-To: freebsd-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 9CDE611E2FA9; Wed, 7 Jul 2021 20:24:13 +0000 (UTC) (envelope-from trashcan@ellael.org) Received: from mx2.enfer-du-nord.net (mx2.enfer-du-nord.net [135.125.211.209]) (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 4GKrVj2Rggz3Bvq; Wed, 7 Jul 2021 20:24:12 +0000 (UTC) (envelope-from trashcan@ellael.org) Received: from smtpclient.apple (p200300fb4f0558010938F8309a8230D1.dip0.t-ipconnect.de [IPv6:2003:fb:4f05:5801:938:f830:9a82:30d1]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.enfer-du-nord.net (Postfix) with ESMTPSA id 4GKrVd4XLnz1DJ; Wed, 7 Jul 2021 22:24:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellael.org; s=dkim; t=1625689449; 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: in-reply-to:in-reply-to:references:references; bh=txTHjwjF1PUp8Egjf9oMd0Lhs2ezEr2SOEGQPFTkoAQ=; b=w9I1dn6Vkj41GFv4xCxL3bK22o+ZkT6ZO3np2bYUrLbi9bQ9gzUj7hf1QtGlZMP4u4dRqe o0yvj1LCxvTz+DAtEsurvsxyMVVHJCeSHGSWoSmdeTREBwixG0/j8cjVFfVxyPyOYhG2s0 c6hTb7XlIvt2u5ULOrFUIp81unnI0S4Q7B+nqsHHBwlMAehWkttPoMv7hWQjDmHZZqpimJ NWhu2G0VuVNbgAFU621/iUjUfZ+3CiREIvuQDLiBdAWf00NsVHpdqPqXF6yT95nPVlfVCf G03GJSKoLPOxi2RY7n52MxT7xnRaa7XGDwGCnXRUGYrZbMLEmKvbDZyyvJDOnQ== Message-Id: <0B2C7AEA-27C6-4259-9DCF-D20C19737A50@ellael.org> Content-Type: multipart/mixed; boundary="Apple-Mail=_D505DE2F-C582-4001-BDE4-19F198707C1B" 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 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: security/rkhunter without hashes after recent STABLE-13 update Date: Wed, 7 Jul 2021 22:24:09 +0200 In-Reply-To: Cc: FreeBSD-STABLE Mailing List , FreeBSD ports , lukasz@wasikowski.net, Stefan Esser To: Warner Losh References: <416D3033-138D-4BBB-84FA-FAEA2944C837@ellael.org> <08637D0D-9D65-4F53-9A64-F4742BA8E415@ellael.org> X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4GKrVj2Rggz3Bvq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Reply-To: trashcan@ellael.org From: Michael Grimm via freebsd-stable X-Original-From: Michael Grimm X-ThisMailContainsUnwantedMimeParts: Y --Apple-Mail=_D505DE2F-C582-4001-BDE4-19F198707C1B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Warner Losh wrote: >=20 > On Wed, Jul 7, 2021 at 12:47 PM Michael Grimm = wrote: >> Warner Losh wrote: >>> Sorry for any hassle this work is causing. >>=20 >> No big deal for rkhunter, a workaround exists ;-) >=20 > I think the reason is that it automatically switched to using = sha256sum > because it was present, but it didn't automatically change = #HASH_FLD_IDX=3D4 > to be 1. The shell script is tricky enough that I've not looked = through it > all. I'd argue this is a bug in the get_sha_hash_function which = doesn't > adjust the HASH_FLD_IDX based on which version it finds. Instead, it = sets > it unconditionally to 4 on *BSD or DragonFly. >=20 > Warner >=20 > P.S. I think it needs something like the following updated > patch-files_rkhunter and/or changes upstream. I don't know what this = port > does, apart from what I've just read. Can you see if this fixes this? Your rkhunter script seems to be different to mine =E2=80=A6 MWN> patch < rkhunter.diff=20 Hmm... Looks like a unified diff to me=E2=80=A6 The text leading up to this was: =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 |--- files/rkhunter.orig 2018-02-24 16:08:27.000000000 = -0700 |+++ files/rkhunter 2021-07-07 13:38:56.094378000 -0600 =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Patching file rkhunter using Plan A=E2=80=A6 Hunk #1 succeeded at 4751. Hunk #2 failed at 7525. Hunk #3 succeeded at 19734 (offset 3 lines). Hunk #4 failed at 19810. 2 out of 4 hunks failed--saving rejects to rkhunter.rej done But anyway, you nailed it! That fixes rkhunter. It will now produce = hashes for both /sbin/sha256 and /sbin/sha256sum. The attached patch (diff to new rkhunter script with both succeeding = hunks) will work for the rkhunter-1.4.6 script. Thanks and with kind regards, Michael --Apple-Mail=_D505DE2F-C582-4001-BDE4-19F198707C1B--