imsd/packaging/imsd-ofonod.service
Jorijn van der Graaf f18baf2790
imsd, imsd-ofonod: let polkit decide call control, not the account name
The system-bus policies granted net.catcrafts.IMS1 and org.ofono to root
and to the account `user`, postmarketOS's default name, so on a unit
whose account is called something else dbus denied every Dial from the
dialer — nothing in imsd's journal, nothing on screen. A field user
found it by trial (alyx report 14, 2026-09-20; ims ledger F14).

Let any local account reach both names and have the daemons decide:
placing, answering or ending a call needs polkit's
net.catcrafts.IMS1.Voice (the active local session; not an ssh login, an
inactive session or a system service account). imsd-ofonod asks about
its own callers, since its calls reach imsd as root. Reads such as the
status and the call list are not gated, and a refusal is logged with the
sender; a `--session` run, the development mode without root or polkit,
leaves the gate off. The check is ImsdBus, a small GLib module both
daemons link; the package depends on polkit.

An upgrade restarts both daemons (the previous commit), so the open
policy faces the old, ungated daemons only until the apk transaction
ends.

Tested on the dev phone (KPN) in builds of this series; not every path
has run there.
2026-10-06 14:01:33 +02:00

31 lines
1.3 KiB
Desktop File

# SPDX-License-Identifier: GPL-3.0-only
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
[Unit]
Description=oFono-compatible GNOME Calls backend for imsd
Documentation=https://forgejo.catcrafts.net/Catcrafts/imsd
# org.ofono is a system-bus name only root may own (org.ofono.conf), so this
# is a system service run as root: imsd admits the calls it forwards as
# root's (it has asked polkit about its own caller), and its start hook
# restarts GNOME Calls in the users' own managers. Only enable it on a
# GNOME/Phosh session
# — Plasma Mobile uses imsd-dialerd instead. Both may run at once (different
# buses, different consumers), but a real ofonod must not.
Conflicts=ofono.service
After=imsd.service
Wants=imsd.service
[Service]
Type=simple
# EMERGENCY_NUMBERS only, and only so the oFono EmergencyNumbers property
# matches imsd's configuration; imsd itself owns emergency classification.
EnvironmentFile=-/etc/imsd.env
ExecStart=/usr/bin/imsd-ofonod
# GNOME Calls keeps a stale modem when org.ofono restarts and dials nothing
# until it restarts too: restart the Calls daemon of each user running one
ExecStartPost=-/usr/libexec/imsd-ofono-restart-calls.sh
# it holds no call state of its own — imsd is re-queried on every reconnect
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target