• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openSUSE / agama / 9211232291 / 3 – rust
72%
master: 72%

Build:
DEFAULT BRANCH: master
Ran 23 May 2024 04:09PM UTC
Files 88
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 May 2024 04:01PM UTC coverage: 23.042% (+0.1%) from 22.9%
rust – 9211232291.3

push

github

web-flow
Use a timeout when calling `setxkbmap` (#1249)

## Problem

- When calling `setxkbmap` in development the `root` user might not have
access to the `:0` X display.
- Maybe there is XDM running or another user is logged in. In that case
`setxkbmap` prints
  ```
  Authorization required, but no authorization protocol specified
  ```
  error message in an infinite loop and gets stuck.
- Additionally the $DISPLAY might be already set so we should honor that
value (e.g. when you manually start the web server from terminal)

## Solution

- Use the [subprocess](https://crates.io/crates/subprocess) crate to
limit the execution time
- Use the current `DISPLAY` value when already set

### SSH X Forwarding Problem

We need to set the display for the `setxkbmap` call when running on the
Live ISO because when running Agama from systemd service the `DISPLAY`
is not set but we need to access the locally running web browser so we
have to explicitly set the `:0` value.

When the web server is started manually from a terminal we should keep
the current value if it is already set. But using the current `DISPLAY`
value might behave a bit unexpectedly when you login to the system via
SSH with X forwarding enabled. In that case the `setxkbmap` call will
query and set (!) keyboard of the remote X server. That might be quite
confusing.

Sure, that is a corner case, but if you select some exotic layout with
complete different mapping like Dvorak then it might not be trivial to
restore your original layout. When using X forwarding the `DISPLAY` is
set to something like `localhost:10.0`, so we should use it only
when it starts with `:` character which means the local X server.

## Testing

- Tested manually

---------

Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>

1230 of 5338 relevant lines covered (23.04%)

0.59 hits per line

Source Files on job rust - 9211232291.3
  • Tree
  • List 0
  • Changed 21
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 9211232291
  • 6443351b on github
  • Prev Job for on master (#9191654391.3)
  • Next Job for on master (#9222222694.)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc