Commit Graph

9 Commits

Author SHA1 Message Date
Miloslav Trmač 5c67136767 Move pkg/chunked/internal to pkg/chunked/internal/minimal
We now have several internal subpackages of pkg/chunked, so delineate
more explicitly the parts that should be kept as small as possible
because the c/image compression package depends on them.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-12-13 01:27:58 +01:00
Giuseppe Scrivano ce0186617a
chunked: improve creation of files under root
ihen the file name is the root directory, avoid using an empty string
or the ".." name to open the file.  The latter does not cause any
security issues or unexpected behavior, it is logically incorrect and
should be avoided.

Closes: https://github.com/containers/storage/issues/2191

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-12-11 13:36:03 +01:00
Giuseppe Scrivano 489db7e50f
chunked: change some assert to require
the returned file object is used later, so fail immediately if it
could not be opened.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-12-11 11:03:41 +01:00
Colin Walters 12363bda1b overlay,chunked: Add some more O_CLOEXEC
Just some more missing `O_CLOEXEC` I noticed while reading
the code for unrelated reasons.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-29 08:42:39 -04:00
Miloslav Trmač 412ff916c2 Remove various unused parameters
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-07-10 23:54:30 +02:00
Jan Rodák 5487d49874
Cast syscall.Stat_t.Nlink to uint64
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2024-06-25 18:56:18 +02:00
Giuseppe Scrivano 097fcb9be6
chunked: return PathError for appendHole errors
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-07 17:25:27 +02:00
Giuseppe Scrivano 62c4c243a3
chunked: refactor doHardLink to get full destination path
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-07 17:24:23 +02:00
Giuseppe Scrivano 42801b27de
chunked: add tests for filesystem operations
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-07 14:38:24 +02:00