Skip to content

Commit

Permalink
Use os.path to properly check docroot base path
Browse files Browse the repository at this point in the history
  • Loading branch information
rsa33 committed Nov 17, 2024
1 parent 0eae847 commit d14a52c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion control/webapp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def validate_domain_docroot(owner, path):
top = "societies"
base = os.path.join("/public", top, username, "public_html")
target = os.path.abspath(os.path.join(base, path))
if not target.startswith(base):
if os.path.commonpath((base, target)) != base:
return path, "Document roots must be inside your public_html directory."
elif base == target:
return "", "We've cleared your document root as it appears to be your public_html directory."
Expand Down

0 comments on commit d14a52c

Please sign in to comment.