Skip to content

Check whitelisted paths #13107#13154

Merged
balloob merged 1 commit intohome-assistant:devfrom
kellerza:is_allowed_path
Mar 30, 2018
Merged

Check whitelisted paths #13107#13154
balloob merged 1 commit intohome-assistant:devfrom
kellerza:is_allowed_path

Conversation

@kellerza
Copy link
Copy Markdown
Member

Description:

A follow up on #12810, which forced the path to EXIST as well.

Path.resolve(strict=False) does not require the path to exist, it will resolve as far as possible.

The oiginal code has Path.parent.resolve(strict=True), so have to enure the parent exists (and not just as far as possibe)

Related issue (if applicable): fixes #13107

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@kellerza kellerza requested a review from a team as a code owner March 12, 2018 22:02
@homeassistant homeassistant added core small-pr PRs with less than 30 lines. cla-signed labels Mar 12, 2018
@kellerza kellerza requested a review from pvizeli March 12, 2018 22:03
@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Mar 14, 2018

That work not with Python3.5

A real fix if to check if the path exists and if not, it use the parent for validate like before.

@kellerza kellerza changed the title WIP: Check whitelisted paths #13107 Check whitelisted paths #13107 Mar 18, 2018
@balloob balloob added this to the 0.66 milestone Mar 30, 2018
@balloob balloob merged commit 507c658 into home-assistant:dev Mar 30, 2018
balloob pushed a commit that referenced this pull request Mar 30, 2018
@balloob balloob mentioned this pull request Mar 30, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
@kellerza kellerza deleted the is_allowed_path branch December 30, 2018 18:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

camera.snapshot 'no access to path!' error in 0.65.x

5 participants