Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified)) by mollari.NetBSD.org (Postfix) with ESMTPS id 8DF891A9239 for ; Sun, 2 Jan 2022 16:15:57 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id D002B84EEA; Sun, 2 Jan 2022 16:15:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 1741884D3F for ; Sun, 2 Jan 2022 16:15:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id lO17IskQ2sAQ for ; Sun, 2 Jan 2022 16:15:55 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 4AD3C84CD8 for ; Sun, 2 Jan 2022 16:15:55 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 48255FAEC; Sun, 2 Jan 2022 16:15:55 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1641140155120920" MIME-Version: 1.0 Date: Sun, 2 Jan 2022 16:15:55 +0000 From: "Havard Eidnes" Subject: CVS commit: pkgsrc/emulators/compat_netbsd To: pkgsrc-changes@NetBSD.org Reply-To: he@netbsd.org X-Mailer: log_accum Message-Id: <20220102161555.48255FAEC@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1641140155120920 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: he Date: Sun Jan 2 16:15:55 UTC 2022 Modified Files: pkgsrc/emulators/compat_netbsd: INSTALL.ELF Log Message: Don't just remove a symlink on removal, ensure that it points to an expected name before doing so. Should prevent removal of required symlinks which might otherwise happen when this package by accident is instsalled and subsequently de-installed on 9.0 - 9.2 or other netbsd-9 variants. Parts of fix for PR#56597. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 pkgsrc/emulators/compat_netbsd/INSTALL.ELF Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1641140155120920 Content-Disposition: inline Content-Length: 984 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/emulators/compat_netbsd/INSTALL.ELF diff -u pkgsrc/emulators/compat_netbsd/INSTALL.ELF:1.2 pkgsrc/emulators/compat_netbsd/INSTALL.ELF:1.3 --- pkgsrc/emulators/compat_netbsd/INSTALL.ELF:1.2 Sun Feb 17 10:34:31 2013 +++ pkgsrc/emulators/compat_netbsd/INSTALL.ELF Sun Jan 2 16:15:55 2022 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL.ELF,v 1.2 2013/02/17 10:34:31 spz Exp $ +# $NetBSD: INSTALL.ELF,v 1.3 2022/01/02 16:15:55 he Exp $ # Generate a +ROOT_ACTIONS script that runs certain actions that require # superuser privileges. @@ -83,8 +83,15 @@ REMOVE,0) esac if ${TEST} -h "$dst"; then - ${ECHO} "${PKGNAME}: removing $dst" - ${RM} -f "$dst" + lsrc=$(readlink $dst) + if [ "$lsrc" = ${PKG_PREFIX}/$src -o \ + "$lsrc" = $src ] + then + ${ECHO} "${PKGNAME}: removing $dst" + ${RM} -f "$dst" + else + ${ECHO} "${PKGNAME}: mismatched symlink, skipping removal of $dst" + fi fi done ${RM} -f ${ROOT_ACTIONS_COOKIE} --_----------=_1641140155120920--