blackbox_addadmin leaves the system in unconsistent state if the GPG key does not exists
kwilczek opened this issue · comments
Hi,
when you run blackbox_addadmin
, the code firstly add the admin-to-be to the blackbox-admins.txt
, then access GPG database and fails if the key does not exists. Steps to reproduce:
mkdir /dev/shm/empty_repo && cd $_
git init
blackbox_initialize
blackbox_addadmin dummy_admin@dummy_domain.com
The code will fail with GPG warning: nothing were exported
and GPG key 'dummy_admin@dummy_domain.com' not found ...
. But the repo is changed:
cat .blackbox/blackbox-admins.txt
dummy_admin@dummy_domain.com
I think that adding a check for the key existence or simply moving the code:
blackbox/bin/blackbox_addadmin
Lines 19 to 22 in 9d30523
below the GPG import part would be enough.
--
K.