-
Notifications
You must be signed in to change notification settings - Fork 3.5k
allow other users to write to mix_pubsub and mix_lock folders #14171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,7 +97,9 @@ defmodule Mix.Sync.Lock do | |
| opts = Keyword.validate!(opts, [:on_taken]) | ||
|
|
||
| hash = key |> :erlang.md5() |> Base.url_encode64(padding: false) | ||
| path = Path.join([System.tmp_dir!(), "mix_lock", hash]) | ||
| base_path = Path.join([System.tmp_dir!(), "mix_lock"]) | ||
| init_base_path(base_path) | ||
| path = Path.join([base_path, hash]) | ||
|
|
||
| pdict_key = {__MODULE__, path} | ||
| has_lock? = Process.get(pdict_key, false) | ||
|
|
@@ -119,6 +121,12 @@ defmodule Mix.Sync.Lock do | |
| end | ||
| end | ||
|
|
||
| defp init_base_path(path) do | ||
| File.mkdir_p!(path) | ||
| # ensure other users can write to the directory | ||
| _ = File.chmod(path, 0o777) | ||
|
||
| end | ||
|
|
||
| defp lock_disabled?(), do: System.get_env("MIX_OS_CONCURRENCY_LOCK") in ~w(0 false) | ||
|
|
||
| defp lock(path, on_taken) do | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.