Commit Graph
100 Commits
Author SHA1 Message Date
Luca BRUNO 273089d9e4 lib/bootloader: assert invariants
This tweaks some invariants checks into full assertions, in order
to avoid returning to the caller in case of known invalid states.
2022-09-05 09:27:38 +00:00
Luca Bruno a266fabb77 Merge pull request #2702 from thesamesam/bashism
buildutil/glibtests.m4: fix bashism
2022-08-24 13:24:35 +00:00
Luca Bruno f0abd9de30 Merge pull request #2700 from jlebon/pr/staged-docs
docs: Add section about staged deployments
2022-08-24 13:17:41 +00:00
Luca BRUNO ff7d9a8a6d libostree: fix a typo in annotation
This fixes a typo in the `allow-none` annotation on
`ostree_sysroot_deployment_set_kargs_in_place` argument.
2022-08-19 10:39:09 +00:00
Luca Bruno ea2f0c2943 Merge pull request #2690 from cgwalters/cli-less-goto-1
cli/rev-parse: Port to new code style
2022-08-17 07:21:55 +00:00
Luca Bruno e424efa1e4 Merge pull request #2686 from cgwalters/include-cleanups
Handle conflicts between newer glibc and kernel headers
2022-08-04 07:02:08 +00:00
Luca Bruno 5de689b846 Merge pull request #2683 from cgwalters/sync-deny
deny.toml: Add `Unicode-DFS-2016`
2022-08-03 11:41:18 +00:00
Luca Bruno f2ea2f30cc Merge pull request #2675 from HuijingHei/update-doc
Update doc about adding new function to libostree
2022-07-15 18:25:13 +00:00
Luca Bruno 68d1f54c5a Merge pull request #2646 from cgwalters/bindings-tests
rust-bindings: Wire up `tests/`
2022-06-13 07:46:14 +00:00
Luca Bruno ca1fbc59ce Merge pull request #2645 from cgwalters/fsck-more-cleanups
fsck: A few more cleanups
2022-06-13 07:32:33 +00:00
Luca Bruno 485caca538 Merge pull request #2620 from jameswestman/lookup-annotations
Fix annotations on ostree_mutable_tree_lookup()
2022-06-02 15:38:46 +00:00
Luca Bruno 7aa17acd8d Merge pull request #2613 from GuiltyDoggy/man-update
man: Fix ostree-admin-instutil subcommands
2022-05-30 17:35:05 +00:00
Luca Bruno ed79299fc3 Merge pull request #2618 from jlebon/pr/copr-fix
copr: mark git checkout as safe
2022-05-27 06:37:54 +00:00
Luca Bruno cdfc2ff5bf Merge pull request #2616 from HuijingHei/dup-osname
Remove dup "--os=OSNAME" line in output of "ostree admin config-diff --help"
2022-05-25 07:00:12 +00:00
Luca Bruno 39a953dfa5 Merge pull request #2606 from ostreedev/dependabot/submodules/libglnx-c59eb27
build(deps): bump libglnx from `c71f7ae` to `c59eb27`
2022-05-12 13:18:45 +00:00
Luca BRUNO d1fad37d1a ostree: release 0.13.7 2022-05-06 12:53:57 -04:00
Luca BRUNO 04c8e3e9f3 ostree: manually patch generated files
This manually adds a missing `ToGlibPtr` import, which seems to be result
of some bugs in `gir` code-generation.
2022-05-06 12:53:57 -04:00
Luca BRUNO dd0cfc6d4b ostree: refresh after gir bump 2022-05-06 12:53:57 -04:00
Luca BRUNO 3fc55a524b ostree/cargo: bump to ostree-sys 0.9.2 2022-05-06 12:53:57 -04:00
Luca BRUNO 61b4629b37 ostree-sys: release 0.9.2 2022-05-06 12:53:57 -04:00
Luca BRUNO cf5462178c ostree-sys: refresh after gir bump 2022-05-06 12:53:57 -04:00
Luca BRUNO 1cb07e0ca5 gir-files: bump to v2022.2 2022-05-06 12:53:57 -04:00
Luca BRUNO f01c847a68 ci: add jobs for MSRV checks and linting
This adds two jobs in order to check minimum toolchain compatibility,
and for overall linting.
2022-05-06 12:53:57 -04:00
Luca BRUNO 83b03d2996 lib: run rustfmt 2022-05-06 12:53:57 -04:00
Luca BRUNO 810e86d4fb lib: fix new clippy warnings
This fixes the following warnings highlighted by clippy:
 * https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
 * https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
 * https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
2022-05-06 12:53:57 -04:00
Luca BRUNO 86295e3bfe sys/cargo: refresh manifest
This updates stale dependencies and remove leftover settings.
2022-05-06 12:53:57 -04:00
Luca BRUNO 51a03e199c sysroot: support create and load actions on builder
This splits the builder completion step into separate actions for
creating/loading a sysroot.
It also introduces a roundtrip test over a freshly-created empty
sysroot.
2022-05-06 12:53:57 -04:00
Luca BRUNO ec572d786e sysroot: add a builder object
This adds a `SysrootBuilder` in order to allow consumers to load
a configured `Sysroot` in an ergonomic way. It tries to prevent
logic bugs coming from handling half-initialized entities.
2022-05-06 12:53:57 -04:00
Luca BRUNO f3df1175f8 cargo: bump ostree-sys to 0.8.1 2022-05-06 12:53:57 -04:00
Luca BRUNO b2c6dd61a1 ostree: release 0.12.1 2022-05-06 12:53:56 -04:00
Luca BRUNO fdfaea1864 cargo: point to docs.rs and clean up
This removes stale URLs, pointing to the auto-built docpages at
docs.rs and sorting manifest entries.
2022-05-06 12:53:56 -04:00
Luca BRUNO 20a025a0eb lib: fix 'dox' feature
This makes sure docs can be properly built when using the 'dox'
feature. It should fix auto-builds on docs.rs.
2022-05-06 12:53:56 -04:00
Luca BRUNO 712570b9b7 cargo: fix version in features chain
This fixes the definition of the `v2016_4` feature.
It restores the chain of versions so that 2016.3 symbols can be
actually reached from newer features/versions.
2022-05-06 12:53:56 -04:00
Luca BRUNO 78ca01c4e3 repo_transaction_stats: move to a manual implementation
This moves `RepoTransactionStats` into a manually implemented
source file in order to provide getters to expose relevant
fields.
2022-05-06 12:53:56 -04:00
Luca BRUNO 83956daeee ci/github: add a job for --without-libsystemd 2022-05-06 10:07:24 +00:00
Luca BRUNO 4b7fc4f1e9 lib/ostree-sysroot-deploy: add a missing include for stdint.h 2022-05-06 10:07:23 +00:00
Luca BRUNO 7e83726faa tests: move fixture to fix installed tests
This moves around the packed archive for bare-split-xattrs mode,
in order to fix installed tests.
2022-04-12 09:53:54 +00:00
Luca Bruno 2f11977da5 Merge pull request #2563 from cgwalters/tmpfiles-run
tmpfiles: Create `/run/ostree`
2022-03-11 18:54:49 +00:00
Luca Bruno 087f850227 Merge pull request #2564 from damdo/patch-1
README.md: update ostree-rs language binding link
2022-03-11 17:57:26 +00:00
Luca Bruno 0d6e66b57a Merge pull request #2562 from josepht/main
Add Fedora Kinoite link to index.md also.
2022-03-10 21:05:02 +00:00
Luca BRUNO ca0bb75954 apidoc: add missing page includes
This fixes some missing sections in API reference, adding all the
relevant includes.
2022-03-07 08:33:08 +00:00
Luca BRUNO aca5671eb1 tests/basic-bare-split-xattrs: add fixture, check read logic 2022-03-03 11:11:59 +00:00
Luca BRUNO 7e79b82ff8 lib/commit: disallow writing content in 'bare-split-xattrs' mode
This prevents writing content into 'bare-split-xattrs` repository,
while carving some space for experimenting via a temporary
`OSTREE_EXP_WRITE_BARE_SPLIT_XATTRS` environment flag.
2022-03-02 16:45:02 +00:00
Luca BRUNO 14a6e6d8d0 lib/repo: read split xattrs content from file-xattrs-link objects 2022-03-02 16:45:01 +00:00
Luca BRUNO 08e98e9042 lib/core: introduce 'bare-split-xattrs' mode 2022-03-02 16:45:00 +00:00
Luca BRUNO 2c60f302f9 lib/core: introduce two new object types for split xattrs
This adds two new object types for storing xattrs separately from
content objects.

`.file-xattrs` are regular files storing xattrs content, encoded as
GVariant. Each object is keyed by the checksum of its content, allowing
for multiple references.

`.file-xattrs-link` are hardlinks which are associated to file objects.
Each object is keyed by the same checksum of the corresponding file
object. The target of the hardlink is an existing file-xattrs object.
In case of reaching the limit of too many links, this object could be
a plain file too.
2022-03-02 16:44:59 +00:00
Luca Bruno 6ad4a3457f Merge pull request #2554 from ostreedev/dependabot/submodules/libglnx-c71f7ae
build(deps): bump libglnx from `88da8dd` to `c71f7ae`
2022-03-02 16:44:31 +00:00
Luca Bruno 4a38ac7b8d Merge pull request #2552 from ostreedev/dependabot/submodules/libglnx-88da8dd
build(deps): bump libglnx from `803adaf` to `88da8dd`
2022-02-22 16:32:08 +00:00
Luca BRUNO e6e9f14985 lib/commit: clean up assertions
This aligns all the assertion in the module. In particular, it gets
rid of all `g_return_val_if_fail` instances which may fail without
properly setting GError to the caller.
2022-02-01 17:33:28 +00:00
Luca Bruno 10ddf6e25f Merge pull request #2524 from jlebon/pr/unlink-lock
lib/deploy: When deleting staged deployment, delete any lock
2022-01-26 08:36:45 +00:00
Luca BRUNO b27792ade3 lib/repo: open file only if required
This tightens up the logic for opening a file while inspecting its
xattrs. The only codepath fetching xattrs from a FD is the one
handling 'bare' mode.
It also rearranges the else-assert flow, mostly for future-proofing.
2022-01-24 16:54:54 +00:00
Luca BRUNO 3f491a60c3 builtin: use GCancellable and GError everywhere
This reworks `ostree ls` top-level logic so that cancellation
tokens and error details are plumbed through all codepaths.
It also gets rid of all previous goto jumps.
2022-01-21 12:26:32 +00:00
Luca Bruno b9f6632b70 Merge pull request #2521 from cgwalters/syncfs-only-log
deploy: Also log to journal if we time out global sync()
2022-01-20 16:58:05 +00:00
Luca BRUNO da72c245f4 lib/commit: reject empty metadata keys
This adds one more check to the metadata validation logic in order
to reject empty metadata keys.
2022-01-20 10:54:30 +00:00
Luca BRUNO 6230b3eeab lib/commit: always validate metadata
This tweaks commit logic in order to always validate metadata,
including on commits where the expected checksum is already known.
2022-01-19 14:10:24 +00:00
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