Skip to content

'DeviceAllow' option missing from KNOWN_UNIT_SIGNATURES #119

@barometz

Description

@barometz

While testing a service with restricted access to /dev I ran into the following error:

  File "/opt/share/uv/<...>/lib/python3.12/site-packages/<...>/runner.py", line 135, in run
    unit: Unit = pystemd.run(
                 ^^^^^^^^^^^^
  File "/opt/share/uv/<...>/lib/python3.12/site-packages/pystemd/run.py", line 306, in run
    unit_start_job = manager.Manager.StartTransientUnit(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/share/uv/<...>/lib/python3.12/site-packages/pystemd/base.py", line 219, in _call
    return func(self, name, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/share/uv/<...>/lib/python3.12/site-packages/pystemd/base.py", line 178, in _call_method
    return overwrite_method(self.interface_name, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/share/uv/<...>/lib/python3.12/site-packages/pystemd/systemd1/manager.py", line 44, in StartTransientUnit
    args += signature_array(properties)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/share/uv/<...>/lib/python3.12/site-packages/pystemd/systemd1/unit_signatures.py", line 384, in signature_array
    signature = KNOWN_UNIT_SIGNATURES[prop_name]
                ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: b'DeviceAllow'

Sure enough, DeviceAllow is not defined in unit_signatures.py, while the related DevicePolicy is. DeviceAllow is present in the dbus interface at https://github.com/systemd/systemd/blob/v237/src/core/dbus-cgroup.c#L325. Was this just missed while copying options, or is it left out on purpose?

(as an aside, thanks for pystemd, I'm thrilled that I didn't have to figure out how dbus actually works to talk to systemd).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions