Repository navigation
pins_dir: a read-only pin layer owned by packages (#42) - #97
Merged
Merged
Conversation
verdict=refused was parsed, stored and then ignored. A plugin whose files failed qualification was added like any other. pins_check now refuses such a plugin with the new code PHD_ERR_PIN_REFUSED (-516), after the files have been checked against the pin: the verdict applies only to the pinned files, so files that differ still answer -509 first. Because the add and the replay share pins_check, an instance whose pin turns refused while it runs is refused at its next replay (instance_replay_refused with -516). The code is declared in protocol.h, and the README and protocol/plugin-hostd.json are regenerated from it. The test fails on main (the add answers resp 0). It covers pin_set, a pin_file under first-use (the plugin is not learned into the store), the replay, and changed files. A sabotage arm removes the check. Closes #71
…'s (#42) Every *.pins file of pins_dir (/usr/share/plugin-hostd/pins.d by default) is read at start in byte order of its name. A pin there with verdict=refused always holds: the store, the pin_file, pin_set and pin_accept never override it, and pin_set and pin_accept of its uri answer PIN_REFUSED (-516). Any other package pin is under the host's pins. Of two package pins of one uri a refusal wins, otherwise the later file by name. A bad line or an unreadable file is skipped and named on stderr; a missing or empty directory holds no pins.
This was referenced Oct 18, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #42. Built on #85 (fix/71-verdict-refused): it needs PIN_REFUSED (-516). Until #85 is merged its commit shows in this diff too. Merge #85 first.
What: pins that ship with packages get a read-only layer under the host's pins. At start the daemon reads every *.pins file of the new key pins_dir (default /usr/share/plugin-hostd/pins.d; empty is none) in byte order of the names, in the pin_set line format. The pin store, pin_file and pin_set stay as they are and make up the host's layer.
Rules, with the decisions of 2026-10-18:
Docs come first in their own commit (README pin section, manual). The key list, verb table, error table and protocol JSON are regenerated from protocol.h. Packaging: make install creates the directory, the RPM owns it with %dir, the DEB through plugin-hostd.dirs.
How tested (daemon tests over the fake worker, each asserts the reply an add gets):
Sabotage: tests/sabotage.py gets one arm per rule: host overrides the refusal, pin_set overrides it, pin_accept overrides it, the later pin wins over a refusal, reverse name order, no .pins suffix filter, hidden file read, package over host, a bad line is fatal, pins_dir not read. I ran those arms and #85's arm locally: all 11 red when broken, green when restored.
Local checks (Fedora host): test-daemon, test-format, test-pin, check-generated, test-perturbation, check-readme, check-no-pins, test-mod-host-json all pass. Two exceptions:
Owed outside this PR: the release that carries it (a minor bump, the train's), and the producer side in omx-plugins.