From 523907fe1d8582750f2d53b3734ee3b116a0197e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 8 Jun 2020 12:37:16 -0700 Subject: [PATCH] upgrade-zulip: Add umask override. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already override the umask in upgrade-zulip-stage-2, but that’s too late since we’ve already written a bunch of files in stage 1. I would have removed the stage 2 override, but the OS upgrade documentation references running stage 2 directly. Fixes #15164. Note that an affected installation will need to upgrade twice, because the first upgrade uses the old stage 1. Signed-off-by: Anders Kaseorg --- scripts/lib/upgrade-zulip | 3 +++ scripts/lib/upgrade-zulip-from-git | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/lib/upgrade-zulip b/scripts/lib/upgrade-zulip index bc422d35ed..6463c2ddf4 100755 --- a/scripts/lib/upgrade-zulip +++ b/scripts/lib/upgrade-zulip @@ -20,6 +20,9 @@ deploy_options = get_deploy_options(config_file) assert_running_as_root(strip_lib_from_paths=True) +# make sure we have appropriate file permissions +os.umask(0o22) + logging.Formatter.converter = time.gmtime logging.basicConfig(format="%(asctime)s upgrade-zulip: %(message)s", level=logging.INFO) diff --git a/scripts/lib/upgrade-zulip-from-git b/scripts/lib/upgrade-zulip-from-git index 1caca155a8..2168fb44ec 100755 --- a/scripts/lib/upgrade-zulip-from-git +++ b/scripts/lib/upgrade-zulip-from-git @@ -20,6 +20,9 @@ remote_url = get_config(config_file, 'deployment', 'git_repo_url', "https://gith assert_running_as_root(strip_lib_from_paths=True) +# make sure we have appropriate file permissions +os.umask(0o22) + logging.Formatter.converter = time.gmtime logging.basicConfig(format="%(asctime)s upgrade-zulip-from-git: %(message)s", level=logging.INFO)