Skip to content

Commit

Permalink
cptbox: don't allow paths that don't exist
Browse files Browse the repository at this point in the history
This is mostly for compatability with landlock, which enforces this.
  • Loading branch information
Riolku committed Mar 5, 2022
1 parent 7f849c9 commit 7137c54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dmoj/cptbox/filesystem_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def __init__(self, rules: Sequence[FilesystemAccessRule]):
self._add_rule(rule)

def _add_rule(self, rule: FilesystemAccessRule) -> None:
if not rule.exists():
return

if rule.path == '/':
return self._finalize_root_rule(rule)

Expand Down

0 comments on commit 7137c54

Please sign in to comment.