From nobody Fri Aug 23 14:20:21 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 4Wr2KL1xM5z5TLxb; Fri, 23 Aug 2024 14:20:22 +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 4Wr2KL1Hvfz3wty; Fri, 23 Aug 2024 14:20:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724422822; 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=014r/iMMWYVgqDIFzyLKdkS9/xGyuDNTNDTxdsVWKQs=; b=EkyscXe2EDnIcxvRwvC2oHIy1u2vhXypAFOPpQxt63Ufb/VyYui8T9MDUZxOUizwoo5z6G 11fbzFk2ETURjYB7lpk5kE3xFAWTV6VB1RuywsgaA8MDZv4pGy+xeSJqxCGTBFGcmtvCJp q7y2+LsfvH+Ajq3tWTDagYo+oMthPIDzU+a8t2AxxNve5+nc1ZbeqeSvmY15dR1xHm4ykr KvfozKSBPrvhHYJLUJICVMXpwvTRRLlMPJPEvGCyBLVTu6djZ/1nwsGhSMqSQ2jiBO4+cA ODTOJlMR3q65ZbLd0jiDwxUVTuIRyUTGwjWHqwQO667EPwcS8UnBOnrVLkrMNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724422822; a=rsa-sha256; cv=none; b=TBxd/AT5f/DOKv2Vfrpv1WbVTnI4RbBpPl/JePHrgd1JfLGlLgT2odVNt6WmnU45xai58R VkuH6i7ZBDjWkp5EaGBMRGNc5QTtcB27fIPhy3NWcysMWMuXCOlnY+arRDvZGeBwaqStHh EfAqhdSsNFqSL2qHpzjNYy4lrxoUAoWaLSDn+Z+a2R5pXujMcfx+23v02cJmB5q+6vhAR8 4HCFBZtzgKeex4KgNZr0DXKmtRW3mFxD6z0rk5iHOCncfWsb7wLAgHcVkyn+0IpvoFpLD5 LuqHz64DEIk96aRRp1LSHv0Sjcod21Sj+VuNEdX6cGox6UPjfWBUEou6+2efqw== 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=1724422822; 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=014r/iMMWYVgqDIFzyLKdkS9/xGyuDNTNDTxdsVWKQs=; b=Yt8znx8icVbUsB3JsbWYzkuFhFtkkIe4UYWXb+H6NRbvNENN7ZfjbH3qKzSylT/IKGfxP4 ZawsnBm0sscQuMQyUjToBmriaCDSKkH7GbSqPpwxja66o022OVF2ChH8/+QpUJqo0g/Qih +9uQ6iJ5xQN/b3Rptv2sJPiFx1ymLxtSemudBrGAxtn8FNBACKnBSi6lEmayOY7hOZwwtP XxxmlGLaLwee2eiHyUivuEYt4ozwsdnn6hYnXDI1u5UW84OGMBB2CsZlSDowLjuAPphqaE z3jkArD0p7Cw1Hl9VnkinNmL9mV1PCdsFf57WOMfErufnNUGJjibRJoHnhNyyg== 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 4Wr2KL0jd1zDrm; Fri, 23 Aug 2024 14:20:22 +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 47NEKLNa039188; Fri, 23 Aug 2024 14:20:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47NEKL3N039185; Fri, 23 Aug 2024 14:20:21 GMT (envelope-from git) Date: Fri, 23 Aug 2024 14:20:21 GMT Message-Id: <202408231420.47NEKL3N039185@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: a84498685c21 - main - sysutils/podman: fix support for 'podman image load' and 'podman image save' 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: a84498685c217bd53ae7dd354e10fb1e1a558ca3 Auto-Submitted: auto-generated The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/ports/commit/?id=a84498685c217bd53ae7dd354e10fb1e1a558ca3 commit a84498685c217bd53ae7dd354e10fb1e1a558ca3 Author: Doug Rabson AuthorDate: 2024-08-23 13:15:29 +0000 Commit: Doug Rabson CommitDate: 2024-08-23 14:20:12 +0000 sysutils/podman: fix support for 'podman image load' and 'podman image save' The code assumed that the faccessat syscall supports AT_SYMLINK_NOFOLLOW which is not the case in FreeBSD before 15.0. --- sysutils/podman/Makefile | 2 +- ...ainers_storage_pkg_fileutils_exists__freebsd.go | 41 ++++++++++++++++++++++ ...ontainers_storage_pkg_fileutils_exists__unix.go | 10 ++++++ 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/sysutils/podman/Makefile b/sysutils/podman/Makefile index 65008f4cac74..22743dcddeab 100644 --- a/sysutils/podman/Makefile +++ b/sysutils/podman/Makefile @@ -1,7 +1,7 @@ PORTNAME= podman DISTVERSIONPREFIX= v DISTVERSION= 5.1.1 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= sysutils MAINTAINER= dfr@FreeBSD.org diff --git a/sysutils/podman/files/patch-vendor_github.com_containers_storage_pkg_fileutils_exists__freebsd.go b/sysutils/podman/files/patch-vendor_github.com_containers_storage_pkg_fileutils_exists__freebsd.go new file mode 100644 index 000000000000..1334657fa9ed --- /dev/null +++ b/sysutils/podman/files/patch-vendor_github.com_containers_storage_pkg_fileutils_exists__freebsd.go @@ -0,0 +1,41 @@ +--- vendor/github.com/containers/storage/pkg/fileutils/exists_freebsd.go.orig 2024-08-23 10:19:26 UTC ++++ vendor/github.com/containers/storage/pkg/fileutils/exists_freebsd.go +@@ -0,0 +1,38 @@ ++package fileutils ++ ++import ( ++ "errors" ++ "os" ++ "syscall" ++ ++ "golang.org/x/sys/unix" ++) ++ ++// Exists checks whether a file or directory exists at the given path. ++// If the path is a symlink, the symlink is followed. ++func Exists(path string) error { ++ // It uses unix.Faccessat which is a faster operation compared to os.Stat for ++ // simply checking the existence of a file. ++ err := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, 0) ++ if err != nil { ++ return &os.PathError{Op: "faccessat", Path: path, Err: err} ++ } ++ return nil ++} ++ ++// Lexists checks whether a file or directory exists at the given path. ++// If the path is a symlink, the symlink itself is checked. ++func Lexists(path string) error { ++ // FreeBSD before 15.0 does not support the AT_SYMLINK_NOFOLLOW flag for ++ // faccessat. In this case, the call to faccessat will return EINVAL and ++ // we fall back to using Lstat. ++ err := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, unix.AT_SYMLINK_NOFOLLOW) ++ if err != nil { ++ if errors.Is(err, syscall.EINVAL) { ++ _, err = os.Lstat(path) ++ return err ++ } ++ return &os.PathError{Op: "faccessat", Path: path, Err: err} ++ } ++ return nil ++} diff --git a/sysutils/podman/files/patch-vendor_github.com_containers_storage_pkg_fileutils_exists__unix.go b/sysutils/podman/files/patch-vendor_github.com_containers_storage_pkg_fileutils_exists__unix.go new file mode 100644 index 000000000000..0778a2749c65 --- /dev/null +++ b/sysutils/podman/files/patch-vendor_github.com_containers_storage_pkg_fileutils_exists__unix.go @@ -0,0 +1,10 @@ +--- vendor/github.com/containers/storage/pkg/fileutils/exists_unix.go.orig 2024-08-23 10:19:17 UTC ++++ vendor/github.com/containers/storage/pkg/fileutils/exists_unix.go +@@ -1,5 +1,5 @@ +-//go:build !windows +-// +build !windows ++//go:build !windows && !freebsd ++// +build !windows,!freebsd + + package fileutils +