changeset 10280:bae4827d5de8

<fizzie> ` sed -i -e \'s/|tmp//;10i\\\' -e \' elif re.match(r"tmp/(?:|$)",f):\' -e \'10i\\\' -e \' print ("http://www2.codu.org/projects/hackbot/" + urllib.quote(f))\' bin/url
author HackBot
date Thu, 16 Feb 2017 02:23:44 +0000
parents 429f3ab1a941
children 76a97128bd0c
files bin/url
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bin/url	Thu Feb 16 01:06:03 2017 +0000
+++ b/bin/url	Thu Feb 16 02:23:44 2017 +0000
@@ -5,8 +5,10 @@
 else:
     f = os.path.abspath(sys.argv[1])
     f = re.sub(r"^/+hackenv/", "", f)
-    if re.match(r"/|(?:\.hg|tmp)(?:/|$)",f):
+    if re.match(r"/|(?:\.hg)(?:/|$)",f):
         sys.exit("File is outside web-viewable filesystem repository.")
+    elif re.match(r"tmp/(?:|$)",f):
+        print ("http://www2.codu.org/projects/hackbot/" + urllib.quote(f))
     else:
         print ("http://codu.org/projects/hackbot/fshg/index.cgi/file/tip/" +
             urllib.quote(f))