Commit graph

24378 commits

Author SHA1 Message Date
GitHub Workflow
8101f739e3 po: Update from Fedora Weblate
Closes: #23670
2026-09-02 09:12:51 +02:00
hanjinpeng
df8415a229 common: Cast to unsigned char before calling isspace()
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.
2026-09-01 15:59:11 +02:00
hanjinpeng
406b820ee0 common: Cast to unsigned char before calling tolower()
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.
2026-09-01 15:59:11 +02:00
hanjinpeng
846acd4c71 common: Pass the caller's name through to memfd_create()
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.
2026-09-01 15:59:11 +02:00
tomasmatus
4f630ec70d spec: networkmanger description line is too long
Fix cockpit-networkmanager.noarch: E: description-line-too-long

Related: #23657
2026-09-01 09:50:30 +02:00
tomasmatus
0d205f6d96 LICENSE: update FSF address and signature
Resolves rpmlint warning incorrect-fsf-address.

Related: #23657
2026-09-01 09:50:30 +02:00
Cockpit Project
8cd1ec26c9 cockpit-ci: Update container to 2026-08-29
Closes: #23664
2026-09-01 09:16:38 +02:00
Jelle van der Waa
eceba97aae packit: Enable Fedora 45 2026-08-27 10:53:35 +03:00
Jelle van der Waa
f8660ccc60 lib: Implement is_available for the dnf5daemon backend
`is_available` is used to check if `coreutils` is available on RHEL
systems to verify if a subscription is required to be configured or not.
2026-08-27 09:15:39 +02:00
Jelle van der Waa
377717d000 lib: Implement get_history for the dnf5daemon backend
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.
2026-08-27 09:15:39 +02:00
Jelle van der Waa
5d0515e3f0 lib: Document the History packages record 2026-08-27 09:15:39 +02:00
hanjinpeng
1c9f755985 packages: Only strip a literal ".gz" suffix from file names
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.
2026-08-27 09:14:23 +02:00
Marius Vollmer
9a4d80e839 testlib: Support pasting text
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.
2026-08-26 17:00:45 +02:00
Marius Vollmer
1b7e79af69 test: Start journald explicitly again after stopping it
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.
2026-08-26 15:42:12 +02:00
GitHub Workflow
b772459e3d po: Update from Fedora Weblate
Closes: #23650
2026-08-26 09:18:21 +02:00
Cockpit Project
3238566a51 cockpit-ci: Update container to 2026-08-22
Closes: #23641
2026-08-26 08:51:19 +02:00
hanjinpeng
769f179406 packages: Ignore override files with invalid JSON
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>
2026-08-25 18:13:41 +02:00
Marius Vollmer
8fe41f71a9 test: The rhel-10 image doesn't need vdoformat anymore 2026-08-25 17:04:52 +03:00
Jelle van der Waa
516376a942 test: Allow installing updates from a vendor
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
2026-08-24 15:26:08 +02:00
Marius Vollmer
845ad37db4
test: Expect that the "arch" image supports VDO
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.
2026-08-24 15:33:23 +03:00
dependabot[bot]
c0bacfe979 bump uuid from 14.0.1 to 14.0.2
Bumps [uuid](https://github.com/uuidjs/uuid) from 14.0.1 to 14.0.2.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v14.0.1...v14.0.2)

---
updated-dependencies:
- dependency-name: uuid
  dependency-version: 14.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-23 16:53:13 +02:00
Marius Vollmer
233b1c178d ws: Free "language" string also when it comes from the cookie
See https://access.redhat.com/security/cve/cve-2026-76235
2026-08-20 16:43:26 +02:00
Jelle van der Waa
c995990a66 test: Drop Ubuntu 24.04 workarounds
Cockpit no longer tests on Ubuntu 24.04
2026-08-20 12:51:53 +02:00
tomasmatus
dc336f0835 test: adjust PQC test as chromium now accept MLKEM certificates 2026-08-19 15:03:33 +02:00
tomasmatus
89a3b217b0 misc: improve comment why we need side-effect import readline 2026-08-19 15:03:33 +02:00
tomasmatus
bd2c0ef9c4 static-code: apply ruff fixes
fix ruff ignore exceptions
2026-08-19 15:03:33 +02:00
Cockpit Project
c1bcf86373 cockpit-ci: Update container to 2026-08-18
Closes: #23626
2026-08-19 15:03:33 +02:00
GitHub Workflow
bc478613de po: Update from Fedora Weblate
Closes: #23628
2026-08-19 13:10:00 +02:00
dependabot[bot]
fa5a07b2e0 build(deps): bump github/codeql-action from 4.37.3 to 4.37.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.3 to 4.37.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.37.3...v4.37.6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-18 14:53:49 +02:00
Jelle van der Waa
799524c193 .github: add codespell workflow
Run codespell on our codebase to catch common made typos such as
'assesment'.
2026-08-18 11:58:12 +02:00
Jelle van der Waa
5b95358345 pyproject: introduce Codespell configuration
There are still many false positives in pkg/src/test to enable codespell
but at least documentation can be linted with this configuration.
2026-08-18 11:58:12 +02:00
Jelle van der Waa
bbdf74044d treewide: Fix typos discovered by codespell 2026-08-18 11:58:12 +02:00
Jelle van der Waa
3834a50f25 pkg: Fix typos discovered by codespell 2026-08-18 11:58:12 +02:00
Jelle van der Waa
0972eec00c test: Fix typos discovered by codespell 2026-08-18 11:58:12 +02:00
Jelle van der Waa
6340ddab0f storaged: fix common typos 2026-08-18 11:58:12 +02:00
dependabot[bot]
5fabf48737 bump the esbuild group with 2 updates
Bumps the esbuild group with 2 updates: [esbuild](https://github.com/evanw/esbuild) and [esbuild-wasm](https://github.com/evanw/esbuild).

Updates `esbuild` from 0.28.1 to 0.28.2
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.28.1...v0.28.2)

Updates `esbuild-wasm` from 0.28.1 to 0.28.2
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.28.1...v0.28.2)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.28.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: esbuild
- dependency-name: esbuild-wasm
  dependency-version: 0.28.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: esbuild
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-17 11:12:43 +02:00
Marius Vollmer
8b37baad2e test: Use the regular Browser.logout when appropriate
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.
2026-08-14 17:05:35 +02:00
Freya Gustavsson
b754ea4a47 test: Dismiss SELinux alerts for pixel tests
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>
2026-08-14 14:56:56 +02:00
dependabot[bot]
061ddfa72a build(deps): bump sourcemeta/jsonschema from 16.5.0 to 16.7.0
Bumps [sourcemeta/jsonschema](https://github.com/sourcemeta/jsonschema) from 16.5.0 to 16.7.0.
- [Release notes](https://github.com/sourcemeta/jsonschema/releases)
- [Commits](https://github.com/sourcemeta/jsonschema/compare/v16.5.0...v16.7.0)

---
updated-dependencies:
- dependency-name: sourcemeta/jsonschema
  dependency-version: 16.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-14 09:22:22 +02:00
Jelle van der Waa
0d2011f902 test: Handle .bashrc not existing
On the latest centos-9-bootc image bashrc no longer exists;
2026-08-13 13:32:40 +02:00
Jelle van der Waa
40fdebe8e9 test: Stop testing TestStorageLuksDestructive on bootc
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.
2026-08-13 13:32:40 +02:00
tomasmatus
72944d8722 test: explicitly remove pcp-dstat
Unblocks: https://github.com/cockpit-project/bots/pull/9243
2026-08-12 18:14:28 +02:00
Jelle van der Waa
8fc7714a84 networkmanager: Fix typo 'intefaces' 2026-08-12 17:54:22 +02:00
Jelle van der Waa
511fda975a storaged: Convert StorageLogsPanel to a functional component
This has no state so can be trivially converted.
2026-08-12 14:03:53 +03:00
Jelle van der Waa
1a35abb1c2 selinux: Convert SELinuxStatus to a functional component
The component is trivial enough to be ported to a functional component.
2026-08-12 14:03:53 +03:00
Jelle van der Waa
7b29442595 selinux: Drop commented out code 2026-08-12 14:03:53 +03:00
Jelle van der Waa
09ce1e522e kdump: Port KdumpTestDialog to Dialogs API
Move away from the `show_modal_dialog` to the new Dialog API.

Related: COCKPIT-1886
2026-08-12 13:51:44 +03:00
Jelle van der Waa
234118ae22 test: Use direct in-iframe has navigation for testServicesFiltersURLConsistency
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.
2026-08-12 13:42:31 +03:00
Jelle van der Waa
93283afe28 test: Fix testServicesFiltersURLConsistency race on owner switch
`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.
2026-08-12 13:42:31 +03:00
Jelle van der Waa
f63d6231e1 test: Document why this test exists 2026-08-12 13:42:31 +03:00