From 213494c6692008f2a390dbbf0fc473d5636e7f38 Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Thu, 21 May 2020 17:04:00 -0700 Subject: [PATCH] Add plugin connection hook to accept root trust --- snap/hooks/prepare-plug-plugin | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 snap/hooks/prepare-plug-plugin diff --git a/snap/hooks/prepare-plug-plugin b/snap/hooks/prepare-plug-plugin new file mode 100644 index 000000000..ee309addf --- /dev/null +++ b/snap/hooks/prepare-plug-plugin @@ -0,0 +1,11 @@ +#!/bin/bash -e + +if [ "$(snapctl get trust-plugin-with-root)" = "ok" ]; then + # allow the connection, but reset config to allow for other slots to go through this auth flow + snapctl unset trust-plugin-with-root + exit 0 +else + echo "Only connect this interface if you trust the plugin author to have root on the system" + echo "Run \`snap set $SNAP_NAME trust-plugin-with-root=ok\` to acknowledge this and then run this command again to perform the connection" + exit 1 +fi