- Add comments that make clear these are internal values
- Rename "Enabled" to "IfAvailable" to clarify what it does
- Also note that `DifferFsVerityRequired` is not actually set by anything
in this codebase.
Signed-off-by: Colin Walters <walters@verbum.org>
I was just reading the code and I have a mental checklist item
for "invoking open without O_CLOEXEC" that triggered here.
(See also e.g.
https://github.com/containers/composefs/pull/185#discussion_r1322925050
)
It has security-relevant properties for us, xref
CVE-2024-21626 for example.
This isn't the only missing variant of this in this codebase,
just using this targeted PR to test the waters for more PRs.
Signed-off-by: Colin Walters <walters@verbum.org>
Add validation for duplicate entries. Duplicates are ignored, unless
there is a mismatch in the values. In that case, an error is returned.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
otherwise if the root is stored as "./", it ends up adding the root
node twice causing mkcomposefs to fail.
Closes: https://github.com/containers/storage/issues/1941
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
To avoid a mismatch with the C composefs library that uses isgraph()
and isprint(), do not use the unicode package but provide the expected
definition for these functions.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
always consume the tar-split data when present to avoid blocking the
producer. Previously, the tar-split data was only read when the digest
was specified.
commit 6875c9fbcf introduced the
regression.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Increase the threshold for auto-merging parts from 128 to 1024. This change
aims to reduce the number of parts in an HTTP multi-range request, thus
increasing the likelihood that the server will accept the request.
The previous threshold of 128 often resulted in a large number of small
ranges, which could lead to HTTP multi-range requests being rejected by
servers due to the excessive number of parts.
It partially addresses the reported issue.
Reported-by: https://github.com/containers/storage/issues/1928
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if a digest was not specified in the TOC, ignore completely the
tar-split data.
Otherwise the clients fail to pull images created before commit
b5413c2bd6.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
For packaging for NetBSD, we will patch this file anyway (we don't
have a hard-coded install directory for packages)
Signed-off-by: Maya Rashish <maya@NetBSD.org>
Between the _windows file and _unix file being used by non-windows,
we catch all cases.
The _others file is probably a maintenance burden and every new OS
needs to be excluded from building it.
Signed-off-by: Maya Rashish <maya@NetBSD.org>
the removed code is not reachable since permsKnown must be true to be
in this code branch.
Closes: https://github.com/containers/storage/issues/1900
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
We used to override the root directory permission only when the record
for the root directory exists in the archive. However,
docker.io/ubuntu:jammy-20240427 lacks such a record and not overriding
the root directory permission makes all other permission overrides
invalid.
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
it solves this error with mkcomposefs when the TOC doesn't specify the
parent directory for an entry:
Error: committing the finished image: failed to put layer using a partial pull: failed to convert json to erofs: exit status 1: mkcomposefs: Parent directory missing for /usr/share/locale/ca/LC_MESSAGES/libc.mo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
As documented at the top of the store type,
the roLayerStores must be locked _before_
the container store.
This is a minimal / conservative fix; this
probably could use a read-only lock only for the
duration of the "LayerID == parent" check.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
There's no need for the callers to deal with this,
and now the API of the function is much less surprising.
Also fix the documentation about locking rlstores.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>