aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/language/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'libpathod/language/base.py')
-rw-r--r--libpathod/language/base.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/libpathod/language/base.py b/libpathod/language/base.py
index 407d5473..6de8c086 100644
--- a/libpathod/language/base.py
+++ b/libpathod/language/base.py
@@ -733,19 +733,3 @@ class _Message(object):
Sep = pp.Optional(pp.Literal(":")).suppress()
-
-
-def read_file(settings, s):
- uf = settings.get("unconstrained_file_access")
- sd = settings.get("staticdir")
- if not sd:
- raise exceptions.FileAccessDenied("File access disabled.")
- sd = os.path.normpath(os.path.abspath(sd))
- s = s[1:]
- s = os.path.expanduser(s)
- s = os.path.normpath(os.path.abspath(os.path.join(sd, s)))
- if not uf and not s.startswith(sd):
- raise exceptions.FileAccessDenied("File access outside of configured directory")
- if not os.path.isfile(s):
- raise exceptions.FileAccessDenied("File not readable")
- return file(s, "rb").read()