- Aug 06, 2024
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
logger: Fix always re-opening files when --log-fd is used See merge request !743
-
Simon McVittie authored
Previously, if we were using --remap-link-prefix but not --link-target (as in pressure-vessel), and if the path at which we found the library in the provider (`needed_path_in_provider`) was such that after resolving symlinks, the canonicalized result (`path`) did not match any of the --remap-link-prefix options, then we would reset to using the `needed_path_in_provider` as the symlink target. However, this was wrong, because it did not take into account the possibility that the original path might have matched one of the --remap-link-prefix options even though its canonicalized version didn't. For example, consider the NixOS "FHS environment", a bwrap-based container that has been populated with symlinks of the form /lib/libGL.so.1 -> /nix/store/something. Depending on the precise behaviour of libc and libdl (the exact trigger for the differing behaviour is unknown), when we open that library, we might find that the `needed_path_in_provider` is either /lib/libGL.so.1 or a path below /nix/store. If the `needed_path_in_provider` is /lib/libGL.so.1, we would canonicalize it to /nix/store/something, then decide that /nix/store/something didn't match any of the remapping rules such as `/lib*` → `/run/host/lib*`, and go back to using /lib/libGL.so.1 as the symlink target. But, inside pressure-vessel's container, `/lib` is from the container runtime and not the provider - which is precisely why we need to rewrite /lib paths to /run/host/lib in order to be able to find the library we want. Instead, we must limit the situation where we keep the `needed_path_in_provider` as-is to the situation where there is no symlink target rewriting: no --link-target, and no --remap-link-prefix. In this situation, we are expecting the meaning of a symlink in the container environment to be identical to the meaning of a symlink in the environment from which we are running capsule-capture-libs, therefore it's slightly preferable to use a non-canonicalized symlink if we have one: that way, if the target of a symlink changes during the container's lifetime (perhaps as a result of an OS upgrade), it will still work. Conversely, if we are using either --link-target or --remap-link-prefix, we want to stick to using only the canonicalized paths of libraries, because that's the only way we can avoid a symlink being interpreted differently outside and inside the container, for example as a result of its parent directory being mounted in a different place, or as a result of something different being mounted at its target. This means that we have to relax one of our test assertions slightly. Helps: https://github.com/ValveSoftware/steam-runtime/issues/684 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This would have made it considerably easier to spot that commit 8f65507d "logger: Recreate output log files if they get deleted" was reopening the log file more often than it should have been. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Otherwise, after reopening a deleted or replaced file, we would reopen it once per line, because its inode number constantly differs from the original inode number. After commit 1f502cb4 "logger: Fix always re-opening files when --log-fd is used", this was the only remaining place where we assign to self->file_fd without also assigning to self->file_stat. Fixes: 8f65507d "logger: Recreate output log files if they get deleted" Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
In a test that already emits a warning message, prepending "quiet:" to the pattern should de-escalate the warning to a debug message. In a test that emits a fatal error, prepending "quiet:" to the pattern has no effect: it's still an error. steamrt/tasks#488 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Sometimes we find ourselves capturing a library for which the dependencies can legitimately be missing, for example `libnvidia-pkcs11.so.*` on Ubuntu 24.04 (which depends on OpenSSL 1.1, which Ubuntu no longer provides). This is really an OS bug (providing a library without its dependencies), and ideally Ubuntu should stop providing `libnvidia-pkcs11.so.*` (like Debian did), but it results in confusing messages that could make a user wrongly believe that it's the root cause of a genuine problem. steamrt/tasks#488 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 05, 2024
-
-
Ryan Gonzalez authored
I wasn't aware that simple assignment worked here. steamrt/tasks#487 Signed-off-by:
Ryan Gonzalez <ryan.gonzalez@collabora.com>
-
Ryan Gonzalez authored
`self->file_stat` was only initialized if an fd was *not* given, which would lead it to always re-create the log file once. steamrt/tasks#487 Signed-off-by:
Ryan Gonzalez <ryan.gonzalez@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
logger: Recreate output log files if they get deleted See merge request !740
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Previously we said "warning:" for about half the warnings, and didn't annotate fatal errors at all. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Repeat the test-case where we produced an error message about a library having the wrong ABI, but this time, use --level-prefix and assert that we add the <3> prefix for a fatal error. steamrt/tasks#444 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This will allow the output of capsule-capture-libs (and in principle other tools) to be piped to a log handler such as `logger --prio-prefix`, `systemd-cat --level-prefix=true` or `srt-logger --parse-level-prefix` which will filter or format the messages according to their severity. As currently implemented, fatal errors are emitted as LOG_ERR, warnings are LOG_WARNING, and all debug messages are LOG_DEBUG. A facility such as LOG_USER is not included: this is optional for logger(1), and not allowed for systemd-cat(1) and srt-logger. steamrt/tasks#444 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
In a couple of places this requires explicitly emitting the stringified value of errno, because we have equivalents of warnx() and errx(), but not warn() and err(). Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
These mimic the behaviour of errx() and warnx(), but will benefit from future enhancements to capsule_log(). Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This allows them to be distinguished from messages logged by some other executable invoked around the same time, and makes `capsule_log( LOG_WARNING, ... )` a drop-in substitute for `warnx()`. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This will let us change the behaviour of all diagnostic messages at once, by changing only capsule_logv(). For now, the syslog-style severity is accepted but ignored. Subsequent commits will make use of this. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
We don't enforce a specific error message, but we do assert that there's no output on stdout, and an error message prefixed with the program name on one of the lines of stderr. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
pv-runtime: Don't import host CA certificates when running under Snap See merge request !741
-
- Aug 02, 2024
-
-
Ryan Gonzalez authored
Before writing a log line to the file, first check to make sure that it's still around. If not, then just re-create it, so that clearing the current logs out doesn't actually stop future logs from appearing. This takes advantage of the existing fstat() setup that checks the file size and swaps it out with stat() to be able to pick up on the file going missing. (That change shouldn't introduce any notable race conditions on the directory side, because srt-logger has already chdir'd into the log file directly, and self->filename isn't a full path in the first place.) steamrt/tasks#487 Signed-off-by:
Ryan Gonzalez <ryan.gonzalez@collabora.com>
-
Ryan Gonzalez authored
This is useful for the next commit that will need to do this locking elsewhere. steamrt/tasks/#487 Signed-off-by:
Ryan Gonzalez <ryan.gonzalez@collabora.com>
-
Simon McVittie authored
steamrt/tasks#416 Mitigates: https://github.com/canonical/steam-snap/issues/397 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 01, 2024
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
pv-runtime: Add more robust mechanism to take CA certificates from the host See merge request !737
-
Simon McVittie authored
Update Flatpak-derived files from 1.15.9 See merge request !736
-
Simon McVittie authored
glib-backports: Avoid g_log_writer_is_journald() on GLib 2.58.x See merge request !738
-
- Jul 31, 2024
-
-
Simon McVittie authored
This function is present in GLib 2.58.x, but had a bug: it cached its result, even if called on different file descriptors. Normally this doesn't matter, because normally this function is only called on either stdout or stderr anyway, and if one of them is the Journal, usually the other one is too. Unfortunately, log.c calls `g_log_writer_is_journald (STDOUT_FILENO)` before `g_log_writer_is_journald (STDERR_FILENO)`; and on Steam Deck, when using `logger-0.bash`, srt-logger gets invoked with stdout pointing to a pipe and stderr to the Journal. So we would cache the result "not the Journal" from stdout, and then use it for stderr. Use a backport of the fixed version (or, in fact, the internal function that it calls) instead of the GLib 2.58 version. steamrt/tasks#461 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This is a redo of commit d6a519f5 "pv-runtime: Add a mechanism to take custom CA certificates from the host" which aims to be more robust against host operating systems that might not have the Debian-compatible layout that we expect. This reverts commit 9e3d9c85. steamrt/tasks#416 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Move g_ascii_strtoull() workaround to a global constructor See merge request !735
-
- Jul 26, 2024
-
-
Simon McVittie authored
This removes most of the `#if 0` from `flatpak-utils.c`: everything with non-trivial dependencies was moved to other translation units upstream. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This means we can rely on the workaround being effective for anything that is dynamically linked to libsteam-runtime-tools, or statically linked to steam-runtime-tools/utils.c (in practice this means all of our non-trivial programs). Followup from steamrt/tasks#481 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-