Files
b72f295252 fix(arch): preserve special mode bits in tar and .MTREE (#1193)
* fix(archlinux): mask type bits from tar and .MTREE modes

A contents entry of type: tree records Go's fs.FileMode for walked
directories, which keeps the fs.ModeDir type bit set. The arch packager
wrote that raw value into both the tar header and the .MTREE, producing
dir modes like 20000000755. pacman compares the full st_mode on install
and warns "directory permissions differ" on every shared directory even
though the printed modes match, since it only prints the low 0o7777 bits.

Mask the mode with 0o7777 like deb already does and like apk (#1113) and
rpm (#1060) were fixed to do, preserving the setuid/setgid/sticky bits.

Fixes #1170

* fix(arch): preserve special mode bits in tar and .MTREE

Map Go's fs.ModeSetuid, fs.ModeSetgid and fs.ModeSticky to 0o4000, 0o2000
and 0o1000, and drop type flags such as fs.ModeDir, at every place the
arch packager writes a mode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 43bc573e-2f55-468c-b8ee-626f73b45f4b
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* test(arch): skip walked file modes on windows

Windows does not keep Unix permission bits on walked files, so the
type: tree expectations do not hold there.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 22ba5e02-24ee-4f35-9aff-e1652a041809
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Amal Saidov <amalsaidov@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 43bc573e-2f55-468c-b8ee-626f73b45f4b
Copilot-Session: 22ba5e02-24ee-4f35-9aff-e1652a041809
2026-11-21 17:54:15 +00:00
..