From nobody Sun Dec 08 17:26:38 2024 X-Original-To: dev-commits-ports-main@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 4Y5sNv1Xvrz5gvs4; Sun, 08 Dec 2024 17:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y5sNt6gLbz3yf7; Sun, 8 Dec 2024 17:26:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733678798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oABY+sdkUM99GoS1knREyr4HczNimib+ubDygf2IWQw=; b=FnleGOPvgbXcdgqqgaB0MKsIloN2w1Mzu8snlbI6lMcdbNXsm6ti3W5XJJkG97yKG/Zctl +BvfZ3NKuotwbuYTXStrGn60aH+JSZh31Re7muJMxF9oscW73FtFwoRhEgRMEFJgoOEzNW 8DL+it9sgm2R58jgtlJNjkmJdrbp17BfyC/Sy6DYU3jZjrWszaLie0OByTDG4RGw1xGRtm NebCInUuXAYp2cksDpA4jzu/H+/TzSw0yAYCpCoWkqItzzqMHT48Ma1GW6teiFh4xfaCLy 940DRift2qxrEKQGt1CC/ZJd+JD+qEFVmN5DHUGt7OR+vgCDMCW/KLfPIM4PiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733678798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oABY+sdkUM99GoS1knREyr4HczNimib+ubDygf2IWQw=; b=DJneZ+vTPv84h4KGIfsyA3WMF5a92ip5CjCRpbtCzASeRpHObFBLjTXaeARCsCSx3YefYw waABP+KeLBdLNUx0/TNlurPHtBacRf9OHrM9WJYhRZRPvEZYbqHN2Duwx7jg7rfrdcg/WH 2WlycYRrvyYgNPUE6upy11GrIgheQ4lYbiCyp8oY9M9wACHZCx45p5OxdTAeoxe2M9ziYH liNDT/UymEAXA42If/NVwVZrcVl/tRtV5Lr8+DVdFp/8uKS9towlVJedkqL93hOnI7POjP clt7qtMSq/+srzTyH0SA2sexT+etFFApBrIZ6gjuwLN1QTau9J3mwnfNsVVpGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733678798; a=rsa-sha256; cv=none; b=Fk/MatWf1PYCFYjiL9fQNib2bnCeE293c1wo2/DywfGaz9XV7oKNzeMo4iZqvJYQVsjfR0 qg+ZVf+jTiG4ShU12zHcOk9wixB5AIlxV1fXIYn+htupxQvuiZOmdzbIbQBAASE4tnIH6N DiS+bwwSe20L1wxMkSGO36qv1y9chVvT7Te5YhnpLIqLq5b9KZzkkGYBV0jo7qautJp4Kw d7E/vFyb3jTc3fOen4b1oBtIlVcBOE0/WBKEupNs6C4cH+Ac04yd3uROsiY/TCy2ZKKyHr u9UOw5JNOrmZtyA7mhL3aziHoCQOIkkUXJdY1JDZ3WmGqnmTjDDAiC02wHo8jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y5sNt6Hl0z12Bh; Sun, 8 Dec 2024 17:26:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B8HQc8F067705; Sun, 8 Dec 2024 17:26:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B8HQcY8067702; Sun, 8 Dec 2024 17:26:38 GMT (envelope-from git) Date: Sun, 8 Dec 2024 17:26:38 GMT Message-Id: <202412081726.4B8HQcY8067702@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Michael Gmelin Subject: git: ecf7e0e97e77 - main - sysutils/iocage-devel: Fix fetch release command List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grembo X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecf7e0e97e773f835506fcf54642790b15c492f9 Auto-Submitted: auto-generated The branch main has been updated by grembo: URL: https://cgit.FreeBSD.org/ports/commit/?id=ecf7e0e97e773f835506fcf54642790b15c492f9 commit ecf7e0e97e773f835506fcf54642790b15c492f9 Author: Michael Gmelin AuthorDate: 2024-12-08 17:23:29 +0000 Commit: Michael Gmelin CommitDate: 2024-12-08 17:23:29 +0000 sysutils/iocage-devel: Fix fetch release command See also: https://github.com/freebsd/iocage/pull/55 --- sysutils/iocage-devel/Makefile | 2 +- .../files/patch-iocage__lib_ioc__fetch.py | 33 +++++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/sysutils/iocage-devel/Makefile b/sysutils/iocage-devel/Makefile index 21db6054355a..adac6bfff7b8 100644 --- a/sysutils/iocage-devel/Makefile +++ b/sysutils/iocage-devel/Makefile @@ -1,6 +1,6 @@ PORTNAME= iocage-devel PORTVERSION= 1.8.20241014 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= sysutils python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/sysutils/iocage-devel/files/patch-iocage__lib_ioc__fetch.py b/sysutils/iocage-devel/files/patch-iocage__lib_ioc__fetch.py index 73d8b6e58068..d5697b9205af 100644 --- a/sysutils/iocage-devel/files/patch-iocage__lib_ioc__fetch.py +++ b/sysutils/iocage-devel/files/patch-iocage__lib_ioc__fetch.py @@ -1,22 +1,41 @@ --- iocage_lib/ioc_fetch.py.orig 2024-09-20 06:45:27 UTC +++ iocage_lib/ioc_fetch.py -@@ -47,7 +47,10 @@ import iocage_lib.ioc_start +@@ -47,6 +47,29 @@ import iocage_lib.ioc_start from iocage_lib.pools import Pool from iocage_lib.dataset import Dataset -+# deliberately crash if tarfile doesn't have required filter -+tarfile.tar_filter ++# taken from tarfile.tar_filter (and _get_filtered_attrs) ++# basically the same, but **without**: ++# - Clear high mode bits (setuid, setgid, sticky) and ++# group/other write bits (S_IWGRP | S_IWOTH). ++def untar_release_filter(member, dest_path): ++ new_attrs = {} ++ name = member.name ++ dest_path = os.path.realpath(dest_path) ++ # Strip leading / (tar's directory separator) from filenames. ++ # Include os.sep (target OS directory separator) as well. ++ if name.startswith(('/', os.sep)): ++ name = new_attrs['name'] = member.path.lstrip('/' + os.sep) ++ if os.path.isabs(name): ++ # Path is absolute even after stripping. ++ # For example, 'C:/foo' on Windows. ++ raise tarfile.AbsolutePathError(member) ++ # Ensure we stay in the destination ++ target_path = os.path.realpath(os.path.join(dest_path, name)) ++ if os.path.commonpath([target_path, dest_path]) != dest_path: ++ raise tarfile.OutsideDestinationError(member, target_path) ++ if new_attrs: ++ return member.replace(**new_attrs, deep=False) ++ return member -+ class IOCFetch: - """Fetch a RELEASE for use as a jail base.""" -@@ -817,7 +820,7 @@ class IOCFetch: +@@ -817,7 +840,7 @@ class IOCFetch: # removing them first. member = self.__fetch_extract_remove__(f) member = self.__fetch_check_members__(member) - f.extractall(dest, members=member) -+ f.extractall(dest, members=member, filter='tar') ++ f.extractall(dest, members=member, filter=untar_release_filter) def fetch_update(self, cli=False, uuid=None): """This calls 'freebsd-update' to update the fetched RELEASE."""