cockpit_conf_strv() passes a plain `char` to isspace() while trimming
values read from cockpit.conf. Where char is signed, any byte >= 0x80
is passed as a negative value, which is undefined behaviour.
Cast to unsigned char, the way cockpitbase64.c already does.
cockpit_authorize_type() passes a plain `char` to tolower(). C requires
the argument of the <ctype.h> functions to be representable as unsigned
char or equal to EOF; where char is signed, any byte >= 0x80 is passed
as a negative value, which is undefined behaviour (on implementations
that index a table directly it is an out-of-bounds read).
This one is reachable with attacker-supplied bytes: the function parses
the "authorize" challenge, which comes straight from the HTTP
Authorization header. For "Négotiate ..." the parser calls tolower(-61)
and tolower(-87).
Cast to unsigned char, the way cockpitbase64.c already does.
cockpit_json_print_open_memfd() documents its @name parameter as being
"passed to memfd_create, gets displayed in /proc/.../fd", but the
parameter is unused: both memfd_create() calls hardcode "cockpit login
messages".
So the memfd that cockpit-tls creates for its connection metadata —
src/tls/connection.c passes "cockpit-tls metadata" — shows up in /proc
as "cockpit login messages", which is actively misleading when
inspecting a running system.
dnf5 5.4.3 provides a new org.rpm.dnf.v0.History.list method with which
we can retrieve a list of transactions. The software updates page only
shows updates not newly installed packages or other transactions which
are available.
The regular expression used to strip the compression suffix while
scanning a package directory is `r'.gz$'`. The dot is unescaped, so it
matches *any* character followed by "gz" at the end of the name.
Files whose name ends in "gz" without being gzip-compressed are
therefore registered under a truncated name:
data.tgz -> "data."
logo.svgz -> "logo.s"
Requesting such a file under its real name gives a KeyError, ie. a
404.
Escape the dot and add a regression test.
By adding a low-level "Browser.paste" method and a new "paste" option
for "Browser.set_input_text".
Some parts of Cockpit react to pasting differently than to typing text
character by character. For example, cockpit-podman will create
multiple environment variable settings when pasting a text that
contains multiple lines into a text input.
We are currently combining "Browser.set_val" and
"Browser.set_input_text" in a hackish way for obscure reasons to
simulate such a paste operation. Doing it via the clipboard and
Control-V is hopefully more robust. In any case, we should offer a
central function to encapsulate all the hacks we need.
The journald service should auto-start, but something goes wrong on
recent ubuntu-2604 images where TestHistoryMetrics.testEvents
ultimately fails when running "journalctl --sync" during teardown. The
error is:
Failed to connect to Varlink socket: Connection refused
So maybe there something broken about varlink auto-activation.
Starting it explicitly works around this problem.
The JSONDecodeError handler in PackagesLoader.patch_manifest() logs a
warning but then falls through into the code that applies the override,
because it is missing a `continue`.
That has two consequences:
* If the *first* override file we try is invalid JSON, `override` was
never assigned, and the following `isinstance(override, dict)` check
raises UnboundLocalError. This propagates out of load_manifests()
and aborts loading of all packages — a single typo in a hand-written
override.json takes the whole bridge down instead of just being
reported as a warning.
* If a *later* override file is invalid, `override` still holds the
value parsed from a previous iteration, so that earlier override gets
merged into the manifest a second time.
Add the missing `continue` and cover both cases with regression tests.
Signed-off-by: hanjinpeng <hanjinpeng@kylinos.cn>
New DNF5 policy does not allow switching vendors if in our example a
COPR repository offers a newer version of cockpit. We want to
override this behaviour and in reverse dependency testing install the
latest version of cockpit (provided by @cockpit/main-builds).
https://fedoraproject.org/wiki/Changes/DisableVendorChangeByDefault
Newer versions of lvm2 will support VDO out of the box without the need
to install any additional packages. That's how Arch spontaneously
gained support, and others are expected to follow.
The TestRHEL8 test interacts with both the old PF5 shell on RHEL 8 and
the current shell from main. It uses a custom "logout_pf5" method
when interacting with the PF5 shell, but also accidentally uses it
with the new PF6 shell from "main". It should use Browser.logout in
two case.
As it turns out, the "logout_pf5" method does work with the PF6 shell,
but it doesn't have any of the extra robustifications that we have put
into Browser.logout. These robustifications seem to matter when
running tests on AWS.
Dismisses all SELinux alerts before executing the SELinux fail script so
that pixel tests have a higher chance of being consistent and not change
between image refreshes or unexpected behaviours.
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
Before a recent bootc image update luksmeta/clevis* was not included on
the image so removing the files was a noop. Now it is included so the
test will fail as /usr/ is mounted readonly.
Previously we used `ph_jump` which reloads the iframe entirely and
causes a race between tearing down and re-rendering. Navigating via the
hash uses `cockpit.location.go`, only updating the location hash.
This additional fix makes testServicesFiltersURLConsistency pass on our
new AWS CI.
`wait_page_load` can race with the `ServicesPageBody` component remount
when switching owner (key={owner} causes full unmount/remount). So
before we wait for the page load, wait till the services text filter is
not visible and additionally wait for the text filter to appear giving
us hopefully enough time to render the label group.