From c71c6187ea47b8005e4c5f282b6adf546597b373 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 9 Jun 2022 11:37:19 -0700 Subject: [PATCH] restore-backup: Ensure it is run as root. --- scripts/setup/restore-backup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setup/restore-backup b/scripts/setup/restore-backup index 62fe58fd31..d70c1daefa 100755 --- a/scripts/setup/restore-backup +++ b/scripts/setup/restore-backup @@ -9,7 +9,7 @@ from typing import IO BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(BASE_DIR) -from scripts.lib.zulip_tools import get_postgres_pwent, run, su_to_zulip +from scripts.lib.zulip_tools import assert_running_as_root, get_postgres_pwent, run, su_to_zulip POSTGRES_PWENT = get_postgres_pwent() @@ -18,7 +18,7 @@ parser.add_argument("tarball", help="Filename of input tarball") def restore_backup(tarball_file: IO[bytes]) -> None: - + assert_running_as_root() su_to_zulip(save_suid=True) from scripts.lib.setup_path import setup_path