Skip to content

Commit

Permalink
admin: Add some basic protection against running the CLI as root
Browse files Browse the repository at this point in the history
  • Loading branch information
ximion committed Sep 24, 2023
1 parent 73ea575 commit b9a9cd0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lkadmin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _register_commands():
def run(mainfile, args):
from rich.traceback import install

from laniakea.utils import set_process_title
from laniakea.utils.misc import set_process_title, ensure_laniakea_master_user

set_process_title('lk-admin')
if len(args) == 0:
Expand All @@ -95,6 +95,9 @@ def run(mainfile, args):
global __mainfile
__mainfile = mainfile

# some safeguarding against running as root or any other "wrong" user
ensure_laniakea_master_user(warn_only=True)

install(show_locals=True, suppress=[click])
_register_commands()
cli() # pylint: disable=no-value-for-parameter

0 comments on commit b9a9cd0

Please sign in to comment.