Commit Graph
79 Commits
Author SHA1 Message Date
Luca BRUNO 840cd7ab2d libostree/sepolicy: get rid of a g_setenv() call
This removes a 'g_setenv()' call, which could potentially be unsafe
in a multi-thread context.
The current libselinux codebase does not seem to check for
`LIBSELINUX_DISABLE_PCRE_PRECOMPILED`, so I think this has no effects
nowadays.
Additionally, I could not find any reference to it in libselinux
git history, so I'm not sure if it ever played any role at all.

My current understanding is that this is coming from version
incompatibilities between an older libselinux in the build environment
and a newer policy (with precompiled regexs) in the target.
But from the ML discussion I found, I think it eventually got
solved in a different way, possibly by avoiding the policy binary
caches.

Refs:
 * https://www.spinics.net/lists/selinux/msg14822.html
 * https://github.com/ostreedev/ostree/pull/2513#discussion_r781042884
2022-01-11 15:56:13 +00:00
Luca Bruno 7cc8481907 Merge pull request #2513 from lucab/ups/setenv-error
ostree: check g_setenv return value
2022-01-10 17:38:50 +00:00
Luca BRUNO 0bdba574d7 ostree: check g_setenv return value
This adds proper return-value checks on g_setenv calls.
It fixes a static analysis warning highlighted by Coverity.
2022-01-10 13:33:36 +00:00
Luca Bruno 92025018f6 Merge pull request #2512 from lucab/ups/variant-builder-error-memleak
libotutil: avoid leaking builder memory on error
2022-01-10 13:32:25 +00:00
Luca BRUNO 0b1a085692 libotutil: avoid leaking builder memory on error
This swaps the order of a couple of input sanity checks, in order
to fix a minor memory leak due to an early-return on the error
path.
Memory for the result is now allocated only after input has been
sanity-checked.
It fixes a static analysis warning highlighted by Coverity.
2022-01-10 09:30:11 +00:00
Luca Bruno 6cb097fb5e Merge pull request #2509 from ostreedev/release-2022.1
Release 2022.1
2022-01-05 14:32:55 +00:00
Luca BRUNO 9d3ef89230 configure: post-release version bump 2022-01-05 10:03:59 +00:00
Luca BRUNO 6c903ab0b6 Release 2022.1 2022-01-05 10:03:03 +00:00
Luca BRUNO 2bfdcea2c5 github: add dependabot config
This adds a configuration file for dependabot, taking care of automatic
updates for all git submodules.
2022-01-04 10:34:30 +00:00
Luca Bruno a3555f4d12 Merge pull request #2376 from smcv/fuse3
rofiles-fuse: Build using FUSE 3 if possible, falling back to FUSE 2
2022-01-04 10:27:14 +00:00
Luca BRUNO eae35b7f6e lib/static-delta: throw a proper error on bspatch failure
This makes sure that a populated GError is returned when bsdiff
patching fails. The human-friendly label also helps in debugging.
2022-01-03 17:38:51 +00:00
Luca BRUNO 97399c166d bsdiff: bump submodule, pick up fix for CVE-2014-9862
This updates the bsdiff submodule to latest upstream revision, in
order to pick up additional bound checks for CVE-2014-9862.

Update submodule: bsdiff
Ref:
 * https://www.x41-dsec.de/lab/advisories/x41-2020-006-bspatch/
2022-01-03 16:13:01 +00:00
Luca BRUNO cf814284e0 lib: use ostree-content-writer header
This installs and exposes the content of `ostree-content-writer.h`,
so that library consumers can properly reference symbols defined
in that header.
2022-01-03 14:20:58 +00:00
Luca Bruno 998863e74d Merge pull request #2501 from lucab/ups/test-cli-extensions-tweak
tests/cli-extensions: tweak test logic
2021-12-21 14:08:48 +00:00
Luca BRUNO 5dbe37ce78 tests/cli-extensions: tweak test logic
This updates the test logic for CLI extensions, actually checking
for functional output from the subcommand.
It also cleans up some environmental leftover.
2021-12-21 10:18:30 +00:00
Luca BRUNO 513b3c09a5 main: add support for CLI extensions via external binaries
This adds some logic to detect and dispatch unknown subcommands to
extensions available in `$PATH`. Additional commands can be
implemented by adding relevant `ostree-$verb` binaries to the system.

As an example, if a `/usr/bin/ostree-extcommand` extension is provided,
the execution of `ostree extcommand --help` will be dispatched to that
as `ostree-extcommand extcommand --help`.
2021-12-20 10:00:02 +00:00
Luca BRUNO f44eaf7e8c tests: assert mandatory values are present
This adds a couple of string assertions to make sure that
the test run is sane.
2021-12-10 11:33:35 +00:00
Luca BRUNO 58bdfb90c9 lib/repo: do no return a NULL on failure
This turns an existing check into an assert. The previously returned
NULL may result in confusing callers, as none of them is checking for
that.
2021-12-07 16:24:56 +00:00
Luca BRUNO 4a0ebe507f lib/repo: do no return an arbitrary mode on failure
This turns the existing check into an assert. Otherwise, the previous
code may return an arbitrary repo mode (bare) on failure.
2021-12-07 16:23:02 +00:00
Luca BRUNO f1e24945fa lib/repo: assert that writable state and error agree
This adds an assertion to check that writable stable and error
are in sync. The subsequent logic uses them interchangeably.
2021-12-07 16:21:21 +00:00
Luca BRUNO cefc1d7854 lib: misc static analysis fixes
This fixes a few warnings from coverity, none of which really
interesting.
2021-11-26 15:11:00 +00:00
Luca BRUNO 281d310224 configure: post-release version bump 2021-11-23 10:15:19 +00:00
Luca BRUNO f1155c8d28 Release 2021.6 2021-11-23 10:13:32 +00:00
Luca Bruno edbcf52134 Merge pull request #2481 from refi64/null-error
lib: Avoid dereferencing NULL error values
2021-11-12 15:19:29 +00:00
Luca BRUNO 63d0c4c781 prepare-root: check for read-only sysroot status early on
This moves read-only sysroot checks upfront, so that they are not
intermixed with mount operations.
It has no immediate side-effects, but allow these check to be
independent from the rest of the mounting logic (and future changes
to it).
2021-11-01 09:42:36 +00:00
Luca BRUNO 7c17daad17 prepare-root: get rid of a global variable
This moves a global mutable variable to a smaller local scope,
as it is not really used outside of that.
2021-10-26 16:27:22 +00:00
Luca BRUNO ca84da679a prepare-root: check return codes for errors when assembling paths
This adds checks around all `snprintf` calls in order to detect
failures and gracefully abort.
2021-10-26 16:16:34 +00:00
Luca BRUNO 848fe542af prepare-root: make all mount operations silent
This adds a `MS_SILENT` flag to all `mount(2)` calls, reducing the
amount of kernel logs produced on each boot.
Those messages do not contain actionable details, and in the "mount
plus read-only remount" case they can easily become highly redundant.
2021-10-26 10:51:37 +00:00
Luca Bruno 9692437491 Merge pull request #2468 from lucab/ups/tests-var-mount
tests/var-mount: tweak test setup
2021-10-19 09:03:19 +00:00
Luca BRUNO f93d96620c tests/var-mount: tweak test setup
This reworks the var-mount destructive test in order to properly use
the datadir for the current stateroot instead of a duplicated one.
In turn, it ensures that the resulting `var.mount` after reboot is
correctly pointing to the same location which hosted `/var` on the
previous boot.
2021-10-19 08:03:09 +00:00
Luca Bruno 5d045f3ae1 Merge pull request #2466 from cgwalters/ci-fanalyzer
ci: Enable -fanalyzer
2021-10-18 16:44:56 +00:00
Luca Bruno ec8cf31e98 Merge pull request #2455 from cgwalters/packit
Attempt to update packit flow to build in COPR
2021-10-15 07:47:28 +00:00
Luca Bruno 6b8295ada1 Merge pull request #2463 from cgwalters/fix-fanalyzer
Fix various mostly theoretical gcc `-fanalyzer` issues
2021-10-14 08:30:25 +00:00
Luca Bruno 16157e77e5 Merge pull request #2465 from travier/docfixes
docs: Do not convert -- & --- to en/em-dash
2021-10-12 09:49:39 +00:00
Luca BRUNO 8a9737aa6e repo/private: move OstreeRepoAutoTransaction to a boxed type
This defines `OstreeRepoAutoTransaction` as a boxed type, in order
to support auto-generating bindings for it.
That first requires adding internal reference-counting to it, to
allow freely copying/freeing references to a single transaction guard.
2021-10-11 06:52:25 +00:00
Luca BRUNO f4be52ba24 prepare-root: tweak log messages to clarify errors
This rewords errors and log messages in the functions which take care
of preparing sysroot in initramfs.
Depending on the boot flow, it is possible to reach this logic
with a sysroot mounted (unexpectedly) as read-only.
In that case, let's clearly point out the problematic mountpoint.
2021-10-07 14:56:47 +00:00
Luca BRUNO c987534595 repo/private: allow committing/aborting through a transaction guard
This enhances the auto-transaction logic, augmenting the scope of a
transaction guard.
It allows committing or aborting a transaction through its guard.
It also supports tracking the completion status of a transaction
guard, avoiding double commits/aborts, while retaining the auto-cleanup
logic.
2021-10-05 12:23:22 +00:00
Luca Bruno 7e4c4f2a69 Merge pull request #2435 from RBuddel/fix-delta-files-resume-legacy-transaction
repo-pull: legacy_transaction_resuming flag ignored
2021-09-08 08:52:54 +00:00
Luca Bruno 20db6e52d1 Merge pull request #2430 from cgwalters/stabilize-staging
upgrade: Stabilize deployment staging
2021-09-08 08:18:00 +00:00
Luca BRUNO fff24089dd tests: skip a broken fsck case
There are some existing issues around fsck in unprivileged bare mode,
so this test does not really work at the moment. Leaving it as a FIXME
for the moment.
2021-09-06 07:52:42 +00:00
Luca BRUNO aa0bb176c5 tests/basic: avoid changing ownership
This avoids possible issues when trying to chmod, tweaking
permissions instead.
2021-09-06 07:41:02 +00:00
Luca BRUNO 27fcee861a libtest: tweak selinux/relabel message 2021-09-06 07:41:00 +00:00
Luca Bruno cfa2aec839 Merge pull request #2426 from cgwalters/xattrs-bareuseronly-union
checkout: Also ignore xattrs for union in bare-user-only mode
2021-08-27 07:34:46 +00:00
Luca Bruno 7fb0266df6 Merge pull request #2425 from cgwalters/hardlink-correct-errno
checkout: Save errno when re-throwing
2021-08-27 07:33:27 +00:00
Luca BRUNO c64b4bceba lib: improve transactions auto-cleanup logic
This fixes some aspects of OstreeRepoAutoTransaction and re-aligns
it with the logic in flatpak. Specifically:
 * link to the underlying repo through refcounting
 * bridge internal errors to warning messages
 * verify the input pointer type

This is a preparation step before exposing this logic as a public API.
2021-08-25 16:17:52 +00:00
Luca Bruno 30909a28f2 Merge pull request #2418 from lucab/ups/lib-commit-xattrs
commit: automatically skip xattrs in bare-user-only mode
2021-08-24 14:28:39 +00:00
Luca BRUNO 00660eae79 tests: update several bare-user-only checks 2021-08-24 07:56:48 +00:00
Luca BRUNO 3e2360e3bb lib/commit: automatically skip xattrs in bare-user-only mode 2021-08-24 07:56:46 +00:00
Luca BRUNO f75552e15c builtins/commit: set up relevant flags in bare-user-only mode
This detects bare-user-only mode and automatically enables a
commit modifier with relevant flags.
2021-08-24 07:56:19 +00:00
Luca BRUNO 0276f4dc0c lib/diff: automatically skip xattrs in bare-user-only mode 2021-08-24 07:56:18 +00:00
Luca Bruno 89432b2e2d Merge pull request #2419 from dbnicholson/gpg-list-keys
bin/remote: Rename list-gpg-keys to gpg-list-keys
2021-08-24 07:55:59 +00:00
Luca BRUNO 06ff77cfeb lib/diff: ignore xattrs if disabled on either repos
This fixes the logic to detect whether xattrs should be automatically
ignored when diffing.
2021-08-23 13:31:13 +00:00
Luca BRUNO 8a5241dd6a lib/commit: autofix permissions for bare-user-only
This tweaks commit logic to detect bare-user-only repositories and
canonicalize permissions automatically.
2021-08-20 16:11:04 +00:00
Luca Bruno 3209acbdbe Merge pull request #2415 from lucab/ups/checksum-canonical-perms
lib/checkout: use canonical permissions in bare-user-only mode
2021-08-19 17:00:14 +00:00
Luca BRUNO d41fcd17a7 lib/repo/checkout: use canonical perms in bare-user-only mode
This automatically enables canonical permissions for checkouts in
bare-user-only mode.
2021-08-19 16:09:54 +00:00
Luca BRUNO c6b72f527b lib/core/checksum: add flag to use canonical permissions
This adds a new `OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS`
checksumming flag, which is needed in bare-user-only mode
to ignore local IDs.
2021-08-19 14:08:36 +00:00
Luca BRUNO b079c11381 builtins/commit: move commit modifier to auto-cleanup
This reduces the usage of goto cleanup logic by porting the commit
modifier pointer to autoptr.
2021-08-18 09:06:26 +00:00
Luca BRUNO 5a3d5fb86f builtins/commit: check for conflicting permissions options
This explicitly checks for commit command options asking for both
non-zero UID/GID and canonical permissions at the same time,
which are incompatible.
2021-08-18 08:16:26 +00:00
Luca Bruno 87db562744 Merge pull request #2409 from jlebon/pr/cov-fixes
A couple of Coverity fixes
2021-08-04 06:13:37 +00:00
Luca Bruno 5023278293 Merge pull request #2406 from liujianqiang-niu/main
fix: Avoid wild pointers
2021-07-28 08:26:45 +00:00
Luca Bruno 835b114192 Merge pull request #2407 from smcv/tests-source-date-epoch
tests: Unset SOURCE_DATE_EPOCH
2021-07-26 11:52:06 +00:00
Luca BRUNO 3f852d9443 configure: post-release version bump 2021-07-12 08:40:14 +00:00
Luca BRUNO 38c14b3745 Release 2021.3 2021-07-12 08:38:38 +00:00
Luca BRUNO d573b8dc2f ci/release-build: evaluate package_version from m4 definition
This fixes the ci-release-build.sh script to directly source
and evaluate 'package_version' from its m4 definition, without
requiring a fully configured source tree.
2021-07-09 16:17:31 +00:00
Luca BRUNO 70a8f56ce1 lib/commit: respect SOURCE_DATE_EPOCH for commit timestamp
This tweaks `ostree_repo_write_commit` so that it checks for the
envinroment variable `SOURCE_DATE_EPOCH` as a way to override
the current time, which is used as the commit timestamp.

Ref: https://reproducible-builds.org/docs/source-date-epoch/
Ref: https://reproducible-builds.org/specs/source-date-epoch/
2021-06-22 12:15:18 +00:00
Luca Bruno 47b7b1efc2 Merge pull request #2384 from smcv/dedup-report-err
libtest.sh: Remove duplicate ERR trap and report_err()
2021-06-22 11:36:51 +00:00
Luca Bruno 36693f064c Merge pull request #2336 from bgilbert/edit
docs: fix "Edit this page on GitHub" links
2021-04-13 12:14:52 +00:00
Luca Bruno 078f022cfe Merge pull request #2326 from cgwalters/writing-api-prep
core: Drop unused error handling from object stream helper
2021-04-08 08:12:59 +00:00
Luca Bruno 9154f41fd4 Merge pull request #2324 from cgwalters/test-use-ex
Various patches for tests/inst
2021-04-08 08:10:05 +00:00
Luca BRUNO bf2c23ca06 tests/ext/destructive: enhance test logic
This enhances external-tests logic, ensuring that destructive tests
have retries and some context to pinpoint failures, and that failed-state
services are reset between iterations.
2021-02-03 12:25:02 +00:00
Luca BRUNO 8ece70b207 templates: add release-checklist
This collects all release steps in a release-checklist template.
2020-11-18 13:05:07 +00:00
Luca BRUNO 9567a0e91c workflow/release: further refinements
This tweaks the release GH workflow further so that it only triggers
when the `configure.ac` file (which owns the version) changes.
Plus it properly checkouts the PR branch to avoid wrongly looking
at a synthetic merge commit.
2020-11-18 10:24:32 +00:00
Luca BRUNO 3c3651417c configure: post-release version bump 2020-11-17 10:50:56 +00:00
Luca BRUNO 3e289b1934 Release 2020.8 2020-11-17 10:32:57 +00:00
Luca BRUNO ee57fe2821 workflows/release: pattern-match on PR title
This adds an additional condition in order to run sanity check all
PRs starting with `Release` (case-insensitive).
2020-11-16 17:13:47 +00:00
Luca BRUNO 0d0eb4715b ci: run ci-release-build.sh on GitHub
This adds a GitHub action in order to run ci-release-build.sh on
release PRs (detected via the `kind/release` label).
2020-11-16 11:14:40 +00:00
Luca BRUNO 1c65498d77 ci/travis: move to newer base distro
This removes the old pinned distro (Ubuntu Trusty 14.04) from Travis,
moving to the newer default distro (Ubuntu Xenial 16.04).
2020-11-10 13:06:34 +00:00
Luca Bruno 3ecbdd8197 lib/kargs: allow empty-list arguments
This adds support for empty-list arguments (e.g. `acpi_osi=`), which
are semantically different from simple-keyword arguments.

Ref: https://github.com/projectatomic/rpm-ostree/issues/1706

Closes: #1785
Approved by: cgwalters
2018-12-10 19:39:23 +00:00
Luca Bruno 52f7ba1878 rust/bupsplit: minor idiomatic fixes
This fixes a few un-idiomatic bits in Rust bupsplit code, getting rid
of some unchecked casts and an assert statement.

Closes: #1502
Approved by: cgwalters
2018-03-17 19:59:06 +00:00