mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
provision: Don’t rely on uid == gid assumption when invoking chown.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
fa913b7f5d
commit
349f22524e
@@ -247,8 +247,6 @@ REPO_STOPWORDS_PATH = os.path.join(
|
||||
"zulip_english.stop",
|
||||
)
|
||||
|
||||
user_id = os.getuid()
|
||||
|
||||
def install_system_deps():
|
||||
# type: () -> None
|
||||
|
||||
@@ -393,7 +391,7 @@ def main(options):
|
||||
|
||||
if not os.access(NODE_MODULES_CACHE_PATH, os.W_OK):
|
||||
run_as_root(["mkdir", "-p", NODE_MODULES_CACHE_PATH])
|
||||
run_as_root(["chown", "%s:%s" % (user_id, user_id), NODE_MODULES_CACHE_PATH])
|
||||
run_as_root(["chown", "%s:%s" % (os.getuid(), os.getgid()), NODE_MODULES_CACHE_PATH])
|
||||
|
||||
# This is a wrapper around `yarn`, which we run last since
|
||||
# it can often fail due to network issues beyond our control.
|
||||
|
||||
@@ -34,8 +34,6 @@ if is_travis:
|
||||
|
||||
UUID_VAR_PATH = get_dev_uuid_var_path()
|
||||
|
||||
user_id = os.getuid()
|
||||
|
||||
def setup_shell_profile(shell_profile):
|
||||
# type: (str) -> None
|
||||
shell_profile_path = os.path.expanduser(shell_profile)
|
||||
@@ -82,7 +80,7 @@ def main(options: argparse.Namespace) -> int:
|
||||
# packages.
|
||||
if not os.access(EMOJI_CACHE_PATH, os.W_OK):
|
||||
run_as_root(["mkdir", "-p", EMOJI_CACHE_PATH])
|
||||
run_as_root(["chown", "%s:%s" % (user_id, user_id), EMOJI_CACHE_PATH])
|
||||
run_as_root(["chown", "%s:%s" % (os.getuid(), os.getgid()), EMOJI_CACHE_PATH])
|
||||
run(["tools/setup/emoji/build_emoji"])
|
||||
|
||||
# copy over static files from the zulip_bots package
|
||||
|
||||
Reference in New Issue
Block a user