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 52c4802
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lkadmin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def cli(ctx, verbose, version, config_fname):
Laniakea directly from the command-line.'''
from laniakea import LocalConfig
from laniakea.logging import set_verbose, configure_pkg_archive_logger
from laniakea.utils.misc import ensure_laniakea_master_user

set_verbose(verbose)
if version:
Expand All @@ -34,6 +35,9 @@ def cli(ctx, verbose, version, config_fname):
if config_fname:
LocalConfig(config_fname)

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

# configure the archive action file logging
configure_pkg_archive_logger()

Expand Down

0 comments on commit 52c4802

Please sign in to comment.