From nobody Tue Aug 20 14:06:26 2024 X-Original-To: dev-commits-ports-all@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 4WpB8g2NzWz5TBnZ; Tue, 20 Aug 2024 14:06:27 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpB8g00fmz4hDG; Tue, 20 Aug 2024 14:06:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724162787; 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=PmFbDtXR5D6T6JMSoGt/xcCDoDm0RgrMex14rJn1zEE=; b=YIXN7quWp2O/gtFgEf8k9dHZD/4hu86wDs599BLUQSk0hlEbDs4cFjihj+6/QCTqYDYkzA Mm7EXmtkRv7ooOSo05XL75pTvs5JuCjCFic+xVx1rXy/E4ou/lER3Y0uCVCwaRQWVvLwMb 0uT+UnrwZLjoxNZJuXSBVdB/e/oykjbQU2jMK9xXUjMdjKSf4FMo4P/1mpAoWCBNtiO3jZ cINMVprq8BpAIH5JBOEkCg/vQQUj4xTBMo3sPXI4Fn+xf00xq8KbnHUr/+8YBWf9+lRTb4 FB2m/LqjKEyWcQ9qlLY6ualDsqE7ZWsBvvqltVsqMQRFznvcBl+iKMuqEGhahQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724162787; a=rsa-sha256; cv=none; b=rv0OisOKwUvuDdGWcNs9ZCpSDTralGyIVAOUPiblK0XqBa5j+l+bfXrgjkR44k+HKSkhpb Ze9fqCYFUaFJ5J/yZCWqV5zaud+9R5x3BrVXaGg6TDct6T/PsU88RCalAYWLlMXGXe0tkl FwLjE21xJApnmD1ikifeK0Xs9H8bu5d0ghiQTa9uZ9RTaC+vSONAcWw7eaC367b3HGq1j4 WUWkfC33ba9mtVEtU8uJI5B2J/CHKphTOqA8jt0Pq0z2HTjnYrBopE7yL8U96JYpyysR/I j/kzR2yxbLZNtyjsyI5qudjUDtKBljW8tNybVbXCN++plJyiqZXxv5r9Wnihfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724162787; 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=PmFbDtXR5D6T6JMSoGt/xcCDoDm0RgrMex14rJn1zEE=; b=puIr+aOi8YbS+CzT2msp9GE4HKniAj+tTekQ7c1o6PTEw8nO5WgKhkQ+8SQXFPPtRQZeYZ VMBvTrTJXMipGRqAQe85TwTaYBaeC147wY0ez5UyNjjAFFGXCnHiv9IbvdPw2Fi/mK5+9X kneC2OrpIlnb2KDGDgE8wOx83Oqwac3dnPXchb/vat80+H/+esxnaOK10s/umTDu0hYSy/ UsUZRk9Bu2BtMChLZ0jBriput1PrFNh2uVQr1UVUlULnLX3XOhxZnam4HsW/B4h4abQxvx lfqiFh+hIwThgHPPwZ4r/m/F9yhOX07E8jUrnuTFAu7gHPj7uA3wxdVNHAvC7A== 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 4WpB8f6k28z13Mw; Tue, 20 Aug 2024 14:06:26 +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 47KE6QKK091508; Tue, 20 Aug 2024 14:06:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KE6Q3o091505; Tue, 20 Aug 2024 14:06:26 GMT (envelope-from git) Date: Tue, 20 Aug 2024 14:06:26 GMT Message-Id: <202408201406.47KE6Q3o091505@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Doug Rabson Subject: git: 099c6a40f8e9 - main - sysutils/podman: fix nil pointer dereference in 'podman build' List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 099c6a40f8e9ec305e7725f4ddd85fe9311f51f3 Auto-Submitted: auto-generated The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/ports/commit/?id=099c6a40f8e9ec305e7725f4ddd85fe9311f51f3 commit 099c6a40f8e9ec305e7725f4ddd85fe9311f51f3 Author: Doug Rabson AuthorDate: 2024-08-20 10:08:26 +0000 Commit: Doug Rabson CommitDate: 2024-08-20 14:06:04 +0000 sysutils/podman: fix nil pointer dereference in 'podman build' This copies over fixes for a similar problem in Buildah - Podman shares Buildah code to implement 'podman build'. --- sysutils/podman/Makefile | 2 +- ...or_github.com_containers_buildah_run__common.go | 30 ++++++++++++++++++++++ ...r_github.com_containers_buildah_run__freebsd.go | 11 ++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/sysutils/podman/Makefile b/sysutils/podman/Makefile index fcc8c3511beb..65008f4cac74 100644 --- a/sysutils/podman/Makefile +++ b/sysutils/podman/Makefile @@ -1,7 +1,7 @@ PORTNAME= podman DISTVERSIONPREFIX= v DISTVERSION= 5.1.1 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= sysutils MAINTAINER= dfr@FreeBSD.org diff --git a/sysutils/podman/files/patch-vendor_github.com_containers_buildah_run__common.go b/sysutils/podman/files/patch-vendor_github.com_containers_buildah_run__common.go new file mode 100644 index 000000000000..869f92f72b7e --- /dev/null +++ b/sysutils/podman/files/patch-vendor_github.com_containers_buildah_run__common.go @@ -0,0 +1,30 @@ +--- vendor/github.com/containers/buildah/run_common.go.orig 2024-08-20 09:45:05 UTC ++++ vendor/github.com/containers/buildah/run_common.go +@@ -83,12 +83,17 @@ func (b *Builder) addResolvConfEntries(file string, ne + + // addResolvConf copies files from host and sets them up to bind mount into container + func (b *Builder) addResolvConfEntries(file string, networkNameServer []string, +- namespaces []specs.LinuxNamespace, keepHostServers, ipv6 bool) error { ++ spec *specs.Spec, keepHostServers, ipv6 bool) error { + defaultConfig, err := config.Default() + if err != nil { + return fmt.Errorf("failed to get config: %w", err) + } + ++ var namespaces []specs.LinuxNamespace ++ if spec.Linux != nil { ++ namespaces = spec.Linux.Namespaces ++ } ++ + dnsServers, dnsSearch, dnsOptions := b.CommonBuildOpts.DNSServers, b.CommonBuildOpts.DNSSearch, b.CommonBuildOpts.DNSOptions + nameservers := make([]string, 0, len(defaultConfig.Containers.DNSServers.Get())+len(dnsServers)) + nameservers = append(nameservers, defaultConfig.Containers.DNSServers.Get()...) +@@ -1253,7 +1258,7 @@ func (b *Builder) runUsingRuntimeSubproc(isolation def + } + + if resolvFile != "" { +- err = b.addResolvConfEntries(resolvFile, netResult.dnsServers, spec.Linux.Namespaces, netResult.keepHostResolvers, netResult.ipv6) ++ err = b.addResolvConfEntries(resolvFile, netResult.dnsServers, spec, netResult.keepHostResolvers, netResult.ipv6) + if err != nil { + return err + } diff --git a/sysutils/podman/files/patch-vendor_github.com_containers_buildah_run__freebsd.go b/sysutils/podman/files/patch-vendor_github.com_containers_buildah_run__freebsd.go new file mode 100644 index 000000000000..af15e04c5336 --- /dev/null +++ b/sysutils/podman/files/patch-vendor_github.com_containers_buildah_run__freebsd.go @@ -0,0 +1,11 @@ +--- vendor/github.com/containers/buildah/run_freebsd.go.orig 2024-08-20 09:45:15 UTC ++++ vendor/github.com/containers/buildah/run_freebsd.go +@@ -244,7 +244,7 @@ func (b *Builder) Run(command []string, options RunOpt + // Only add entries here if we do not have to do setup network, + // if we do we have to do it much later after the network setup. + if !configureNetwork { +- err = b.addResolvConfEntries(resolvFile, nil, nil, false, true) ++ err = b.addResolvConfEntries(resolvFile, nil, spec, false, true) + if err != nil { + return err + }