mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
parent
17ba813a6d
commit
ff83efe376
@ -1064,7 +1064,7 @@ class Config(object):
|
|||||||
"""Check if the path is valid for access from outside."""
|
"""Check if the path is valid for access from outside."""
|
||||||
assert path is not None
|
assert path is not None
|
||||||
|
|
||||||
parent = pathlib.Path(path).parent
|
parent = pathlib.Path(path)
|
||||||
try:
|
try:
|
||||||
parent = parent.resolve() # pylint: disable=no-member
|
parent = parent.resolve() # pylint: disable=no-member
|
||||||
except (FileNotFoundError, RuntimeError, PermissionError):
|
except (FileNotFoundError, RuntimeError, PermissionError):
|
||||||
|
@ -809,6 +809,7 @@ class TestConfig(unittest.TestCase):
|
|||||||
|
|
||||||
valid = [
|
valid = [
|
||||||
test_file,
|
test_file,
|
||||||
|
tmp_dir
|
||||||
]
|
]
|
||||||
for path in valid:
|
for path in valid:
|
||||||
assert self.config.is_allowed_path(path)
|
assert self.config.is_allowed_path(path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user