Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174163284
D60133.id188070.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D60133.id188070.diff
View Options
diff --git a/sysutils/buildah/Makefile b/sysutils/buildah/Makefile
--- a/sysutils/buildah/Makefile
+++ b/sysutils/buildah/Makefile
@@ -1,7 +1,7 @@
PORTNAME= buildah
DISTVERSIONPREFIX= v
DISTVERSION= 1.43.2
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= sysutils
MAINTAINER= dfr@FreeBSD.org
diff --git a/sysutils/buildah/files/patch-vendor_go.podman.io_storage_pkg_archive_archive__bsd.go b/sysutils/buildah/files/patch-vendor_go.podman.io_storage_pkg_archive_archive__bsd.go
new file mode 100644
--- /dev/null
+++ b/sysutils/buildah/files/patch-vendor_go.podman.io_storage_pkg_archive_archive__bsd.go
@@ -0,0 +1,38 @@
+Fix loss of setuid/setgid/sticky bits during BSD untar.
+
+Directly casting Go's os.FileMode to uint32 in handleLChmod silently
+dropped setuid/setgid/sticky bits on BSD systems, since they are
+high-order bits that don't map to POSIX chmod(2) bit positions.
+
+https://github.com/podman-container-tools/container-libs/pull/935
+
+--- vendor/go.podman.io/storage/pkg/archive/archive_bsd.go.orig 2025-06-28 00:00:00 UTC
++++ vendor/go.podman.io/storage/pkg/archive/archive_bsd.go
+@@ -9,10 +9,26 @@ import (
+ "golang.org/x/sys/unix"
+ )
+
++// syscallMode maps a Go os.FileMode to chmod(2) bits, preserving the
++// setuid/setgid/sticky bits that a raw uint32(FileMode) cast silently drops.
++func syscallMode(i os.FileMode) (o uint32) {
++ o = uint32(i.Perm())
++ if i&os.ModeSetuid != 0 {
++ o |= unix.S_ISUID
++ }
++ if i&os.ModeSetgid != 0 {
++ o |= unix.S_ISGID
++ }
++ if i&os.ModeSticky != 0 {
++ o |= unix.S_ISVTX
++ }
++ return o
++}
++
+ func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo, forceMask *os.FileMode) error {
+ permissionsMask := hdrInfo.Mode()
+ if forceMask != nil {
+ permissionsMask = *forceMask
+ }
+- return unix.Fchmodat(unix.AT_FDCWD, path, uint32(permissionsMask), unix.AT_SYMLINK_NOFOLLOW)
++ return unix.Fchmodat(unix.AT_FDCWD, path, syscallMode(permissionsMask), unix.AT_SYMLINK_NOFOLLOW)
+ }
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 2, 1:31 AM (1 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40050280
Default Alt Text
D60133.id188070.diff (1 KB)
Attached To
Mode
D60133: sysutils/buildah: Add a patch to correctly preserve setuid/setgid bits
Attached
Detach File
Event Timeline
Log In to Comment