o/hookstate/ctlcmd: add a new exit code for is-connected for cases when the peer is from the same snap #10024
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.
This PR grew out of discussions about the CUPS snap on the forum:
https://forum.snapcraft.io/t/request-cups-snap-cups-auto-connection-to-of-cups-cups-control-to-cups-admin-and-also-of-the-network-manager-observe-interface/22802/25?u=jamesh
At present, Till's CUPS snap has both a plug and slot for the
cups-control
interface, with a request that they be auto-connected. At present the plug is not actually necessary to connect to the CUPS socket (that permission comes with the slot), but is needed to verify that utilities like lpadmin to pass thesnapctl is-connected
check.As discussed in the forum thread, we could avoid the need for the extra plug if
snapctl is-connected
grew a new exit code representing "peer is not connected, but belongs to the same snap". So that is what this PR implements.