1
0
mirror of https://github.com/projectatomic/bubblewrap.git synced 2026-02-05 15:45:22 +01:00

664 Commits

Author SHA1 Message Date
Simon McVittie
0c408e156b Merge pull request #729 from abrooks/patch-1
README.md: Fix "Docker pid 1 problem" URL
2026-02-04 11:30:46 +00:00
Aaron Brooks
2c11c8a8e3 README.md: Fix "Docker pid 1 problem" URL
The URL schema of the target site has changed and now returns a 404 for the old URL. This URL accommodates the new URL scheme and points to the original content.

Signed-off-by: Aaron Brooks <aaron@brooks1.net>
2026-02-03 18:52:49 -05:00
Simon McVittie
535238486c Merge pull request #711 from joelpelaez/reset_sigchld_action
Reset SIGCHLD action to SIG_DFL
2026-01-22 19:28:41 +00:00
Joel Pelaez Jorge
80075f3510 Reset SIGCHLD action to SIG_DFL
Signed-off-by: Joel Pelaez Jorge <joel.pelaez.jorge@gmail.com>
2026-01-22 14:12:07 -05:00
Simon McVittie
d0d934e34d Merge pull request #728 from joelpelaez/enable_userns_ci
Enable user namespaces in Ubuntu CI
2026-01-22 19:01:33 +00:00
Joel Pelaez Jorge
f97804f517 Enable user namespaces in Ubuntu CI
Signed-off-by: Joel Pelaez Jorge <joel.pelaez.jorge@gmail.com>
2026-01-22 10:25:51 -05:00
Simon McVittie
d6180f25b1 Merge pull request #694 from neuschaefer/a
Fix grammar in error message
2025-08-04 15:30:38 +01:00
J. Neuschäfer
e023f36f70 Fix grammar in error message
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2025-07-31 21:08:05 +02:00
Simon McVittie
9ca3b05ec7 Prepare v0.11.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
v0.11.0
2024-10-30 16:07:47 +00:00
Simon McVittie
73264b77d2 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-30 15:20:23 +00:00
Simon McVittie
833b32d834 Merge pull request #664 from smcv/completions
completions: Don't try to define more than one variable for pkg-config
2024-10-30 14:55:50 +00:00
Simon McVittie
4021ac2936 NEWS.md: Add items so far for 0.11.0
I find it easier to write this as I go along, instead of writing it all
as part of doing each release.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-18 17:41:13 +01:00
Simon McVittie
3e11554a0d completions: Don't try to define more than one variable for pkg-config
Before Meson 1.3.0, this would not do what we meant (instead defining
prefix to a wrong value composed from the remaining arguments).

The only reason we needed to redefine prefix in the first place is that
bash-completion older than 2.10 did not allow users of its
pkg-config file to override the datadir used to compute its
completionsdir, but that was addressed in version 2.10 (2019).
Users of older bash-completion should set bubblewrap's
bash_completion_dir build option, if the automatically-discovered
default is not appropriate.

Related to https://github.com/containers/bubblewrap/issues/609

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-18 17:21:42 +01:00
Simon McVittie
0545e72383 Merge pull request #662 from smcv/cmsg
Ensure correct alignment when dealing with control messages
2024-10-18 13:35:42 +01:00
Simon McVittie
1fd7c383ef utils: Ensure that the buffer for struct cmsghdr is suitably-aligned
A char array on the stack is not guaranteed to have any particular
alignment.

Resolves: https://github.com/containers/bubblewrap/issues/637
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-17 16:46:53 +01:00
Simon McVittie
33923454fd utils: Don't assume cmsg data is aligned suitably for struct ucred
As documented in cmsg(3), the alignment of control messages is not
guaranteed, so for portability to architectures with strong alignment
requirements we should memcpy to and from a suitably aligned instance
of the desired data structure on the stack.

Helps: https://github.com/containers/bubblewrap/issues/637
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-17 16:46:53 +01:00
Simon McVittie
759517f892 Merge pull request #663 from smcv/builtin-overflow
utils: Add a fallback version of xadd, xmul for ancient gcc
2024-10-17 16:46:47 +01:00
Simon McVittie
bcd9614380 utils: Add a fallback version of xadd, xmul for ancient gcc
bubblewrap is used in some surprisingly old environments, including
version 1 of the Steam Runtime, which has gcc 4.6 or 4.8 as its
default compiler (depending on exactly how you define "default").
These very old versions don't support the builtin used here.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-16 17:53:40 +01:00
Simon McVittie
c1bfc72043 utils: Add doc-comments for xadd, xmul
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-16 17:28:16 +01:00
Simon McVittie
ff33964f33 Merge pull request #547 from rhendric/rhendric/overlayfs
Add --overlay and related options
2024-10-16 17:27:17 +01:00
Ryan Hendrickson
f371022ad6 Add --overlay and related options
This commit adds --overlay, --tmp-overlay, --ro-overlay, and
--overlay-src options to enable bubblewrap to create overlay mounts.
These options are only permitted when bubblewrap is not installed
setuid.

Resolves: https://github.com/containers/bubblewrap/issues/412
Co-authored-by: William Manley <will@williammanley.net>
Signed-off-by: Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>
[smcv: Fix merge conflicts with #660]
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-15 14:22:56 -04:00
Simon McVittie
50cdea6788 Merge pull request #660 from smcv/stdbool
Use stdbool.h for booleans

Reviewed-by: swick
2024-10-08 13:38:07 +01:00
Simon McVittie
812cc7f621 Merge pull request #661 from smcv/Wshadow
utils: Avoid shadowing the names of global functions

Reviewed-by: swick
2024-10-08 13:37:27 +01:00
Simon McVittie
47ff41eb90 Use stdbool.h for booleans
We don't need to reinvent these, especially in a confusing form
(bool type like stdbool.h, but TRUE and FALSE constants like GLib).
stdbool.h was available in the gcc 4.6 that is the default compiler in
Ubuntu 12.04, more than a decade ago, so it seems sufficiently
ubiquitous.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-08 13:35:20 +01:00
Simon McVittie
73abd50683 utils: Avoid shadowing the names of global functions
dirfd() and socket() are POSIX standard library functions, so use dfd
and sockfd instead.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-08 13:34:18 +01:00
Simon McVittie
5dab8b8916 Merge pull request #659 from smcv/issue657
Handle EINTR on blocking I/O

Reviewed-by: swick
2024-10-08 13:32:25 +01:00
Simon McVittie
0c9646573f Handle EINTR when doing I/O on files or sockets
If a blocking operation is interrupted by a signal, including SIGCHLD,
various things can fail with EINTR. This is not a "real" error and can
result in spurious failures.

Resolves: https://github.com/containers/bubblewrap/issues/657
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-03 17:55:37 +01:00
Simon McVittie
654a25d408 utils: Move TEMP_FAILURE_RETRY reimplementation here
This will allow it to be used in more places.

Helps: https://github.com/containers/bubblewrap/issues/657
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-03 17:55:37 +01:00
Simon McVittie
2a552429ec Merge pull request #566 from TotalCaesar659/patch-1
Update URLs to HTTPS
2024-10-01 19:37:33 +01:00
Simon McVittie
2cca54f7c6 Merge pull request #646 from smcv/wip/smcv/level-prefix
Add new --level-prefix option
2024-09-30 20:02:47 +01:00
Simon McVittie
0f99752f6c Merge pull request #647 from sertonix/bool-options
meson: use boolean value for boolean options
2024-09-30 20:02:27 +01:00
Simon McVittie
2d382867c9 Merge pull request #627 from sertonix/stat--format
tests: use stat -c instead of --format for compatibility
2024-09-30 20:01:06 +01:00
Sertonix
c17b4a8709 tests: use stat -c instead of --format for compatibility
eg. busybox stat only has -c and not --format

Signed-off-by: Sertonix <sertonix@posteo.net>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-30 19:54:48 +01:00
Simon McVittie
67400e1af6 Merge pull request #658 from smcv/actions
Update Github Actions configuration
2024-09-30 19:54:39 +01:00
Simon McVittie
fc1dd3dd37 workflows: Use latest version of actions/checkout
It isn't entirely clear to me what the incompatibilities are, but
hopefully in simple cases like ours it's functionally equivalent.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-30 19:49:08 +01:00
Simon McVittie
11b81bbf10 workflows: Use upload-artifact@v4
Reference: https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-30 19:46:32 +01:00
Simon McVittie
d2f85e51a4 Merge pull request #625 from WhyNotHugo/drop-autotools
Remove autotools build system
2024-09-03 14:00:12 +01:00
Hugo Osvaldo Barrera
2834c01cab Remove autotools build system
Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-03 13:47:25 +01:00
Simon McVittie
89ae6b10a4 Add new --level-prefix option
This prepends a severity level such as <3> to each line of diagnostic
output, with numeric severity levels taken from matching syslog(3)
(such as LOG_ERR = 3), so that the diagnostic output can be parsed by
tools like `logger --prio-prefix` and `systemd-cat --level-prefix=1`
that support that encoding.

The facility (LOG_USER, etc.) is not included, since it makes little
sense to vary on a per-message basis. logger(1) supports prefixes
with or without a facility, and systemd-cat(1) only supports prefixes
without a facility, so this is compatible with both.

A future version of Steam's pressure-vessel is likely to use this to
make warnings and fatal errors from bubblewrap more visible.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-15 15:01:35 +01:00
Simon McVittie
9b9fa15a72 utils: Put nearly all diagnostic output through a common log function
This takes a syslog-style severity level, allowing a larger program
that runs bwrap and reads a pipe from its stderr to filter or highlight
messages  based on the severity.

Take the opportunity to make the __debug__ macro (which normally expands
to nothing, but can be enabled by changing a `#if 0` to `#if 1`) less
weird and easier to use, by taking it out of the reserved-for-the-compiler
namespace, adding a newline automatically, and not requiring nested
parentheses.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-15 15:01:00 +01:00
Simon McVittie
2514597193 test-run: Assert that repeating --chdir logs a warning
This is the case since commit 0d369cd "main: Warn when
non-repeatable options are repeated".

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-15 15:00:57 +01:00
Simon McVittie
dc63ec667e Prepare v0.10.0
Signed-off-by: Simon McVittie <smcv@debian.org>
v0.10.0
2024-08-14 09:30:44 +01:00
Simon McVittie
8b7a174930 Bump version number for a 0.10.0 release candidate
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-08-12 18:58:09 +01:00
Sertonix
aeeade8ef6 meson: use boolean value for boolean options
string values for boolean options will be deprecated in a future version
of meson.

Signed-off-by: Sertonix <sertonix@posteo.net>
2024-07-25 21:52:20 +02:00
Alexander Larsson
a253257cd2 Add --bind-fd and --ro-bind-fd to let you bind a O_PATH fd.
This is useful for example if you for some reason don't have the real
path. It is also a way to make bind-mounts race-free (i.e. to have the
mount actually be the thing you wanted to be mounted, avoiding issues
where some other process replaces the target in parallel with the bwrap
launch.

Unfortunately due to some technical details we can't actually directly
mount the dirfd, as they come from different user namespace which is not
permitted, but at least we can delay resolving the fd to a path as much as
possible, and then validate after mount that we actually mounted the right
thing.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-07-16 18:14:03 +01:00
Simon McVittie
973fe36146 Merge pull request #636 from alexlarsson/fix-flag-typo
Fix SetupOpFlag value to be proper format
2024-06-18 12:20:35 +01:00
Alexander Larsson
83af951948 Fix SetupOpFlag value to be proper format
For some reason the second flags is "2<<0", but really flags should
be 1<<N, and in this case 1<<1. Both happen to be the same value, so its
not like this matter deeply, but lets fix it if we do later changes.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-06-18 10:06:03 +02:00
Simon McVittie
8e51677abd Prepare v0.9.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
v0.9.0
2024-03-26 21:08:55 +00:00
Simon McVittie
041e3c5085 Merge pull request #624 from smcv/ssize-max
utils: Don't let ssize_t overflow when reading very large files
2024-03-26 20:45:59 +00:00
Simon McVittie
b6bbba5ceb utils: Don't let ssize_t overflow when reading very large files
The size to be allocated is tracked as ssize_t, so if it's larger than
this, doubling it would cause a signed overflow.

Limiting the data we will read into memory to SSIZE_MAX/2 still lets it
occupy 25% of addressable memory (1 GiB on 32-bit or some very large
amount on 64-bit), which should be adequate. In practice we expect this
function to read a few KiB at most.

In practice we're likely to run out of memory before reaching this
point; changing this to SSIZE_MAX / 8, compiling as 32-bit and running
`${builddir}/bwrap --args 0 < /dev/zero` is a convenient way to test
this code path.

Fixes: 422c078e "Check for allocation size overflows"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-03-25 17:52:32 +00:00