diff options
author | Michal Kuratczyk <mkuratczyk@pivotal.io> | 2021-01-23 18:52:10 +0100 |
---|---|---|
committer | Michael Klishin <michael@clojurewerkz.org> | 2021-02-01 14:19:21 +0300 |
commit | e1dc4daf604d5a95c2181ec90f35616e324f4292 (patch) | |
tree | 8eb6aadc7fa0215a8dcf2ea3e4f76a14442437c5 | |
parent | e93d35c83260b69c2e489eb98508d01b9eb62c78 (diff) | |
download | rabbitmq-server-git-issue-2685.tar.gz |
Check whether the file is readableissue-2685
Since the validation fails with "or isn't readable", we should actually
check whether we can read the file. This way, when configuring TLS for
example, you get early feedback if the cert files are not readable.
-rw-r--r-- | deps/rabbit/priv/schema/rabbit.schema | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/deps/rabbit/priv/schema/rabbit.schema b/deps/rabbit/priv/schema/rabbit.schema index 26a61267eb..7dea4b99d9 100644 --- a/deps/rabbit/priv/schema/rabbit.schema +++ b/deps/rabbit/priv/schema/rabbit.schema @@ -1773,8 +1773,10 @@ end}. {validator, "file_accessible", "file doesn't exist or isn't readable", fun(File) -> - ReadFile = file:read_file_info(File), - element(1, ReadFile) == ok + case file:read_file_info(File) of + {ok, FileInfo} -> (element(4, FileInfo) == read) or (element(4, FileInfo) == read_write); + _ -> false + end end}. {validator, "is_ip", "string is a valid IP address", |