Check whether the file is readable
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.
This commit is contained in:
parent
589352c31a
commit
ecd2d738c0
|
@ -1773,8 +1773,10 @@ end}.
|
||||||
|
|
||||||
{validator, "file_accessible", "file doesn't exist or isn't readable",
|
{validator, "file_accessible", "file doesn't exist or isn't readable",
|
||||||
fun(File) ->
|
fun(File) ->
|
||||||
ReadFile = file:read_file_info(File),
|
case file:read_file_info(File) of
|
||||||
element(1, ReadFile) == ok
|
{ok, FileInfo} -> (element(4, FileInfo) == read) or (element(4, FileInfo) == read_write);
|
||||||
|
_ -> false
|
||||||
|
end
|
||||||
end}.
|
end}.
|
||||||
|
|
||||||
{validator, "is_ip", "string is a valid IP address",
|
{validator, "is_ip", "string is a valid IP address",
|
||||||
|
|
Loading…
Reference in New Issue