storage/pkg/fileutils
Shahar Liberman a6d2ba2fd1 Fix: Overlay fails with a permission error when trying to create and access layers.
When the overlay driver (and some others) tries to access the directories for the relevant layers it uses faccessat syscall (in fileutils.Exists() fileutils.Lexists()).
The syscall is missing the AT_EACCESS flag and so permissions to access the files are determined solely on the uid.
This error happens when we run with a user that has the correct capabilities to access the file (e.g cap_dac_override) but the file permissions don't allow the specific user.

This commit adds the AT_EACCESS flag to the faccessat syscall in Exists() and Lexists() functions to ensure that they will be able to verify file existence based on the effective user.

Signed-off-by: Shahar Liberman <shahar.liberman@wiz.io>
2025-03-20 14:31:11 +02:00
..
exists_freebsd.go pkg/fileutils: fix Lexists on FreeBSD (second attempt) 2024-08-23 11:13:03 +01:00
exists_test.go Use range iterations 2024-09-05 18:56:35 +02:00
exists_unix.go Fix: Overlay fails with a permission error when trying to create and access layers. 2025-03-20 14:31:11 +02:00
exists_windows.go fileutils: new functions to check for path existence 2024-04-08 16:07:26 +02:00
fileutils.go fileutils: use fileutils.{Le,E}xists() 2024-04-08 16:07:26 +02:00
fileutils_darwin.go add fileutils_darwin.go in pkg/fileutils to support darwin platform 2016-07-01 13:02:26 +08:00
fileutils_solaris.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
fileutils_test.go Format sources with gofumpt 2023-05-26 16:17:31 -07:00
fileutils_unix.go all: remove old-style +build tags 2024-09-19 17:00:48 -07:00
fileutils_windows.go Windows: Fix warning on info 2015-09-18 13:39:12 -07:00
reflink_linux.go pkg/fileutils: add ReflinkOrCopy() 2025-02-10 12:10:26 +01:00
reflink_unsupported.go pkg/fileutils: add ReflinkOrCopy() 2025-02-10 12:10:26 +01:00