diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-07-25 08:58:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-07-26 03:46:53 +0000 |
commit | fc77b3af1fd0606343a1d9a3694a64853396e43f (patch) | |
tree | 1b7872f58bbf6a5890a5f90e77b332861a38fe38 /lib | |
parent | Adding reference to manpage in 'no such container command' error message. (diff) | |
download | compute-tools-fc77b3af1fd0606343a1d9a3694a64853396e43f.tar.xz compute-tools-fc77b3af1fd0606343a1d9a3694a64853396e43f.zip |
Adding check for writable gpg directory in container key command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | libexec/container/key | 9 |
1 files changed, 9 insertions, 0 deletions
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 |