From fc77b3af1fd0606343a1d9a3694a64853396e43f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 25 Jul 2021 10:58:54 +0200 Subject: Adding check for writable gpg directory in container key command. Signed-off-by: Daniel Baumann --- libexec/container/key | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libexec/container/key b/libexec/container/key index 5f76fb2..679e636 100755 --- a/libexec/container/key +++ b/libexec/container/key @@ -87,6 +87,15 @@ then Usage fi +if [ ! -w "${KEYS}" ] +then + if [ "$(id -u)" -ne 0 ] + then + echo "'${COMMAND}': need root privileges (or write permissions to '${KEYS}')" >&2 + exit 1 + fi +fi + # Pre hooks for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${NAME}.pre-${COMMAND}" do -- cgit v1.2.3